Announcement

Collapse
No announcement yet.

Vertex Colors Not Affecting Lightmass

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Vertex Colors Not Affecting Lightmass

    It seems like vertex color data on meshes aren't taken into account when lightmass calculates its lighting.

    Simple mat that uses the red vertex channel and a mask to blend between two colors. (Extreme green and pink for easy viewing )
    Click image for larger version

Name:	mat.jpg
Views:	1
Size:	197.1 KB
ID:	1137962

    Result after vertex painting and baking -
    Click image for larger version

Name:	pink.jpg
Views:	1
Size:	139.2 KB
ID:	1137963

    As you can see, after vertex painting green is the dominant color on the mesh yet it still bounces around just the pink color.

    After switching around the green and pink constants in the lerp node -
    Click image for larger version

Name:	green.jpg
Views:	1
Size:	132.6 KB
ID:	1137961

    The opposite occurs, making it seem like lightmass only takes into account of the color / texture that is connected into the b input of the lerp node and ignores all vertex painting.

    #2
    Lightmass bakes out materials in the 0-1 UV space a single time to keep build times low, instead of for every triangle they are applied to. This means that any per-instance properties like vertex color, world position, camera vector etc are not going to be correct and use defaults. You can use a LightmassReplace node to have it use something different for lighting than what you see rendered.

    Comment


      #3
      Ah that makes sense. I know there are only very specific situations where a feature like this would be needed (materials being blended that have high contrast ex. gradual buildup of snow on dark asphalt) but any chance of adding some sort of option, either for meshes or materials, that tells lightmass to calculate materials for each triangle instead of just using the uv space? This way you can make sure it's only doing the extra baking calculations for the mesh instances / materials that absolutely require it.

      I know you guys have a ton on your table already so maybe just stuff this somewhere in the "Maybe One Day" folder
      Last edited by Calypso; 09-05-2014, 03:59 PM.

      Comment


        #4
        Old post, but first on Google: I have a change ready that enables VertexColor GI. It will be exposed with 4 checkboxes in the Material, one of them enables scaling the diffuse color by VertexColor.RGB. So passing in LightmassReplace = (1,1,1,X) would give you pure vertex color GI. There are checkboxes to tint and scale the emissive as well (static emissive vertex color lighting). I'll update this post when I have the Pull Request ready, I might need community support to push this faster since it's a slightly bigger change.

        Example with Diffuse Boost = 10:
        Click image for larger version  Name:	VertexColorGI.png Views:	0 Size:	432.7 KB ID:	1716197

        Last edited by kosheryosher; 02-02-2020, 10:28 AM.

        Comment

        Working...
        X