Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGLBindingStates setupVertexAttributes BUG #20196

Closed
xjindf opened this issue Aug 27, 2020 · 6 comments
Closed

WebGLBindingStates setupVertexAttributes BUG #20196

xjindf opened this issue Aug 27, 2020 · 6 comments

Comments

@xjindf
Copy link

xjindf commented Aug 27, 2020

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 );
}
@takahirox
Copy link
Collaborator

takahirox commented Aug 27, 2020

Hi, thanks for the report!

Would you mind if making an example which can reproduce the error at jsfiddle? It helps us investigate the problem.

(Note to Three.js core devs. If I'm right, it doesn't sound like a VAO related problem. It seems to have existed even since before we introduced VAO)

@xjindf
Copy link
Author

xjindf commented Aug 27, 2020

@xjindf
Copy link
Author

xjindf commented Aug 27, 2020

Before joining the instancematrix, my program is working well, so a judgment should be added here

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 27, 2020

Duplicate of #17701.

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 27, 2020

There is also a PR for fixing this issue: #20135

@Mugen87
Copy link
Collaborator

Mugen87 commented Aug 30, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants