While making a POM material, shadow map is inverted

So I was trying to make my first POM material, and I was trying to figure out the self-shadows. I, of course, followed video tutorials on how to make a POM material, and everything goes well, until the shadow mask.

For some reason, my shadow mask seem to be inverted. Not as in “what should be white is black, and vice versa”, but more as if the engine took the correct Skylight Vector, but inverted the actual direction of the light along that vector.

As you can see on the image, you have in the background a house which casts correctly oriented shadows, and you can see on the cube with the POM material that the shadows there are the opposite way. The face on top is in darkness, while it should be lit directly by the sun and have shadows, and the two visible side faces should be in darkness (because opposite of the sun), but have shadows as if the sunlight was coming from the ground.

Does anybody know why this is happening and how to fix it?

Here are a few steps you can take to troubleshoot and potentially fix the issue:

  1. Check Light Vector: Verify that the light vector used in your POM material is correctly aligned with the direction of your sunlight. Ensure that the light vector is pointing in the same direction as the sunlight to produce accurate shadows. You may need to adjust the orientation of the light vector in your material setup.

  2. Inspect Normal Map: Examine the normal map used in your POM material. Ensure that the normal map is correctly encoded and aligned with the geometry of your mesh. If the normal map is inverted or improperly aligned, it can cause the shadows to appear incorrectly in the POM material. Double-check the normal map texture and adjust its settings if necessary.

  3. Review Material Setup: Review the setup of your POM material, including the displacement mapping and shadow calculations. Make sure that all parameters are configured correctly to produce the desired effect. Check for any inconsistencies or errors in your material blueprint that could be causing the inverted shadows.

  4. Test Different Settings: Experiment with different settings and parameters in your POM material to see if you can correct the issue. Adjust the depth bias, scale, and offset values to optimize the self-shadowing effect. Additionally, try changing the lighting setup or environment to see if it affects the appearance of the shadows.

  5. Consult Documentation and Tutorials: Refer to the documentation and tutorials for Parallax Occlusion Mapping in Unreal Engine or other game development resources. Look for guidance on troubleshooting common issues with self-shadowing in POM materials and implementing best practices for achieving realistic lighting effects.

By carefully reviewing your material setup and experimenting with different settings, you should be able to identify and resolve the issue with inverted shadows in your POM material. If you continue to experience difficulties, consider seeking assistance from the Unreal Engine community or forums for additional support and advice.

Thanks ChatGPT lol

But I don’t think any of those can help me.

  1. “Check Light Vector”, how do i do such a thing? The input “Light Vector” of my POM node in the material has “SkyAtmosphereLightDirection” as input (with the correct index).
    Do I maybe need to change that input and put something else?

  2. “Inspect Normal Map”, I’m guessing you’re referring to the Height Map used in the material, considering it’s the one being the input of the POM node. It was really quickly made, as it was my first test at POM material, but I think it’s still good.

  3. “Review Material Setup”, the displacement mapping is perfect, it’s just the shadow calculations that are not good. But I don’t think I can change much to it as it happens inside the POM node.

  4. “Test Different Settings”, I did, and none gave me the expected result, the light source used to calculate the shadows stays inverted compared to the real light source it should use.

  5. “Consult Documentation and Tutorials”, I made the material following a tutorial, but it doesn’t give me the same result. And the documentation isn’t really helping, as I didn’t find that specific issue being talked about anywhere.

And lastly, yes I am “seeking assistance from the Unreal Engine community or forums”, right there lol.

Alright I found what I needed to do. I jast had to multiply my light vector by -1 before plugging it into the POM node.

:+1:t4:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.