Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).
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!)
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.
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.