Search Unity

FBX per-face vertex colors

Discussion in 'Editor & General Support' started by pwnya, Jun 5, 2013.

  1. pwnya

    pwnya

    Joined:
    Jun 5, 2013
    Posts:
    2
    Hello community, I've got a weird case here that I'm hoping has a fix.

    I'm trying to use vertex colors painted per face, but FBX seems to only export per-vertex color values. You can see in this image what I mean... it's not properly exporting vertices that have multiple vertex colors. The only workaround I've come up with is making that face a separate element (which is literally adding vertices to export). It's not an acceptable workaround in case I want normal smoothing between these faces.

    Is this an FBX export issue that can be solved? There aren't many flags in the Unity model settings to mess with, and I've tried all the FBX options (using all the latest 2013 versions of Max and FBX as well)

    $VertexColor.jpg
     
  2. BIG-BUG

    BIG-BUG

    Joined:
    Mar 29, 2009
    Posts:
    457
    Actually that would be the only way to do it as color(like UVs and normals) is stored per vertex, not per face. Why is this a problem for you?
    Normal smoothing should not be affected by this.
     
  3. Annihlator

    Annihlator

    Joined:
    Oct 15, 2012
    Posts:
    378
    The normal smoothing would be broken if he breaks up the vertex in multiple vertices (Also known as edge-breaking) as then the edges are no longer connected.

    Sadly, unity allows single rgba value for a single vertex's color data. So the best workaround i can think is to up your amount of vertices (subdivide)
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Split the mesh in max (they can be elements within the same mesh), it's the easiest way if smoothing groups don't work and you're exporting FBX as Autodesk Media and Entertainment.
     
    PrimalCoder likes this.
  5. pwnya

    pwnya

    Joined:
    Jun 5, 2013
    Posts:
    2
    I guess the way Max does it internally is some behind-the-scenes duplicating to get that effect. Unity does indeed only support one color value per vertex.

    It looks like the final workaround is to split the mesh as another element, and then use Max's "Edit Normals" modifier to manually average the offending normals.

    Thanks for all the replies, guys!
     
  6. Mark-W302

    Mark-W302

    Joined:
    Aug 19, 2013
    Posts:
    2
    Hi there,

    Hey is this really a confirmed problem with Unity? Has anyone notified them of this?

    I'm going through all this now trying to get painted UV's into unity without being all messed up and discovered that separating smoothing groups into objects fixed it, even though it was an ugly solution.
    I just cannot have this! As my game will be on mobile and i want to have one world mesh only with painted vertices. Older engines ive worked with have no problem interpreting the vertex colours perfectly so i don't see why Unity cant do it, or why there shouldnt be an option to have more than one colour per vertex.
     
  7. AShim-3D

    AShim-3D

    Joined:
    Jul 13, 2012
    Posts:
    34
    try to turn off mesh compression and optimize mesh and set normals to import in import mesh inspector.
     
  8. Mark-W302

    Mark-W302

    Joined:
    Aug 19, 2013
    Posts:
    2
    done all that, still no love.

    Just checked and its been suggested to the devs to fix it a while ago. Ive been searching for a while and i dont think theres a decent fix till they put and option in the import. Separating meshes works to fix it but its messy and complicated.
     
  9. Prompt

    Prompt

    Joined:
    Mar 19, 2013
    Posts:
    1
    Hi guys,

    I have the same problem with Max 2013. Maya 2012 export vertex color per face well.

    I have no idea how to have flat vertex colors per face.
     
  10. franmts

    franmts

    Joined:
    Oct 14, 2013
    Posts:
    10
    Have you tried changing your model's import settings to:
    Normal -> Import
    Tangents -> Calculate
    Smoothing Angle -> 60
    Split Tangents -> Check

    ?

    It's a bit trick to set up the smoothing angle to that, have to change Normals to Calculate, set Smoothing to 60, then change Normals to Import and Tangents to Calculate.. but could solve your problem !

    Let us know !
     
  11. yamagema

    yamagema

    Joined:
    Jul 22, 2015
    Posts:
    1
    I know the thread is quite old but as it may be useful to anybody encountering that prob :
    Just use an exporter that respect multi color info by vertex!...
    Such as OpenCollada (DAE format).

    No specific manipulation or transformation to do to your object before exporting. Pretty cool.
    Sadly for me, neither FBX nor OpenCollada can export per vertex multi alpha value... If somebody got a tip to help me on this alpha stuff...

    Thanks!