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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I would arbitrarily add a constant to one term of the BRDF without studying how the product of all the terms behaves in the limit.
Besides, I was under the assumption that we specifically bounded roughness away from zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We bounded roughness, but a2 here is pow4( roughness) which on low precision mobile devices may be able to go to zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only seen this issue arise on low precision mobile devices. a2 = pow4(0.04) = 0.00000256. Mediump float range is [2^-14, 2^14] according to the spec. Many mobile devices are limited to mediump float precision. That means the smallest number is 0.00006103515, which is larger than pow4(0.04), which means pow4(0.04) will round to zero. I believe this explains the issue.