Allow scene to use phong shading and custom light setups #515
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.
Motivation and Context
Previously, we assumed that all scenes would be flat shaded, and all physics objects would be phong shaded. These assumptions are wrong given some new example scenes. This PR allows scenes to be loaded in with a light setup other than
NO_LIGHT_KEY
.This is slightly more complicated than just adding a parameter, since we take a certain path if an asset is flat shaded versus phong shaded (ie. skip generating normals, override ambient material textures with diffuse, etc.). If an asset is attempted to be reloaded with different lighting requirements, for now we just warn the user and render with existing loaded materials/normals. If required, in the future we can hold two "variations" of the same asset to allow for both cases to be instantiated at once.
How Has This Been Tested
sceneLightSetup
s in viewerTypes of changes
Checklist