RectAreaLight: cleanup and refactoring #11232
Merged
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.
Cleanup, removal of unused code, and some refactoring. There is no change to the algorithm or rendered output.
Some of the refactoring is subjective, obviously, but this is a first step of several in making sure our units are correct.
Regarding our implementation of area lights: Although the LTC algorithm we are using can be applied to other BRDFs, the corresponding
ltcMag
andltcMat
data is based on the GGX distribution specifically, and is not appropriate for Phong.Just as Lambert does not support area lights, I would recommend we remove the Phong area light support, too. This will further simplify the codebase.
Users can use MeshStandardMaterial and MeshPhysicalMaterial, instead.
We hope to support other area light types -- and near and distant light probes -- too, I expect, and having to support two similar specular models doesn't make a lot of sense.
There have been suggestions to remove Phong completely, since it really is redundant at this point, but keeping it around as a simple specular illumination model, with Lambert as a simple non-specular model, is reasonable, I guess.