Decals export to gltf

Maybe a silly question, but can a decalmap (decals as textures, not meshes) be exported to gltf?. Currently the mesh decal can be exported, but a decalmap cannot. I suppose there is no standard in GLTF2 to do that, so maybe it can be mixed with the diffuse texture?

Just an idea but pack it into extras (see bottom)? Like have an empty mesh and store the decal command data for replication (probably a decal id and six floats for source and target vector).

1 Like

That would work for exporting/ importing from/to babylon. How would for example Blender render that data?

Oh I see. Certainly not impossible via Blender’s python api. But might be less work, as you suggested, to mix the decal into the color texture.

It seems, looking at this playground, if you fire some decals, then go into the Inspector and search for the AlienHead_uvspaceTexture, all the decals are there.

So you can get the image data via texture.readPixels() which you can then merge with the color texture. N.B. You might need a RawTexture for writing.

1 Like

I wonder how a comfortable decalMap editor would look like…

Maybe with another mesh, with similar positions as the source mesh, but have uvs and textures for decals.

1 Like

Not that I’m aware of. I join the working group calls weekly, and I’ve never heard of anyone discussing this.