Repository navigation
Devel - #3781
Merged
Merged
Devel#3781
Conversation
glTF hides a node by keying its scale to zero. parseAnimation composed each key into a matrix, mapped it into the skeleton parent's space and decomposed the result; with a zero scale component that matrix is singular, so the decomposition returned NaN rotation and scale and the whole track became NaN. Decompose with the zero components replaced by one and zero the matching component of the decomposed scale afterwards. Keys without a zero scale are computed exactly as before.
The loader creates the skeleton manually and never called Skeleton::setBindingPose(), which SkeletonSerializer does for skeletons loaded from file. Every bone therefore kept an identity initial state: entities were unaffected because SkeletonInstance sets its own binding pose, but Skeleton::reset() on the mesh's skeleton collapsed all bones to the origin, and animations applied to it started from there. Set the binding pose once the bone hierarchy is built.
genQuadVertices had three copies of the code writing the four vertices, one per rotation mode. Only the corners and texcoords differ between them, so compute these first and share the code writing the vertices. Keeping the buffer pointer and the billboard position in locals is needed, as the compiler otherwise reloads them after every write. With this the function is as fast as before, in fact slightly faster for unrotated billboards.
…state preAddToRenderState is called after the scheme and the custom render state are merged, so a lighting stage that replaces the per-pixel lighting of the scheme is never instantiated and no longer sets the SO_PHONG marker on the source pass. ClusteredLightCulling used that marker to check whether lighting is evaluated per pixel, so it was silently dropped. This happens in Sample_ShaderSystemMultiLight, where Cook-Torrance replaces the per-pixel lighting and the sample materials have no metal_roughness map. Check the resolved render state for the lighting sub render states that consume the froxel light list instead. They are the only two users of FroxelLights, which is more precise than the shade option and does not depend on the order the sub render states are called in. Add a regression test that links Cook-Torrance with the clustered light culling on a pass that is not SO_PHONG.
srcPass->setShadingMode(SO_PHONG) marks a pass whose lighting is evaluated per pixel and is read by sub render states that detect such a pass. It sat behind the metal_roughness map early return, so it was only set for materials that configure that texture. Set the marker as soon as the lighting stage applies, matching what FFPLighting does for the per-pixel lighting sub render state that Cook-Torrance replaces.
The hook is called after the scheme and the custom render state have been merged with the overrides resolved, not before the sub render state is added. Describe the resolved view it gets, and that sub render states which are overridden are never instantiated and that the pass must not be used to pass information between sub render states.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.