Transparent Alpha Vertex Lit With Z

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(Created new shader page)
m (Shader Files)
Line 16: Line 16:
==Shader Files==
==Shader Files==
<syntaxhighlight lang="shaderlab">
<syntaxhighlight lang="c">
Shader "Transparent/Specular VertexLit with Z" {
Shader "Transparent/Specular VertexLit with Z" {
Properties {
Properties {

Latest revision as of 20:19, 11 December 2012


[edit] Description

Modified Transparent/VertexLit with Z shader to include specular highlighting.

[edit] Usage

Combines Z-sorted transparency and specular highlighting. _SpecColor indicates the color of the specular highlight. _Shininess indicates the level of highlighting (how sharp it is).

[edit] More

[edit] Shader Files

Shader "Transparent/Specular VertexLit with Z" {
	Properties {
	    _Color ("Main Color", Color) = (1,1,1,1)
	    _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
	     _Shininess ("Shininess", Range (0.01, 1)) = 0.078125
	    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
	SubShader {
	    Tags {"RenderType"="Transparent" "Queue"="Transparent"}
	    // Render into depth buffer only
	    Pass {
	        ColorMask 0
	    // Render normally
	    Pass {
	        ZWrite Off
	        Blend SrcAlpha OneMinusSrcAlpha
	        ColorMask RGB
	        Material {
	            Diffuse [_Color]
	            Ambient [_Color]
            	Shininess [_Shininess]
	            Specular [_SpecColor]
	        Lighting On
			SeparateSpecular On
	        SetTexture [_MainTex] {
	            Combine texture * primary DOUBLE, texture * primary
Personal tools