Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

import vertex color from blender...?

Discussion in 'Asset Importing & Exporting' started by U7Games, May 4, 2014.

  1. U7Games

    U7Games

    Joined:
    May 21, 2011
    Posts:
    943
    Hey all..


    I have painted my meshes with vertex color in blender, now, i´m looking for a way to export it and then import into unity...
    is there any way to achieve that?.. (i don´t have a credit card to buy vertex color paint tool from asset, so i´m forced to use the blender itself...)

    Thanks.
     
  2. DaDarkDragon

    DaDarkDragon

    Joined:
    Jun 6, 2013
    Posts:
    115
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Saving from Blender as usual is sufficient.

    --Eric
     
  4. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Put Blender in object mode and save the blend file. You can export it from blender as an FBX and then import to Unity. Unity will create a materials file from the vertex colors you don't need to do anything special.
     
  5. Cygon4

    Cygon4

    Joined:
    Sep 17, 2012
    Posts:
    382
    I can confirm this works without any special actions in Blender.

    Most of my game world is based on vertex colors - I'm using them with a special Unity shader as texture splatting weights. Thanks to Blender's node-based material system, I even get a perfect preview of how it will look in Unity while painting :)
     
  6. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Not quite, without subdiv on, on export and use in Unity, it looks better in Unity.
     
  7. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    513
    Really? I"ve exported to FBX and see none of my vertex colouring. What are you doing to prep it?
     
    Gravesend and amarpanjis like this.
  8. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,616
    Are you using a shader that supports vertex colors? I don't think any of Unity's default shaders support vertex colors- so the vertex colors are probably there, they're just not being used for anything. You'd need to find such a shader or create your own.
     
  9. Deleted User

    Deleted User

    Guest

    Use the Vertex color node in shader graph and plug it into the albedo
     
  10. WilliamLy

    WilliamLy

    Joined:
    Nov 21, 2020
    Posts:
    1
    I can't find anyone that specifically tells how I am supposed to get my characters vertex colors into unity, can someone help me?
     
    AlejMC likes this.
  11. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,616
    As far as I know they should import automatically when you import an fbx. There's nothing special you have to do to import them.
     
  12. AlejMC

    AlejMC

    Joined:
    Oct 15, 2013
    Posts:
    149
    For anyone trying to make this work, to be able to at least get the vertex colors to be imported by unity, your mesh needs to have 'Face Corners' and 'Byte Color' vertex color type attributes... none of the other combinations worked for me.
     
  13. robertoestradaleyva

    robertoestradaleyva

    Joined:
    May 4, 2018
    Posts:
    2
    this solution worked for me, thanks
     
  14. badjano

    badjano

    Joined:
    Aug 2, 2012
    Posts:
    23
    If anyone is reading this, I could only make vertex colors work from Blender to Unity, by deleting the color attribute, vertex paint it so a new color attribute is added, and then baking the texture onto it, but don't ask me why this works and not simply creating a vertex color attribute from scratch
     
  15. SVAFnemesis_

    SVAFnemesis_

    Joined:
    Jul 15, 2020
    Posts:
    21
    I can confirm that this worked for me. I have to leave the file as .blend and have Unity read from it directly. fbx won't work what so ever.
     
    JFLGD likes this.
  16. qzen

    qzen

    Joined:
    Jul 15, 2021
    Posts:
    5

    its not working at all...
     
  17. qzen

    qzen

    Joined:
    Jul 15, 2021
    Posts:
    5
    Hello!
    I used vevrtex color on my 3d model but it is not showing off on unity...
     
    tonyomendoza likes this.
  18. JFLGD

    JFLGD

    Joined:
    Apr 16, 2022
    Posts:
    2
    Works! imported .blend file directly to unity and made a basic vertex shader graph (create a vertex color node / plugged the output into : fragment / base color and boom!

    .blend model with vertex shader
    https://flic.kr/p/2p4e8jm

    vertex shader graph
    https://flic.kr/p/2p4fzwZ