Sign in to follow this  
Aramil04

Scene Shading: How To?

Recommended Posts

Hello, I've been looking for a while now for some tutorials that would explain how to create distortions in one's scene (things like heat shimmers, etc.). I must be looking in all the wrong places, because I can't find anything that explains exactly what it is I'm looking for. From what I've read, adding these effects involves something like rendering both the scene and the distortion effect to separate textures and then using a shader to 'put them together' in a way such that the scene texture is now distorted according to the appearance of the distortion texture. From then it's a simple matter of displaying the newly created scene image. Whether this is right or not, :) it's not enough for me to go on with. Would someone mind pointing me in the direction of some tutorials that would explain this further? Thanks.

Share this post


Link to post
Share on other sites
Yep, you guessed right.

Start off by implementing an FBO - a Framebuffer Object. You render your geometry to the FBO, then pass it to your post shader as a texture.

Your post shader warps the texture as your wish, and is rendered as a full-screen quad in Ortho view.

Start off here: http://www.gamedev.net/reference/articles/article2331.asp

Share this post


Link to post
Share on other sites
Okay. At your request, I've now read and understand the article on FBOs. I'm also clear on how to display the scene using a quad.

The part I don't understand is the one step in between, where I somehow use shaders to create the distortion in the scene image.

An example of what I'm trying to accomplish with shaders is something to the effect of what can be seen here, under the journal entry entitled "Screen-Space Distortion Magic." A tutorial explaining the coding-part of how I would do this (or something simpler, if this is too complex) would be extremely helpful.

Share this post


Link to post
Share on other sites
Quote:
Original post by Aramil04
Yes, I'm actually referring to both. I would be using GLSL. If this is too complex (or too involved), feel free to just throw a few tutorials at me. :) Thanks.


I would start off learning GLSL itself, and leave the post-processing until you have a few pixel skills under your belt.

Take a look at the Lighthouse tutorials for GLSL, it'll teach you how to set up the runtime side and colour a few pixels in on actual geometry, as well as some basic lighting.

After you're comfortable with the shader pipeline, throw in an FBO and start experimenting with image manipulation shaders.

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