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.
This is my first attempt to upstream a rendering improvement from <model-viewer> to three. This is based on some analysis I've done showing that sampling the environment should not be done at the reflection vector for rough materials, but rather at the normal vector (as for the diffuse term). I fit equations to the Trowbridge-Reitz distribution to handle both interpolating the sample vector based on roughness as well as looking up the proper mip (since before it was based on Blinn-Phong, which isn't consistent with GGX). This roughness remapping only affects the non-PMREM version, as I'm still working on an improved PMREM based on this line of reasoning. The remapping has the effect of making materials appear a bit less shiny, which brings it closer to other renderers.
As an example of sample vector change, note the before image where, ignoring the lack of self-shadowing, we see strong reflection of the sun, even where the material is not facing the sun:
Versus with this change:
A writeup of my analysis, including future work (please excuse the poor formatting, I've filed a bug):
elalishPMREM.pdf