Q. for Skidracer, Entity Structs

Blitz3D Forums/Blitz3D Programming/Q. for Skidracer, Entity Structs

Tom(Posted 2004) [#1]
Hi,

From a noobs perspective (i.e, me!) the new SystemProperties in v1.88 could open the door to some extra functionality.

Now that you've done that, would it be possible to release some information on how Blitz3D stores things like Meshes, Textures e.t.c?

We have threads like this but there's a lot of guesswork involved.

http://www.blitzbasic.com/Community/posts.php?topic=27669

Example: Shadow Volumes, whether they're viable or not yet under DX7, direct access to mesh data would be especialy useful, if not absolutely neccessary, for this to work 'right'.

Any info, official or unnoficial, would be appreciated I'm sure.

Cheers for the update
Tom
/he who has fingers crossed


Ross C(Posted 2004) [#2]
Bumpy :o)


Tom(Posted 2004) [#3]
Rumpy Bumpy!

Reading up some more on stencil shadows, to do them you'll need to create shadow volumes, to do that quick & easy it would be nice to get access to Meshes, or as Noel mentioned in another thread, the vertex buffers.

All seems 'doable' from what I've read though.


Ion-Storm(Posted 2004) [#4]
add me a whole heap of Cows backside(rump) to that


Beaker(Posted 2004) [#5]
*poke*


poopla(Posted 2004) [#6]
*bumpsy*


IPete2(Posted 2004) [#7]
*Daisy*


Tom(Posted 2004) [#8]
Earth calling Skid....come in Skid

BB Image struct would be good too :P


skidracer(Posted 2004) [#9]
If I was to expand Blitz3D (whichisn'tmyjob) I would start with some fast bulk transfer routines to speed up updating

ReadPixels x,y,argb[],offset,count
WritePixels x,y,argb[],offset,count

A double buffered option on lockbuffer may also help texture update speed (I think you can avoid blocks caused by locking the same texture space as that which may be locked by the GPU for current rendering actvity).


The same goes for VertexBuffers, a couple of commands for reading and writing the raw vertex and triangle buffers with array parameters may provide some speedup but if you are causing a block with the gpu then it could possibly end up being a wasted effort.


If VertexX, Y and Z had a [,objectspace] conversion option you could read out vertex location of animated meshes, I cannot imagine the hack needed for that kind of operation in the current version.


Tom(Posted 2004) [#10]
Hmm, not quite what I was on about :)

I was more interested in stuff like, how BB stores an Image, is there a standard BITMAP pointer tucked away at int(myImage + x) ? Or ImageBuffer(myImage)+x?

For example, I found that PeekMemInt(TextureBuffer(tex)+12) returns a valid DirectDrawSurface7 pointer for that texture.

But there's no way to create a texture within a DLL and return a pointer that can be used to assign that texture to an Entity.

Direct access to vertexbuffers would be useful.

Cheers
Tom


skidracer(Posted 2004) [#11]
You can only read / write texture / vertex data in dx7 after a lock so extended results from lockbuffer and maybe a new lockvertexbuffer command may be what you are after.

In regards to hacking, I would imagine the logic would be simple enough to follow if you stepped into a lockbuffer call with any decent debugger hook up (which I imagine you will require for all that volumetric c code you have planned).

hint: if you are in visual studio build your dll in debug mode, put a breakpoint in a function called by your blitz app, when you hit F5 it will ask you for an exe to run, select your blitz app, ignore the missing debug warning and you be sussed, when you step out of the function you have breakpointed, you will be stepping through your blitzapp in good ol x86 assembler


AntonyWells(Posted 2004) [#12]
All mark has to do (if he wants people to have access) is post a copy/paste of the image/texture structure.

Then we can just pass it through to a .dll as a memory pointer, and cast it into a image struct/object in the custom .dll (Assuming they return memory addresses, not internal handles blitz generates..)
I've done it with types made in blitz, recreated them as structs C++ side, with a 5 int pad..

No need to hack about with debuggers then.


Tom(Posted 2004) [#13]
ASM, ouch! :)

Just an idea on how BB stores Image & Texture pointers would do me.


Tom(Posted 2004) [#14]
Doh!

Image are directdraw surfaces too :) ... I'm slow on the uptake, but getting there!

This stuff could be useful for many things, like the BlitzMovie DLL, currently the author is using read/write pixelfast to draw the image when he could be blitting!

Tom