Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


reflection: by stencil vs by render-to-texture

This topic is 5491 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

I assume the reflection can be done by stencil buffer OR render--to-texture. What is better in your opinion? thanks for your smart idea Khanh

Share this post

Link to post
Share on other sites
Well, stencil will generally be cheaper I''d imagine, but the primary reason people use render-to-texture is so that the reflection can be rippled (using either per-pixel dependent reads, or per-vertex perturbed uvs). To do this, you obviously need to be able to feed the reflection in as a texture to another pass (fullscreen, or water surface), hence the need for render-to-texture. Also, in this same pass you can add in fresnel terms, sun lighting etc.

So, if you want funky looking water like in HL2 etc, then go for render-to-texture. But if you just want a flat mirror reflection, then go for stencil.


Matt Halpin

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!