How to get specific vertex color? Not just red, or green, or blue?

So, its very easy to get a Red or Green or a Blue, just plug them out and you are done.
But what about mixed colors like brown, and purple?
This is the color im trying to get:

Red: 0.54902, Green: 0.464771, Blue: 0.0, #8C7700

I tried something like this:

Though that looks very convoluted. And it doesnt work. There must be an easier way to do this.

My mesh has lots of vertices with different colors. And i need to get them.
Pls help.

Don’t add them, append them?

‘Mixed’ colors are just RGB values. If you sample the white node at the top, it’s RGB. Otherwise if you sample from the individual red/green/blue nodes you can append them (makefloat3) out of them, but that’s the same as the white-node.

The bottom node is alpha.

I am not sure I follow?

If you want the RGB color at a specific vertex, just sample from the white node:

1 Like

thank you. Maybe i wasnt very clear.
I painted my vertex in blender using different colors not just red, green or blue.
I have vertex that are yellowish, brown, purple, pinkish.
But i dont know how to get them.
The node you are using you are multiplying the rgb by 1? What does that do?
Lets say you need to get the vertex that are colored yellow.
How do you do that?
Or vertex that are colored something even more specific like:
Red: 0.54902, Green: 0.464771, Blue: 0.0, #8C7700

Sorry about the multiply, it was moreso that you can just-sample from the white-node to get the RGB values.

Pink/brown/etc are values of RGB; open up a color-wheel and play around to look at what colors drive parts of the output-values.

In the material editor, if you had a value of .5/.5/.5 for your rgb vertex color on the model, that’s what comes out of the white node, .5/.5/.5. The red/green/blue nodes below are more of a convience, that if you just need red, you don’t have to throw a component-mask on your white-value, or a breakout3 node:

The component-mask, the r-output from the break3, and the red-node on the vertex-color are all the same value; just different ways to get it.

Not well versed in Blender, but unless I am missing something, this ought to be easy.

Try this. You painted your mesh whatever, take the white output of the vertex-color and plug it into the basecolor of your material; just that.

Does the vertex-color you expected to come-through show up?

To your specific question:
“Or vertex that are colored something even more specific like:
Red: 0.54902, Green: 0.464771, Blue: 0.0, #8C7700
→ yes, whatever you painted the colors in blender, it ought to be encoded as an RGB value, normalized in the range of 0 to 1. So when you sample from the vertex color node, you are getting that/those values. I would expect what you paint in Blender is what you get in Unreal?

1 Like

I see but i dont understand how can i select a middle ton.
So for example in this image im selecting the red vertices and im putting them in the opacity mask. So thats hiding them.

Here the green ones only.

And the same for the blue ones:

But when it comes to do for example yellow vertices. I cant get them. I tried the lerp node. And googled quite a lot cant find this anywhere.

Looking at the Blender manual, the color-picker looks the same as in Unreal; RGB.

ref - Brush Settings — Blender Manual

" Note

Note that Vertex Paint works in sRGB space, and the RGB representation of the same colors will be different between the paint tools and the materials that are in linear space."

In RGB ‘Yellow’ is a value dervived from the weights of the G and B values so the yellowness of a vertex is would be something like this?

There is no ‘yellow’ vertex-color/weight directly.

The upshot is insofar as different channels/0->1 ranges, you have 4 in vertex-space: Red, Green, Blue, and Alpha. Consistent with the color-model across all of Unreal. So whatever information you want to work with it has to be derived-from, or otherwise fit-in, that model/space.

1 Like

That doesnt work. As you can see there is one cube that is yellow.
I tried a bunch of other similar things before.
Maybe this is not possible unfortunately.
Maybe only the red blue and green are possible.

To expand, there are different ways to get the ‘yellowness’ of a vertex. Per the above, you would want to at least look at the green/blue values but what about the red?

If red is 0, then it’s 0,1,1 which would be yellow-yellow. But if red is 1, then it’s white; does that also count as yellow since white ‘includes’ yellow in this color-model?

Maybe do something like this? Where you weight the yellow-values (GB) against the weight of red, so that if red is 0, it’s ‘full’ yellow, but if it’s white, scaled down to 0?

Again, this is just one way to look at things. What you want is more a logical/process thing since we only have the 4 values to play with. How you want to interpret/see them in this case is more up to you.

Hopefully I didn’t make it too confusing?

Opps, I had my colors wrong, sorry! RG you are correct, but same idea?

The opacity mask only takes a single-scalar. You might want something like this…


I tried exactly that it doesnt work. It only works with the 3 solid colors.
Maybe thats the limitation. Or maybe there’s something we are missing.

Hi , Multiply RGB channels likewise to get RB,BG or RG combinations.

1 Like

I think it was more that he was painting ‘yellow’ onto his vertices and expecting ‘yellow’ to come out in unreal as a node vs having to handle individual R G B channels directly.

There is no ‘yellow’, just values of 0 → 1 across 3 concurrent data-channels, R, G, & B. As color-value, he needs to parse out the RGB values and use those. I don’t think he was abstracting enough and expecting literal pink, brown, yellow nodes to be available vs seeing them as all variations of one-color-value…

2 Likes