Sign in to follow this  

Refraction texture offset

Recommended Posts

In making an ice shader, I have a surface texture, and cube-map refraction and reflection, but also two subsurface textures which I want to be accessed with offsets in their texture coordinates based on the refraction vector. My question is the proper way to compute the offsets. The way I did it is by transforming the refraction ray to the local tangent space (untransformed, it is used to get the usual cube-map refraction), and then, assuming the subsurface texture lives 0.2 units under the surface, the offset I add to the texture coordinates is 0.2 * inner.xy / inner.z; However, I don't know if this is correct... and also should I normalize the interpolated inner before the division?

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