Thank you for this great tutorial. I am new to shaders and it is really a huge help.
I played with the parallax shaders and discovered that their visual depth is changing depending on the view position. The sharper the view angle, the less deep they look.
My guess is that stepDistance should depend on view direction, actually we should travel along the ray the longer the sharper the view angle to reach imaginary intersection with next layer.
I added following modifications which seem to fix the issue:
struct Input
{
//What Unity can give you
float2 uv_NoiseTex;
//What you have to calculate yourself
//The camera direction in tangent space
float3 tangentViewDir;
// cos of view direction to surface normal
float cos;
};
I am not sure this is an optimal solution, so please review. Thank you again