question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GLTFLoader: Vertex color alpha support

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
takahiroxcommented, Mar 29, 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?

2reactions
donmccurdycommented, Mar 27, 2021

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 <kbd>A</kbd> component should have no effect if the glTF material does not use one of alphaMode: BLEND or alphaMode: MASK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gltfLoader vertexColors issue - three.js - Stack Overflow
GLTFLoader. I am using vertex colors and passing them this way. My pipeline looks like: Create Glb -> gltfpack -> load to THREE...
Read more >
Add opacity attribute to vertices #20846 - mrdoob/three.js
The easiest way to do this seems to be adding an opacity attribute to the vertic... ... Feature: Add vertex color alpha channel...
Read more >
WebGLRenderer#alpha – three.js docs
An object containing details about the capabilities of the current RenderingContext. - floatFragmentTextures: whether the context supports the OES_texture_float ...
Read more >
Vertex Colors - Sketchfab Help Center
Vertex colors are RGBA color values applied directly to vertices in meshes (as opposed to material definitions and/or textures).
Read more >
Verge3D 4.0 for Maya and Ultimate - Soft8Soft
Upgraded glTF loader that now supports more glTF extensions. ... We supported vertex colors via the aiUserDataColor node.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found