Jump to content
  • Advertisement
Sign in to follow this  
adoado

Refraction Help..

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

Hello all, How can I perturb (?) an image with a normal map? Basically, I have an image, and I want to "fake" refractions by offsetting texcoords with the normal map, hows the best way to do this? Thanks, Adoado

Share this post


Link to post
Share on other sites
Advertisement
Well, there are few ways, how to achieve that. First of all, there's raytracing, but i think, you're using rasterization to render scene (raytracing is a little "overkill").
Another way is to do that with normal maps or dudv maps. Well, do standart normal mapping for specular lighting, but use normal map red and green parameter as offset for texture coordinates (you'd probably need to do divide them by some variable like 0.25, or something like that, there'll be some small artifacts even if you'd use frensel term), you can calculate frensel term too.
DUDV maps are derived normal maps, which am I using to achieve that (it's very fast instead of raytracing), use them as offset texture. If you need converter, there's one on ati web pages - normal to dudv converter (there'd not be any artifact, if you'd use frensel term).

Share this post


Link to post
Share on other sites
Awesome, thanks for your reply ;)

I am using HLSL, so yeah, ray tracing is not really an option ;) ;)

I will try what you suggested, thank you ;)

Share this post


Link to post
Share on other sites
I wrote a small test app (OGL + GLSL) that implemented normal mapping a year ago. I cannot find the code, but I currently need it anyway, so PM me if you want me to send you the code once I find it...

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!