Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Based on Particles/VertexLit Blended
- Shader "Custom/VertexLit Blended w Add and Mult" {
- Properties {
- // _EmisColor ("Emissive Color", Color) = (.2,.2,.2,0)
- _Opacity ("Object Opacity", Range(0.0, 1.0) ) = 1.0
- _MainTex ("Main Diffuse", 2D) = "white" {}
- _AddTex ("Hilight Texture", 2D) = "white" {}
- _MultTex ("Shadow Texture", 2D) = "white" {}
- _TintColor ( "Main Tint Color", Color) = (.5, .5, .5, 0)
- _ATintColor ( "Hilight Tint Color", Color) = (0,0,0,0)
- _MTintColor ( "Shadow Color", Color) = (1, 1, 1, 1)
- }
- SubShader {
- // Preps and Setup
- Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
- Tags { "LightMode" = "Vertex" }
- Cull Off
- Lighting On
- Material { } //Emission [_EmisColor] }
- ColorMaterial AmbientAndDiffuse
- ZWrite Off
- ColorMask RGB
- Blend SrcAlpha OneMinusSrcAlpha
- AlphaTest Greater .001
- Pass {
- // Set Tint Color and apply main texture's alpha to it.
- SetTexture [_MainTex]{
- constantColor [_TintColor]
- combine constant lerp (constant) texture
- }
- // Apply main texture with the Opacity setting included
- SetTexture [_MainTex]{
- constantColor(0,0,0,[_Opacity])
- combine previous, texture * constant
- }
- // Apply lighting
- SetTexture [_MainTex]{
- combine primary * previous
- }
- }
- Blend SrcAlpha One
- Pass {
- // Apply the Highlights, using the opacity in AddTex.
- SetTexture [_AddTex]{
- ConstantColor [_ATintColor]
- combine constant, texture * constant
- }
- }
- //Blend SrcAlpha OneMinusSrcAlpha
- Blend Zero SrcColor
- Pass {
- // Apply the Shadows color, using opacity in MultTex
- SetTexture [_MultTex] {
- ConstantColor [_MTintColor]
- combine constant, texture * constant
- }
- }
- }
- }
Advertisement
RAW Paste Data
Copied
Advertisement