Skip to content

Instantly share code, notes, and snippets.

View smokelore's full-sized avatar

Sebastian Monroy smokelore

View GitHub Profile
Shader "CookbookShaders/SnakeyPlane"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_TintAmount ("Tint Amount", Range(0,1)) = 0.5
_ColorA ("Color A", Color) = (1,1,1,1)
_ColorB ("Color B", Color) = (1,1,1,1)
_Speed ("Wave Speed", Range(0.1, 80)) = 5
_Frequency ("Wave Frequency", Range(0, 5)) = 2
Shader "CookbookShaders/AnisotropicSpecular"
{
Properties
{
_MainTint ("Diffuse Tint", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_SpecularColor ("Specular Color", Color) = (1,1,1,1)
_Specular ("Specular Amount", Range(0,1)) = 0.5
_SpecPower ("Specular Power", Range(0,1)) = 0.5 // p
_AnisoDir ("Anisotropic Direction", 2D) = "" {}
Shader "CookbookShaders/BlinnPhongSpecular"
{
Properties
{
_MainTint ("Diffuse Tint", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_SpecularColor ("Specular Color", Color) = (1,1,1,1)
_SpecPower ("Specular Power", Range(0.1,60)) = 3 // p
}
SubShader
using UnityEngine;
[ExecuteInEditMode]
public class ShowPhongReflection : MonoBehaviour
{
public float length = 1;
public Vector3 bias;
public Transform lightSource; // must be directional light
// Update is called once per frame
Shader "CookbookShaders/PhongSpecular"
{
Properties
{
_MainTint ("Diffuse Tint", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_SpecularColor ("Specular Color", Color) = (1,1,1,1)
_SpecPower ("Specular Power", Range(0.2,30)) = 1 // p
}
SubShader
Shader "CookbookShaders/ToonLighting"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_RampTex ("Ramp", 2D) = "white" {}
_CelShadingLevels ("Cel Shading Levels", Range(0,15)) = 5
}
SubShader
{
Shader "CookbookShaders/SimpleLambert"
{
Properties
{
_MainTex ("Albedo (RGB)", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 200
Shader "CookbookShaders/Radius"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {} // the terrain's texture
_Center ("Center", Vector) = (0,0,0,0)
_Radius ("Radius", Float) = 1
_RadiusColor ("Radius Color", Color) = (1, 1, 1, 1)
Shader "CookbookShaders/PackedTexture"
{
Properties
{
_MainTint ("Diffuse Tint", Color) = (1,1,1,1)
_ColorA ("Terrain Color A", Color) = (1,1,1,1)
_ColorB ("Terrain Color B", Color) = (1,1,1,1)
_RTexture ("Red Channel Texture", 2D) = ""{}
_GTexture ("Green Channel Texture", 2D) = ""{}
_BTexture ("Blue Channel Texture", 2D) = ""{}
Shader "CookbookShaders/Transparent"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
}
SubShader {
// Transparent (ordering)
Tags