glTF per-vertex colors as UNSIGNED_BYTE normalized not supported


(Elaughli) #1

I’m tinkering with creating gltf files, and I uploaded this scan in gltf format earlier with the “COLOR_0” component set as floats (0.0 to 1.0) and the color correctly showed in the sketchfab viewer.

While trying to optimize the file, I regenerated the .bin and edited the .gltf to use unsigned char ( UNSIGNED_BYTE ) and was sure to set the “normalized” attribute to true for the “COLOR_0” component this time because the other programs i’ve loaded this gltf into required that.

It seems that uploading that gltf using uchar for colors isn’t correctly being displayed. In fact, the way it is rendered (monochrome with some blue dots) is what it looked like when I loaded it in blender without setting the color attribute “normalized” to true.

Either my gltf formatting is wrong somewhere, which is very possible that it is and different gltf implementations (like my blender plugin) act differently, or there might be a bug in the sketchfab gltf renderer that doesn’t support uchar colors or doesn’t recognize the “normalized” attribute.

I’d be happy to provide more information to help debug this, if you need more than just the gltf file associated with this model.

Here’s a screenshot of the incorrect rendering on sketchfab and what it should look like (and does look like in the only gltf viewer and blender as examples).

This is a link to the model on sketchfab, where you can get the gltf file to inspect.

Upload was done on macOS Mojave (10.14.2) with Google Chrome version 70.0.3538.110


(also speaking to you via your support ticket)

@waleguene is going to be the best person to talk to.

(Elaughli) #4

Thanks! I didn’t see the forum until after I sent the email, but I figured the forum post would be more helpful to others.