[SM5] Error X4532 with POM Material

I got a quick test working using curvature of the vertex normals combined with fresnel to bend the ray by adding to the z offset at each iteration.

The main issue with this technique is that it requires lots of extra steps otherwise the ray simply hits the end of the tracing wall. Or the code could be modified a bit further to automatically trace beyond the max distance using the curvature but that will be a little bit trickier.

The ‘deeper’ the height ratio is the more extra steps will be required. In my test, the height value was 0.5 meaning the texture is half as deep as it is wide. That is way deeper than most pom materials (I’d say the average is 0.05 or so).

Without:

With Silhouette Curvature Mask:

The math is not fully solved yet so right now I am using a hand-set fudged number for the amount of z offset based on the curvature. Really that number needs to be made relative to the stepsize and properly solved. So this is one step closer but not quite to the point where I can check it in. Also the z offset isn’t being incremented properly yet either which adds a sort of fisheye effect (non-uniform uvs on the above cylinder make it look worse than it is though).