Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect metallic calculations in PBRLighting.frag #2334

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yaRnMcDonuts
Copy link
Contributor

@yaRnMcDonuts yaRnMcDonuts commented Dec 1, 2024

addresses this issue: #2330

There were 2 apparent issues with our metallic calculation that were causing our PBR implementation to render different visual results compared to the khronos PBR standards:

  1. fZero was being calculated incorrectly, as mentioned in the linked issue
  2. the nonMetalSpec float constant was being set incorrectly. According to what I've read, it should always be 0.08

I also checked tested changes in my own app and it appears the rendering difference is more accurate now. But I'm not an expert in lighting math like this, so let me know if anyone sees anything else that looks incorrect with the PBR shader's code.

addresses this issue: jMonkeyEngine#2330

There were 2 apparent issues with our metallic calculation that were causing our PBR implementation to render different visual results compared to the khronos PBR standards:

1) fZero was being calculated incorrectly, as mentioned in the linked issue
2) the nonMetalSpec float constant was being set incorrectly. According to what I've read, it should always be 0.08

I also checked tested changes in my own app and it appears the rendering difference is more accurate now. But I'm not an expert in lighting math like this, so let me know if anything looks incorrect with the code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant