Skip to content

WebGLBindingStates setupVertexAttributes BUG #20196

@xjindf

Description

@xjindf

When I use the scene with both InstancedMesh and normal Mesh, and set the scene.overrideMaterial =Depthmaterial; then object.instanceMatrix Is the undefined value, because normal Mesh does not have this property. In the setupVertexAttributes method of WebGLBindingStates, const attribute= attributes.get(object.instanceMatrix) On line 386, an exception is thrown. It is suggested to modify the get method of WebGLAttributes and add judgment:

function get(attribute) {
     if (attribute === undefined) {
         return undefined;
     }
    if ( attribute.isInterleavedBufferAttribute ) { attribute = attribute.data ;}
    return buffers.get ( attribute );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions