Jump to content
  • Advertisement
Sign in to follow this  

Render To Texture Only Once

This topic is 2778 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
You should only render the scene once.
You can either:
* render directly to a texture with the same size as the back-buffer.
* 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".

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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!