how do you update RGBA textures realtime in the 3DEngine?
Posted: Thu Oct 02, 2008 12:19 pm
Hi, i just started using purebasic like 3 days ago. please help me if you can.
i already searched through the topics looking for an answer but couldn't find one. i am using the 3Dengine and my textures are all loaded from TGA files with alpha channels. i got the effect i wanted so far... very nice. but now i want to do real-time updates of the textures.
the problem is, if i try to use
StartDrawing(TextureOutput(0))
.
.
.
StopDrawing()
then wherever i change the color it turns to 0% opacity. try it out. it will recognize exactly where you are updating the texture but it will just make those pixels 0% opacity. and there is no obvious way to plot a 32-bit pixel with 2D drawing functions (without using DrawingBuffer() which doesn't work in the context of the 3Dengine).
so the solution i am looking for is either:
1) is there some way to plot the pixels successfully... with an additional alpha byte? (i can't find it)
2) and i prefer this one, just as DrawingBuffer() returns the memory address for direct screen drawing... how can i find the starting memory address for the texture data? that is ideal cuz then i can use peek and poke to update the texture real-time which is probably faster.
3) i have to learn ogre... and i don't want to.
please help someone!

i already searched through the topics looking for an answer but couldn't find one. i am using the 3Dengine and my textures are all loaded from TGA files with alpha channels. i got the effect i wanted so far... very nice. but now i want to do real-time updates of the textures.
the problem is, if i try to use
StartDrawing(TextureOutput(0))
.
.
.
StopDrawing()
then wherever i change the color it turns to 0% opacity. try it out. it will recognize exactly where you are updating the texture but it will just make those pixels 0% opacity. and there is no obvious way to plot a 32-bit pixel with 2D drawing functions (without using DrawingBuffer() which doesn't work in the context of the 3Dengine).
so the solution i am looking for is either:
1) is there some way to plot the pixels successfully... with an additional alpha byte? (i can't find it)
2) and i prefer this one, just as DrawingBuffer() returns the memory address for direct screen drawing... how can i find the starting memory address for the texture data? that is ideal cuz then i can use peek and poke to update the texture real-time which is probably faster.
3) i have to learn ogre... and i don't want to.
please help someone!