Proper way to rotate a POM (Parallax Occlusion Mapping)

I had the need to rotate a material which used Parallax Occlusion Mapping, but found the base POM material function to not support rotation. To help anyone else in the same situation, below are the changes I made to the POM function to provide a rotation parameter that functions with POM. Please let me know if you think there is a better way to do this.

5 Likes

thanks man. it works! you’ve saved few hours for me:)

thanks, saved my day

Keep in mind if you rotate the UVs of a heightmap for purposes such as PoM, you’ll also need to rotate the vectors within the corresponding normal map or else the shading will be incorrect. It’s not enough to rotate the UVs of a normal map.

3 Likes

looks perfect, thx a lot

Any idea how to get the shadows to correctly rotate when rotating the UVs? I think the Light Trace Length section needs some adjusting but I’ve not worked out how to do it. Right now, the shadows just rotate with the texture so don’t work properly.

Use the rotate about axis node.

  1. Use the -(vertex normal) for the rotation axis.
  2. Use the same -(rotation angle) as with the normal map.
  3. Pivot point is (0,0,0) when rotating a vector.
  4. Position will be -(light vector).
  5. Then, add the output back to your original position aka -(light vector).
  6. Use this as the input for your POM light vector.

Thanks. I actually adjusted the Light Vector in the POM function by breaking out the components and using a custom rotator which seemed to do the trick.