Sign in to follow this  
Bow_vernon

Render To Texture Only Once

Recommended Posts

Bow_vernon    323
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.....

Share this post


Link to post
Share on other sites
Hodgman    51323
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.
[B] 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 [B]
3) Render [B] into [C] using post-effect #1
4) Render [C] into [B] using post-effect #2
5) Render [A] and [B] into [Frame Buffer] using a blend/combine effect.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this