Skip to content

Vertex colors not loaded in Gltf models #1871

Closed
@ghost

Description

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

Metadata

Metadata

Assignees

Labels

bugSomething that is supposed to work, but doesn't. More severe than a "defect".

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions