Render To Texture Only Once

Started by
1 comment, last by Bow_vernon 13 years, 6 months ago
Sorry I couldnt think of a better title for this thread. Well, just right to the point, shall we?

I'm studying about post processing effects, shadow mapping, and (perhaps later) deferred shading. They use a render to texture process quite heavily, but I only want to render the scene once. Well form the way I look at it, I guess I will have to render the scene at least twice (once for the texture, so I have to resize viewport, render scene, and copy to texture. And once again for the normal rendering process).
I think the main reason they have to render twice is because the texture dimensions dont match the application viewport size. I'd like to know if there's a way to render to texture But only involving one rendering pass (I just want to draw the scene once), and the result is usable for both the texture and the normal rendering pass.......

PS : Sorry for my bad english, still learning though.....
Advertisement
You should only render the scene once.
You can either:
* render directly to a texture with the same size as the back-buffer.
or
* copy the back-buffer to a texture of the desired size.

The first option is very common on modern hardware. Look up "FBO", or "Render to texture".


[EDIT]
Also, usually post-processing requires several textures. So you might have:
[A] Same size as back-buffer, with MSAA enabled.
Half size of back-buffer.
[C] Half size of back-buffer..

Then we might (for example):
1) Render scene into [A]
2) Copy (downsize) [A] into
3) Render into [C] using post-effect #1
4) Render [C] into using post-effect #2
5) Render [A] and into [Frame Buffer] using a blend/combine effect.
Thx. Now Im using FBO for fast render to texture.

This topic is closed to new replies.

Advertisement