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.

Vertex colors not loaded in Gltf models

See original GitHub issue

Models coloured through vertex colours are not properly rendered in the application; various attempts in altering the formats and materials have resulted in null results. If a material isn’t specified, the model is wholly white. Using the lighting material, even with “UseVertexColor” it’s wholly black without details.

The following code is without utilizing any material, but it may be altered to set the ‘Lighting.j3md’ material. “UseVertexColor” does not appear to function as intended.

Light directionalLight = new DirectionalLight(new Vector3f(-10, -5, -10));
Light ambientLight = new AmbientLight();
Material material = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
material.setBoolean("UseVertexColor", true);
Spatial playerModel = assetManager.loadModel("models/TestGirl.glb");
playerModel.setLocalScale(0.5f);
playerModel.setLocalTranslation(new Vector3f(-4,-7.1f,0));

rootNode.attachChild(playerModel);
rootNode.addLight(directionalLight);
rootNode.addLight(ambientLight);

The model file is available here, for testing: TestModel.zip

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
tonihelecommented, Nov 29, 2022

Thank you @Abstrusle for taking the time to report this. GLTF pipeline is very important and as such I’d say this bug is high priority level.

1reaction
tonihelecommented, Nov 28, 2022

I got this fixed, I’ll submit a PR shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vertex Colours from gltf not loading · Issue #1702 - GitHub
I just found out this is broken. Some models in our engine come in as completely black when the vertex colors are wrong....
Read more >
THREE.js glTF loader (binary) does not display vertex colors?
I have a model with precomputed vertex colors.
Read more >
gltf vertex color - MSFS - FSDeveloper
Hi Arno! When importing a gltf model to MCX the vertex color information gets lost. Is it possible to keep it somehow?
Read more >
GLTFLoader – three.js docs
A loader for glTF 2.0 resources. glTF (GL Transmission Format) is an open format specification for efficient delivery and loading of 3D content....
Read more >
glTF 2.0 — Blender Manual
Discontinuous UVs and flat-shaded edges may result in moderately higher vertex counts in glTF compared to Blender, as such vertices are separated for...
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