TexturedFont

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
Line 10: Line 10:
  
 
==ShaderLab - TexturedFont.shader==
 
==ShaderLab - TexturedFont.shader==
 +
<shaderlab>
 
  Shader "GUI/Textured Text Shader"
 
  Shader "GUI/Textured Text Shader"
 
  {
 
  {
Line 31: Line 32:
 
  }
 
  }
 
  }
 
  }
 +
</shaderlab>

Revision as of 14:20, 2 December 2005

Author: Jonathan Czeck (aarku)

Description

This shader will allow you to have multicolored font in place of a solid-colored one that shaders in the current version of Unity supports.

Usage

Place this shader somewhere in your Assets folder hierarchy. Then, use it on a font's material in place of the Text Font shader.

ShaderLab - TexturedFont.shader

<shaderlab>

Shader "GUI/Textured Text Shader"
{
	Properties {
		_MainTex ("Font Texture", 2D) = "white" {}
	}
	
	SubShader {
		Lighting Off
		cull off
		ztest always
		Zwrite off
		Fog { Mode Off }
		Tags {"Queue" = "Transparent" }
		Pass {
			Blend SrcAlpha OneMinusSrcAlpha
			SetTexture [_MainTex] {
				Combine texture, texture
			}
		}
	}
}

</shaderlab>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox