Hello, I am working on custom model loader and using the MorphTargetManager, and I have encountered a problem while rendering models where the morph target exists.
The errors are as follows(in firefox) WebGL warning: drawElementsInstanced: Tex unit 0 referenced by samplers of different types: SAMPLER_2D_ARRAY (via morphTargets) and SAMPLER_2D (via boneSampler).
and as a result, the morph targets are not functioning correctly.
Playground that reproduce error:
Code to load the morph target used to reproduce the error:
It is possible that I have been using the Morph Target Manager incorrectly, which may be causing this issue.
I fixed PG now. If it does not work, try disable cache.
Thank you in advance.
edited+
I just found the problem. It seems that when a MorphTarget does not have position data, it causes issues. Is this intentional? If so, then I need to include position data unnecessarily when generating UV morphs.
Both morphA and morphB include positions and normals, but morphA does not have uvs information.
Generally, in such cases, the user’s intention for morphA would be to indicate a morph target without uvs. However, the behavior of the actual implementation would make it appear as if an array filled with zeros was used.
I think specifying this as a consideration or requirement can help reduce confusion
Actually, a morph type (normal, uv, tangent) will be enabled only if all targets define one. In your example, morphA does not define uvs, so uv morphing is disabled.
If you still want to use uv morphing, you will indeed have to define a uv array for morphA and set an influence of 0.