Rendering To ImageBuffer
Blitz3D Forums/Blitz3D Programming/Rendering To ImageBuffer
| ||
I was wondering how you could render to the image buffer. RenderWorld seems to only render to the back buffer regardless of which buffer I have set. |
| ||
Yes, I believe you can only render to the backbuffer. However, after that, you can CopyRect it onto an imagebuffer. |
| ||
Yep, you can only render to the BackBuffer. I'm curious, though; why would you want to render to an ImageBuffer? EDIT: It's in the Blitz Help Docs, too. Here's an excerpt from the help file for RenderWorld: Renders the current scene to the BackBuffer onto the rectangle defined by each cameras CameraViewport( ). Every camera not hidden by HideEntity( ) or with a CameraProjMode( ) of 0 is rendered. Rendering to other buffers is currently not supported by Blitz3D. |
| ||
People often want to render to a texture, however you'll need to render to the backbuffer and then copyrect to the texturebuffer, so if you want to "render to a texture", make sure to use Texture flag 256, so the transfer from backbuffer to texturebuffer is faster than with standard textures. |
| ||
I actually wanted to have all the black area from one render masked and so I could render it over another render of a different world. Thanks for the help I finally got it to work. |
| ||
Try the fastlibs library. It has a command to copy alpha i believe, and a command for rendering straight to a texture. Not sure about rendering straight to an image buffer though... |
| ||
SetBuffer ImageBuffer(Image, Frame) |