TexturedFont

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
 
(Shader - TexturedFont.shader)
Line 6: Line 6:
 
Place this shader somewhere in your Assets folder hierarchy.  Then, use it on a font's material in place of the Text Font shader.
 
Place this shader somewhere in your Assets folder hierarchy.  Then, use it on a font's material in place of the Text Font shader.
  
==Shader - TexturedFont.shader==
+
==ShaderLab - TexturedFont.shader==
 
  Shader "GUI/Textured Text Shader"
 
  Shader "GUI/Textured Text Shader"
 
  {
 
  {

Revision as of 18:30, 1 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 support.

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

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
			}
		}
	}
}
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox