Jump to content
  • Advertisement
Sign in to follow this  
Prune

Refraction texture offset

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

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!