Has anyone written anything that does some serious dynamic texture updates on the fly? I've seen the code examples that write to an image buffer and then copy the buffer to the texture, but the FPS is terrible.
Is it feasable to write a game in Blitz that would write say 100 pixels per frame to a texture? The key point is that the textures are originally loaded in, but then modified on the fly - not animated.
Just as a test this code draws a line across a texture, but takes 4 seconds on my PC:
Is it feasable to write a game in Blitz that would write say 100 pixels per frame to a texture? The key point is that the textures are originally loaded in, but then modified on the fly - not animated.
Just as a test this code draws a line across a texture, but takes 4 seconds on my PC:
Graphics3D 800, 600 SetBuffer BackBuffer() Global texture = CreateTexture(256,256,4+256) Global xPos = 0 ; Setup the camera, light and create a cube camera = CreateCamera() light = CreateLight() cube = CreateCube() ; Position the camera and cube. Point the camera at the cube PositionEntity(camera, 10, 10, 5) PositionEntity(cube, 10, 10, 10) PointEntity(camera, cube) ; Texture the cube EntityTexture(cube, texture) While Not KeyDown( 1 ) If xPos < 255 Then xPos = xPos + 1 ; Green with alpha rgb = $FF0000FF ; Draw a pixel on the texture WritePixel(xPos, 40, rgb, TextureBuffer(texture)) RenderWorld Flip Wend