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.
Normals should be transformed by the inverse transpose of the model-view matrix. See lighthouse3d.com and Jason McKesson's Learning Modern 3D Graphics Programming.
The automatic uniform
czm_normal
, as computed inUniformState
, is currently derived from the transpose of the rotation component of the inverse model-view matrix. This approach is only valid when the model-view matrix has uniform scale.I think
UniformState
was actually correct before #8182. In that PR, we renamedMatrix4.getRotation
asMatrix4.getMatrix3
to better describe what it was actually doing. But then inUniformState
, we mistakenly replacedMatrix4.getRotation
with aMatrix4.getMatrix3
followed byMatrix3.getRotation
.This PR removes the spurious
Matrix3.getRotation
call.One caution: ever since #8182,
czm_normal
has been unitary. This PR will leave a scale component in the matrix, so normals will need to be re-normalized after the transform.