Surface shader ParallaxOffset issue

Hi there,

I am trying to use the ParallaxOffset function to calculate parallax but it gives strange results. Any special thing to do to make parallax working with surface shaders ?

The issue appears when I rotate my object, which destroys the parallax offset effect.

half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w;
float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir);

Thanks a lot

This is a simple and a cheap implementation of the parallax effect. It will look good only at straight-on angles. If you’re looking at the object at a steep angle then the effect will get destroyed. You may look into something like parallax-occlusion mapping shaders.