0 votes

Wanted to see if we could get a COLOR1, COLOR2, COLOR_3 etc intrinsic shader variables for multiple vertex colors.

In looking at GLTF specs, it appears that vertex color can be an array like COLOR0, COLOR1, etc

If this is in fact true (GLTF supports multiple vertex colors), then I wanted to suggest the possibility of getting support in godot (at some point when funding available) for multiple vertex colors such that a shader program can make use of them as masks.

I hope this makes sense as I wrote it, but using Blender as an example, if you made multiple vertex paints, for instance, for some greyscale to use as masks in shader node graph. I'm not actually sure if blender exports all of them ... (maybe)

But anyways, this would give shaders extra layering support without having to throw a pixel based texture at it (in a way where it can be painted and used as a 3d unpixelated mask).

I would think the industry would support this in general, but my knowledge of 3d is still fairly limited at this point in time. Is there something I'm overlooking here?

in Engine by (29 points)
edited by

Actually, in thinking of this, there really are 4 "inherent" masks the COLOR field if the color isn't itself isn't used from the meshes vertex color.

Otherwise, another solution would be to use the decimal places (thinking logically - I know it's 0-1 scale, but if converted to 0-255 scale, then take decimals) for more masks (if you have a program that would support such encoding). That way could be used in any shader regardless of how many vertex colors available. Idk, something like that could be done now with a blender plugin to export color values in such a way from multiple masks.

All that said (it can be done with right values), it would be real nice to have COLOR1, COLOR2, COLOR_3, etc

I managed to use a second vertex color by converting them to uv and uv2 on blender.
uv1[0] = colorvertex2.red
uv1[1] = color
vertex2.green
uv2[0] = color_vertex2.blue
On Godot, I made a shader that used the two uvs.

I tried your solution on the alpha but the values were getting messed up due to the forced linear color conversion.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.