Jump to content
  • Advertisement
Sign in to follow this  
Quat

Heat Distortion Effect

This topic is 2157 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 am wanting to add a heat distortion effect to my fire particle system.

The NVIDIA fire demo (http://http.developer.nvidia.com/GPUGems/gpugems_ch06.html) uses the following technique:


We rendered a particle system of "heat" particles in a texture target. During the final compositing, we simply used the (red, green) values of each "heat render target" pixel as a (u, v) per-pixel 2D texture coordinates displacement during the texel fetch of the "rendered scene" texture target.
[/quote]

What I am wondering, is why do you think they render into a separate "heat render target". I have a forward pass that renders refractive materials like glass, and it seems to me I can render the "heat" particle system during this pass.

Share this post


Link to post
Share on other sites
Advertisement
The problem is, that you can't (except maybe latest technology) read from and write to the same render target. The disortion effect needs to read back texels from the source image, therefore you can't render it directly to the same render target. Edited by Ashaman73

Share this post


Link to post
Share on other sites
If you render out the distortion amount first, it lets you use a cheaper shader that doesn't sample a render target. Then you just have one pass where you sample a render target. This might be a big deal if there was a lot of overdraw in their particles. Plus it would have allowed them to accumulate the distortion at a lower resolution if they'd wanted to.

Share this post


Link to post
Share on other sites
Think of the heat effect as just one type of scene distortion which uses the current backbuffer as a source texture. There's also frosted/rippled glass, raindrops, ice, and so on. These materials should be drawn last, so our approach is to resolve the current backbuffer into a same-sized texture, then sample it with a screen projection. Shaders which use this texture don't use any lighting, it's already pre-lit. Works nicely for a lot of materials, and doesn't cause any serious performance issues.

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.

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!