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

PBR fixes and visual tweaks. #152

Merged

Conversation

shadielhajj
Copy link
Collaborator

Some fixes and visual tweaks to the PBR shader.
I back-to-backed the HLSL version against the Unity Standard Shader and my own PBR implementation (based on the Karis UE4 variant).

  1. Fixed the Unity light direction in the HLSL version. It was flipped in PR Complete overhaul of the HLSL PBR shader to align with the GLSL Version. #151 (my bad!)

  2. Tweaked the indirect specular component (glsl and hlsl). I'm not sure what was the rationale for the previous implementation. The new one conforms to the Brian Karis article (https://www.unrealengine.com/en-US/blog/physically-based-shading-on-mobile) and in any case looks much better.
    pbr fix

  3. As it's currently implemented, the contribution of point and directional light (direct specular and direct diffuse) doesn't look correct to me. It is missing a multiplication by dot(N, L). I added that to point and directional lights, in glsl and hlsl. Again, the new version looks much better and avoids the overblown fresnel.
    pbr light fix

@patriciogonzalezvivo patriciogonzalezvivo merged commit 7cd125c into patriciogonzalezvivo:main Jul 6, 2024
@patriciogonzalezvivo
Copy link
Owner

Thank you so much for taking the time. The references really shows the difference. Thanks again for you fantastic contribution

@shadielhajj
Copy link
Collaborator Author

Thank you @patriciogonzalezvivo for this fantastic and epic project!

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.

2 participants