Search Unity

Question Need a shader that assigns vertex colour as the base colour.

Discussion in 'Editor & General Support' started by hermanthecrap, Sep 6, 2022.

  1. hermanthecrap

    hermanthecrap

    Joined:
    Feb 4, 2022
    Posts:
    37
    Like the title says, could really use some help here. Pretty much have a .gltf in Blender that I have Vertex colors on part of it, and I make it an .fbx and need the textures working in Unity instead of just being untextured.

    Thanks.
     
    Last edited: Sep 6, 2022
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Pretty sure you can easily get VertexColored shaders right off the first or second google link that comes up...
     
  3. hermanthecrap

    hermanthecrap

    Joined:
    Feb 4, 2022
    Posts:
    37
    Instead of being a bit rude could you please send it over? I've been trying to find one for the past three days.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
  5. hermanthecrap

    hermanthecrap

    Joined:
    Feb 4, 2022
    Posts:
    37
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Dunno what you're doin' man, but works for me. See enclosed.

    I made a mesh in Blender, RGB, colored each letter with vertex coloring, saved it as blender, exported it as FBX, put the above shader in a file, made a material out of it, put TWO copies of RGB in the scene, one using the default whatever material, one using the VertexColor shader.

    And BAM...

    Test good, found good. Full package enclosed, SS for proof.

    (I think I didn't do a good job painting in the green but I was always a difficult child when it came to crayons, like insisting on eating them, etc.)

    Screen Shot 2022-09-06 at 8.32.16 PM.png
     

    Attached Files:

  7. hermanthecrap

    hermanthecrap

    Joined:
    Feb 4, 2022
    Posts:
    37
    Capture2.png Capture.PNG
    I know this is stupid, but could you please explain how you made a material out of the shader? I think that's where I'm messing up - This is what I tried and I just ended up with pink, and I didn't get the textures in my map that I was supposed to. Also this image below, I put that shader on the texture I needed, and this happened. The textures that you do see working aren't Vertex Colors.

    At this point I'd be willing to screen share or something, I've been at it for days now.
     
    Last edited: Sep 7, 2022
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Right-click on the shader, then create material... pseudo-undocumented because if you "Create" anything else, it just creates it unrelated to the shader.

    OR... the way that ALWAYS works: create any material, then go pull down the shader selection at the top of the material, look for the shader by name, in this case
    Custom/VertexColors


    You should just grab some random textures off the net and make a material and try ALL the shaders on a cube and a sphere and see what they do... explore your software tools! :)
     
  9. hermanthecrap

    hermanthecrap

    Joined:
    Feb 4, 2022
    Posts:
    37
    7.png
    I did it and the shader material is pink, I tried it with another Vertex Color shader and it's also pink. It isn't if I just apply it to a material either, the shader materials that the asset addons come with are also pink. I've already tried upgrading. I'm on URP
     
    Last edited: Sep 8, 2022
  10. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
  11. hermanthecrap

    hermanthecrap

    Joined:
    Feb 4, 2022
    Posts:
    37