Like most artists, Theresa Latzko wants to spend as much time as possible on creating her assets. But texture painting takes time, with UV mapping and normals having to be considered, as well as performance optimization. Was there a way for her to work around some of the work, and directly translate her designs into the final look on the screen? Indeed, there was.

Key things you'll learn about:

1Assigning colors directly to her meshes

  • Instead of painting textures, she assigned colors to the meshes directly, coloring them on a per-vertex basis. It’s a technique that’s possible with Maya and other modeling software, as well as a number of Asset Store tools.
  • To color the meshes in Maya, she turned off the light, and then applied layers of color and detail, until she ended up with the look that she wanted. This resulted in the exact desired colors for her models.

Applying vertex colors directly in Maya.

Unlit preview with a single base color applied.

Final coloring, still unlit. Functions like a flat texture, but with colors directly attached to vertices.

2Lighting her models in Unity based purely on distance

  • To maintain the painterly look of her models, she realized that she needed to light them based purely on distance. She figured out that she could do this if she removed the part of the shader in Unity’s lighting calculation that deals with normal directions, and focus on the attenuation; luckily, these variables are already exposed to users.

The heart of the new shader logic: a modified version of the Shade4PointLights() function that ignores normals. This function is normally found in the UnityCG cginclude file, and is used to apply point lights in shaders.

Overall, her method of vertex coloring resulted in:

  • No need for UV mapping and keeping track of textures.
  • Coloring and modeling happened more simultaneously, and more closely emulated a 2D design process.
  • She knew exactly what the asset would look like once it’s in the game.
  • Multiple assets could be created and viewed together immediately, as well as adjusted for design coherency in the same program and scene.

The flat point lighting model in action.

If you think this is a method that can work for you, watch Theresa’s full talk here to learn more.


 

More resources

If you’d like to learn more about writing shaders, try these resources: