Refraction texture offset
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement