engine icon indicating copy to clipboard operation
engine copied to clipboard

Broken rendering with khronos GLTF PrimitveModeNormalsTest

Open MAG-AdrianMeredith opened this issue 8 months ago • 3 comments

Image

The official GLTF samples repository has an example https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/PrimitiveModeNormalsTest which doesn't render correctly on macos m3 max

see attached model

PrimitiveModeNormalsTest.glb.zip

MAG-AdrianMeredith avatar May 02 '25 08:05 MAG-AdrianMeredith

also in playcanvas viewer

Image

MAG-AdrianMeredith avatar May 02 '25 08:05 MAG-AdrianMeredith

Its slightly less broken in webgpu but still incorrect

Image

MAG-AdrianMeredith avatar May 02 '25 08:05 MAG-AdrianMeredith

I improved this in https://github.com/playcanvas/engine/pull/7706 - now it looks the same in both WebGL and WebGPU (in the engine example created for this)

Image

The remaining issue is that those meshes that do not have normals in the glb should render as unlit. In our glb parser we call generateNormals to generate normals for meshes without them. Ideally we would avoid doing this and configure material to not depend on them, but changing this would possibly break many projects, so I'm hesitant to do so.

mvaligursky avatar May 23 '25 09:05 mvaligursky