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.

GLTF / GLB files with vertex colours are not rendered.

See original GitHub issue

Hi,

I just found your project from Hacker News, it’s really awesome - thanks for creating this!

I’m having issues loading GLTF files which use vertex colours, they do not render at all.

For example, the code below should render the cherry model in the attached image - however all I see is a black screen and no errors. I’m wondering if the standard fragment shader does not support vertex colours?

Please find attached a zip file of the model attached.

I’d love to use your library on a project I’m working on, however all of the art assets use vertex colours. 😦

Any assistance you might provide would be most appreciated - I love what you’ve done here!

Cheers, -R

Screenshot 2022-12-22 at 8 02 11 PM `let app = new PIXI.Application({ backgroundColor: 0x000000, resizeTo: window, antialias: true }); document.body.appendChild(app.view);
	// Using a self executing function just to make the different methods more comparable.
	(async function load() {
	  let gltf = await PIXI.Assets.load("cherry.gltf")
	  setup(gltf)
	})()
	
	function setup(gltf) {
	   let mesh2 = app.stage.addChild(PIXI3D.Model.from(gltf));
	 
	    
	   mesh2.scale.set(1);
	   
	  
	   app.ticker.add(() => {
	   rotation=rotation+0.1
	   mesh2.rotationQuaternion.setEulerAngles(0, rotation,0 )
	
	   scale = scale + ds 
	   if (scale > 16){
		   ds=-ds
		   scale=scale+ds
	   }
	   if (scale < 0.01){
		   ds=-ds
		   scale=scale+ds
	   }
	//   mesh2.scale.set(-scale)

//	   light.intensity=scale
	})
	}

	
	//let mesh = app.stage.addChild(PIXI3D.Mesh3D.createCube());
			
	let light = new PIXI3D.Light()
	light.position.set(0,0,50)
	light.range=100
	light.intensity=100
	PIXI3D.LightingEnvironment.main.lights.push(light)
	//mesh.position.y=-1
	let rotation = 0
	
	let scale = 1
	let ds = 0.01
	//let control = new CameraOrbitControl(app.view);
	//app.ticker.add(() => {
	//mesh.rotationQuaternion.setEulerAngles(rotation, rotation++,0 )
	//})`

cherry.gltf.zip

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
richo0commented, Dec 23, 2022

Works perfectly! Thank you very much!

On 23 Dec 2022, at 12:12 PM, Jens Malmborg @.***> wrote:

Created a new version 2.1.1, please let me know if this fixes your issue.

— Reply to this email directly, view it on GitHub https://github.com/jnsmalm/pixi3d/issues/148#issuecomment-1363860400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKARHUWO7B3HVP5CILZHWS3WOWCIVANCNFSM6AAAAAATHBBWRA. You are receiving this because you authored the thread.

1reaction
richo0commented, Dec 22, 2022

Yes - no problem! Sent from my iPhoneOn 22 Dec 2022, at 9:09 PM, Jens Malmborg @.***> wrote: Would it be ok with you if I use this model in automatic tests to make sure this issue won’t come back?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vertex color exported by gltf/glb is darker - Blender Artists
This is why glTF stores linear vertex colors: engines can render the file more efficiently. When the engine is finished with its lighting ......
Read more >
GLTF Vertex Color / Texture discrepancy #90 - GitHub
The rendering of meshes with color information stored in vertex colors or albedo textures is different. From my understanding, they should ...
Read more >
THREE.js glTF loader (binary) does not display vertex colors?
If I generate glTF file and load it using THREE.GLTFLoader, I can call scene.overrideMaterial = new THREE.MeshBasicMaterial({vertexColors: THREE ...
Read more >
Exporting blender model to glb/gltf changes texture color ...
I'm saying delete the vertex color layer itself (ie. in the Properties editor) before you export. Not the nodes.
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 >

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