This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using UnityEngine; | |
| [ExecuteInEditMode] // makes the Screen Effect editable within the Editor without entering Play mode. | |
| public class Ch8GrayscaleImageEffect : MonoBehaviour | |
| { | |
| #region Variables | |
| public Shader curShader; | |
| [Range(0.0f, 1.0f)] // makes this variable show up as a slider in the Inspector. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "CookbookShaders/Ch06/Water" | |
| { | |
| Properties | |
| { | |
| _NoiseTexture ("Noise Texture", 2D) = "white" {} | |
| _Color ("Color", Color) = (1, 1, 1, 1) | |
| _Period ("Period", Range(0, 50)) = 50 | |
| _Magnitude ("Magnitude", Range(0, 0.5)) = 0.05 | |
| _Scale ("Scale", Range(0, 10)) = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "CookbookShaders/Ch06/StainedGlass" | |
| { | |
| Properties | |
| { | |
| _MainTex ("Base (RGBA)", 2D) = "white" {} | |
| _BumpMap ("Noise Texture", 2D) = "bump" {} | |
| _Magnitude("Magnitude", Range(0,1)) = 0.05 | |
| } | |
| SubShader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "CookbookShaders/GrabPass" | |
| { | |
| SubShader | |
| { | |
| Tags | |
| { | |
| "Queue" = "Transparent" | |
| "IgnoreProjector" = "True" | |
| "RenderType" = "Opaque" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct vertInput | |
| { | |
| float4 pos : POSITION; | |
| float2 texcoord : TEXCOORD0; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "CookbookShaders/Multiply" | |
| { | |
| Properties | |
| { | |
| _Color ("Color", Color) = (1, 0, 0, 1) | |
| _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} | |
| } | |
| SubShader | |
| { | |
| Pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "CookbookShaders/Chapter05/SnowShader" | |
| { | |
| Properties | |
| { | |
| _MainColor("Main Color", Color) = (1.0,1.0,1.0,1.0) | |
| _MainTex("Base (RGB)", 2D) = "white" {} | |
| _Bump("Bump", 2D) = "bump" {} | |
| _SnowLevel("Level of snow", Range(1, -1)) = 1 | |
| _SnowColor("Color of snow", Color) = (1.0,1.0,1.0,1.0) | |
| _SnowDirection("Direction of snow", Vector) = (0,1,0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "CookbookShaders/SnowRabbit" | |
| { | |
| Properties | |
| { | |
| _MainColor ("Main Color", Color) = (1.0, 1.0, 1.0, 1.0) | |
| _MainTex ("Base (RGB)", 2D) = "white" {} | |
| _Bump ("Bump", 2D) = "bump" {} | |
| _SnowLevel ("Level of Snow", Range(-1.0, 1.0)) = 0.25 | |
| _SnowColor ("Color of Snow", Color) = (1.0, 1.0, 1.0, 1.0) | |
| _SnowDirection ("Direction of Snow", Vector) = (0, 1, 0, 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "CookbookShaders/NormalExtrusionMap" | |
| { | |
| Properties | |
| { | |
| _MainTex ("Base (RGB)", 2D) = "white" {} | |
| _ExtrusionTex("Extrusion map", 2D) = "white" {} | |
| _Amount ("Extrusion Amount", Range(-2,2)) = 0 | |
| _Frequency ("Frequency", Range(0,10)) = 0 | |
| } | |
| SubShader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "CookbookShaders/NormalExtrusion" | |
| { | |
| Properties | |
| { | |
| _MainTex ("Base (RGB)", 2D) = "white" {} | |
| _Amount ("Extrusion Amount", Range(-2,2)) = 0 | |
| } | |
| SubShader | |
| { | |
| Tags { "RenderType"="Opaque" } |