Render to Texture demo

Blitz3D Forums/Blitz3D Programming/Render to Texture demo

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This version uses BB clear instead of the DLL one, should avoid ATI problems (if any)

http://www.tomspeed.com/r2t-bbclear.zip

After setting the render texture, the render loop is pretty simple:

While Not Keyhit(1)
; Set the renderTexture
SetRenderTarget(renderTex)
CameraClsMode cam,False,True ; don't clear color
ScaleEntity cam,1.33,1,1 ; scale render to fit 512x512 texture
RenderWorld

; Set the render target back to BackBuffer()
SetRenderTarget(rtbb)
CameraClsMode cam,True,True
ScaleEntity cam,1,1,1
RenderWorld
Flip
Wend