Sign in to follow this  

Refraction Help..

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

This topic is 3635 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.

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