Skip to content

Instantly share code, notes, and snippets.

View smokelore's full-sized avatar

Sebastian Monroy smokelore

View GitHub Profile
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.
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
Shader "CookbookShaders/Ch06/StainedGlass"
{
Properties
{
_MainTex ("Base (RGBA)", 2D) = "white" {}
_BumpMap ("Noise Texture", 2D) = "bump" {}
_Magnitude("Magnitude", Range(0,1)) = 0.05
}
SubShader
Shader "CookbookShaders/GrabPass"
{
SubShader
{
Tags
{
"Queue" = "Transparent"
"IgnoreProjector" = "True"
"RenderType" = "Opaque"
}
struct vertInput
{
float4 pos : POSITION;
float2 texcoord : TEXCOORD0;
};
Shader "CookbookShaders/Multiply"
{
Properties
{
_Color ("Color", Color) = (1, 0, 0, 1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader
{
Pass
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)
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)
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
Shader "CookbookShaders/NormalExtrusion"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_Amount ("Extrusion Amount", Range(-2,2)) = 0
}
SubShader
{
Tags { "RenderType"="Opaque" }