Custom Vertex Color attributes in NME?

Using Blender and glTF, it is possible to add additional vertex color channels and get them exported - their name need to start with _ to follow the glTF spec

Application-specific attribute semantics MUST start with an underscore, e.g., _TEMPERATURE. Application-specific attribute semantics MUST NOT use unsigned int component type.

Is there a way to access these in a node material in NME?

I think you can but by code only by changing the name of the attribute in the input block ?

Hmm doesn’t quite seem to work: https://playground.babylonjs.com/#MADFFL#3

This should work as you need to precise the type of the attribute:

Unfortunately webgl forbids the use of 2 consecutives underscores :slight_smile: so I wonder if in gltf they can be named differently or @Evgeni_Popov any ideas ?

FWIW: here is how it shows up in glTF:

	"meshes":[
		{
			"name":"Cube",
			"primitives":[
				{
					"attributes":{
						"_MY_COLOR":0,
						"POSITION":1,
						"NORMAL":2,
						"TEXCOORD_0":3
					},
					"indices":4,
					"material":0
				}
			]
		}
	],
	"accessors":[
		{
			"bufferView":0,
			"componentType":5126,
			"count":24,
			"type":"VEC4"
		},
...

I can’t see the MY_COLOR vertex attribute:

image

cc @bghgary, it seems we don’t support custom attributes when reading a glTF file?

1 Like