Skip to content

Conversation

@elalish
Copy link
Contributor

@elalish elalish commented Aug 26, 2019

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:

threeBefore

Versus with this change:

threeAfter

A writeup of my analysis, including future work (please excuse the poor formatting, I've filed a bug):
elalishPMREM.pdf

@mrdoob
Copy link
Owner

mrdoob commented Aug 26, 2019

/ping @WestLangley @bhouston @sunag

@mrdoob mrdoob added this to the r108 milestone Aug 26, 2019
@mrdoob mrdoob merged commit 74ab5b8 into mrdoob:dev Aug 27, 2019
@mrdoob
Copy link
Owner

mrdoob commented Aug 27, 2019

Thanks!

@elalish elalish deleted the remapRoughness branch August 27, 2019 16:56
sunag added a commit to sunag/three.js that referenced this pull request Aug 27, 2019
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