Skip to content

Buffergeometry with morphAttributes doesnt get animated shadows #8137

@izatar

Description

@izatar

I have a geometry with morphTargets that I converted to a buffergeometry using .fromGeometry. This reduces them memory overhead of the animated model by a very large amount.

It appears that the .morphTargets information has been moved to the .morphAttributes field, and the .morphTargets field has been removed. note: I have seen no documentation on this at all!
So I modified the MorphBlendMesh code that makes animations to use the .morphAttributes instead of .morphTargets, and it works great!

Except for one little hitch. The WebGLShadowMap.js doesn't know about .morphAttributes, it only knows about .morphTargets, and on line 324 it uses the length of .morphTargets to decide whether or not to set the _MorphingFlag which makes the shadows animated.

My workaround is to add a fake 1 entry .morphTargets fieldto my BufferGeometry so this test passes and the _MorphingFlag gets set, and then the shadows get animated.

I think WebGLShadowMap.js could check for the existence of the .morphAttributes as well, and set the _MorphingFlag, because the work-around is pretty silly. On the other hand, I am in over my head here and I'm sure someone will will come chop it off shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions