- Home /
how to call for rgb vertex color in unity?
I have an imported model form blender which has vertex color data assigned to it. However, i don´t want to see that color rendered, just use that information and assign specific code based on the RGB values.
Thanks a lot, but am still a little confused. Am trying to change only the scale of the blue vertices, but I don´t get how.
void Update ()
{
if (Input.Get$$anonymous$$ey ($$anonymous$$eyCode.T))
{
if (color (0, 0, 1, 1))
{
this.transform.localScale += Vector3.one;
}
}
This is just an example and I know it´s not achieved this way (because it doesn´t work), but is more or less what am trying.
Answer by SunnyChow · Aug 14, 2018 at 09:23 AM
Is it for the game logic? or shader?
for game logic,
Color[] color = GetComponent<MeshFilter>().sharedMesh.colors;
for shader, check https://docs.unity3d.com/Manual/SL-VertexProgramInputs.html
Your answer
![](https://koobas.hobune.stream/wayback/20220612172746im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
AddAdditionalVertexStreams and static meshes 0 Answers
Grass slides along the terrain? How to paint vertex alpha in the new blender version for unity? 0 Answers
Mobile Transparent Vertex Color Depth Issue 1 Answer
Persistent data values in shaders 3 Answers
How to get vertex color's alpha channel to work in URP 1 Answer