About Me

Hi. I'm Josh Ols. Lead Graphics Developer for RUST LTD.

Contact:
crunchy.bytes.blog[at]gmail[dot]com

View Joshua Ols's profile on LinkedIn

Meta
« Unity Shader Gotchas #3 - CustomSurfaceOutput | Main | Unity Shader Gotchas #1 - _MainTex, _MainColor »
Saturday
May182013

Unity Shader Gotchas #2 - Naming Conventions

UPDATE 2

This article is now obselete, as Unity 5 switched to a system where they use a specialized "Meta" pass that allows Enlighten to pick up all diffuse and emissive color from an object regardless of how they were calculated.

 

UPDATE

Unity now posts the conventions for the shader names and parameters to integrate with Beast. Please see the "Material Properties" section of "Lightmapping in Depth":

http://docs.unity3d.com/410/Documentation/Manual/LightmappingInDepth.html

 

ORIGINAL

Background
So as it turns out, Unity cares about how you name your shaders. Specifically, the category you put them in affects whether or not certain features are enabled for that shader. The root category name can be whatever you want, so long as the sub-categories match Unity's conventions.

This also applies to whatever you choose for your fallback shader. It must support the same feature, or unity will disable the feature in the parent shader.

Most common cases:
Tessellated Shadows - "<project>/Tessellation/<shader name>"

Static & Dynamic cutout shadows - "<project>/Transparent/Cutout/<shader name>"

Emissive material for light baking - "<project>/Self-Illumin/<shader name>"

The Problem
As near as I can tell, these are all mutually exlusive and only allow one per shader. So you couldn't have a light emitting material with tessellated cutout shadows.

The Solution
There isn't really a solution to this as far as I can see. All you can do is pick the one that is most important for the shader.

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (4)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    Response: seo australia
    go here for top quality it companies in sydney available
  • Response
    Response: que significa seo
    The greatest posicionar web en google anywhere
  • Response
    go here for best como posicionarse en google anywhere
  • Response
    click here for greatest big vision seo around

Reader Comments (2)

Hmm. I have a tessellated self-illuminated shader... I have it named "Self-Illumin/Tesselation" (note the typo, so the second name doesn't matter, though you are right about it needing to be in self-illumin for it to take the emission property into account). It works displacement heightmaps and both emissive color and lightmap emission.
May 23, 2013 | Unregistered CommenterKelly MacNeill
Ah, I suppose you mean only tessellated shadows are enabled by having it in the tessellation folder, I haven't checked this, so you may be right.
May 23, 2013 | Unregistered CommenterKelly MacNeill

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.