This file contains 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/StandardDiffuse3" { | |
Properties { | |
_Color ("Color", Color) = (1, 1, 1, 1) | |
_AmbientColor ("Ambient Color", Color) = (1, 1, 1, 1) | |
_MySliderValue ("This is a Slider", Range(0, 10)) = 2.5 | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
LOD 200 |
This file contains 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/Diffuse" { | |
Properties { | |
_Color ("Color", Color) = (1, 1, 1, 1) | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
LOD 200 | |
CGPROGRAM | |
#pragma surface surf Standard fullforwardshadows |
This file contains 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/TexturedShader" | |
{ | |
Properties | |
{ | |
... | |
// In the properties section we can refer to a texture like this: | |
_MainTex ("Albedo (RGB)", 2D) = "white" {}] | |
... | |
} | |
This file contains 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/ScrollingShader" | |
{ | |
Properties | |
{ | |
_MainTint ("Diffuse Tint", Color) = (1,1,1,1) | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_ScrollXSpeed ("X Scroll Speed", Range(0,10)) = 2 | |
_ScrollYSpeed ("Y Scroll Speed", Range(0,10)) = 2 | |
} | |
This file contains 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
... | |
SubShader | |
{ | |
Tags { "RenderType"="Opaque" } | |
LOD 200 | |
CGPROGRAM | |
#pragma surface surf Standard fullforwardshadows | |
#pragma target 3.0 |
This file contains 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
... | |
void surf (Input IN, inout SurfaceOutputStandard o) | |
{ | |
// Create a separate variable to store our UVs | |
// before we pass them to the tex2D() function | |
fixed2 scrolledUV = IN.uv_MainTex; | |
// Create variables that store the individual | |
// x and y components for the UVs scaled by time |
This file contains 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/ScrollingShader" | |
{ | |
Properties | |
{ | |
_MainTint ("Diffuse Tint", Color) = (1,1,1,1) | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_ScrollXSpeed ("X Scroll Speed", Range(0,10)) = 2 | |
_ScrollYSpeed ("Y Scroll Speed", Range(0,10)) = 2 | |
} | |
SubShader |
This file contains 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/NormalDiffuse" { | |
Properties | |
{ | |
_MainTint ("Diffuse Tint", Color) = (1,1,1,1) | |
// the "bump" keyword tells Unity that the texture will contain a normal map | |
_NormalTex ("Normal Map", 2D) = "bump" {} | |
_NormalIntensity ("Normal Intensity", Range(0,1)) = 1 | |
} | |
SubShader | |
{ |
This file contains 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/HolographicShader" { | |
Properties { | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_DotProduct ("Rim Effect", Range(-1, 1)) = 0.25 | |
} | |
SubShader { | |
Tags | |
{ | |
"Queue" = "Transparent" |
This file contains 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/Transparent" | |
{ | |
Properties | |
{ | |
_Color("Color", Color) = (1,1,1,1) | |
_MainTex("Albedo (RGB)", 2D) = "white" {} | |
} | |
SubShader { | |
// Transparent (ordering) | |
Tags |
OlderNewer