Tuesday, March 3, 2015

Unity Tips: Combined Mesh into Highlight (part 2)

This is Part 2 of making a single-mesh highlight for a several-mesh object. In the Previous Post we discussed how to combine the meshes into a single mesh. Now all we have to do is use that new mesh as a highlight.

____________________________________________________________


____________________________________________________________

Shaders
Because Shaders are connected to Materials that effect 1 mesh at a time, we had to combine all those meshes into one outline-able mesh. Now we just need the outline.

Though shaders are a fairly deep hole to jump into, the Unity Community is there for us with a few commonly desired shaders. I found several useful resources Here. Select Silhouette-Outlined Diffuse and copy the variant that's right for you. There's Standard, Bumped, and Outline Only. I like Outline Only but you may have other needs.


____________________________________________________________

New Shader
Copy the Shader script. In Unity, make yourself a new Shader, open, and paste shader script.


____________________________________________________________


Now The Outline
This part's super simple


  • Make yourself a new Material.
  • Assign the new Outline Shader
  • Adjust color to preference. I like bright greens and blues.


____________________________________________________________

The Outline-Object
Finally, we combine these two techniques into a complex outline.


  • Take your original multi-mesh object, with it's "empty" parent-object
  • From there make an empty game-object child with scaled about 1 to 1.
  • Assign the Mesh you made earlier
  • Assign your new Outline Material
  • Adjust to preference


____________________________________________________________

Tadaa!
With these steps we've completed the Multi-Mesh Object Outline path. I hope you enjoy your outlines derived from this method. 


____________________________________________________________


All blog posts by UnityGirl are inspired by my work with Brunelleschi: Age of Architects on the Aesop Games team. Download the current Unity client On IndieDB

No comments:

Post a Comment