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

GLTFLoader: Vertex color alpha support #21533

Closed
mrdoob opened this issue Mar 27, 2021 · 5 comments
Closed

GLTFLoader: Vertex color alpha support #21533

mrdoob opened this issue Mar 27, 2021 · 5 comments

Comments

@mrdoob
Copy link
Owner

mrdoob commented Mar 27, 2021

Is your feature request related to a problem? Please describe.

Now that we support vertex colors with alpha (#20975, #21530) how should GLTFLoader handle it?

Describe the solution you'd like

I can see that it's supposed to be supported:

https://github.com/KhronosGroup/glTF/tree/master/specification/2.0

Screen Shot 2021-03-27 at 8 40 15 PM

But should the loader automatically set transparent: true in the material when we find a VEC4 attribute?

@donmccurdy @takahirox

@mrdoob mrdoob added this to the r127 milestone Mar 27, 2021
@donmccurdy
Copy link
Collaborator

That's exciting! :)

But should the loader automatically set transparent: true in the material when we find a VEC4 attribute?

No, the logic for setting transparent: true can remain as it is now. The A component should have no effect if the glTF material does not use one of alphaMode: BLEND or alphaMode: MASK.

@takahirox
Copy link
Collaborator

takahirox commented Mar 28, 2021

And we don't hardcode accessor type for vertex color attribute but we refer to accessor.type to determine the type (vec3, vec4, or so on) so vec4 vertex color attribute should already be supported.

So, my understanding is vertex color alpha + glTF loader should be workable even without any change in the loader if Three.js core supports it, shouldn't it?

@mrdoob
Copy link
Owner Author

mrdoob commented Mar 29, 2021

Sounds good!

@mrdoob mrdoob closed this as completed Mar 29, 2021
@mrdoob mrdoob removed this from the r127 milestone Mar 29, 2021
@mrdoob
Copy link
Owner Author

mrdoob commented Mar 29, 2021

I guess it'd be nice to have a new gltf model test.

Right now they only have this one:
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/VertexColorTest

@mrdoob
Copy link
Owner Author

mrdoob commented Mar 29, 2021

/cc @emackey

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

4 participants