To start, you fill in a struct and request a RT from Renderer:
Code: Select all
RenderTargetDesc desc = {};
desc.width = 512;
desc.height = 512;
desc.TextureFormat = TEXTURE_RGB;
desc.DepthFormat = TEXTURE_DEPTH;
RenderTarget *sceneRt = renderer->CreateRenderTarget(desc);
Code: Select all
renderer->SetRenderTarget(sceneRt)
...draw some junk
renderer->SetRenderTarget(0);
Code: Select all
someMaterial->texture0 = sceneRt->GetColorTexture();
- postprocessing (obv)
- dynamic textures (facegen or faction logo gen)
- fancy UI background blur
- generating ship silhouettes (for targeting info maybe? or a cool equip screen)
Question #2 is, can we make GL_Framebuffer_object a requirement? It really wasn't core until OpenGL 3, but the extension is very common. I have some gl extensions dumps from pioneer bug reports and fbos are always available.