Add Unity3D projects
This commit is contained in:
@ -0,0 +1,41 @@
|
||||
//Courtesy of http://answers.unity3d.com/questions/306921/add-specular-map-to-shader.html
|
||||
Shader "RoadArchitect/Roads/Road Shader" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
|
||||
_Shininess ("Shininess", Range (0.03, 1)) = 0.078125
|
||||
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
|
||||
_BumpMap ("Normalmap", 2D) = "bump" {}
|
||||
}
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
// Tags { "Queue" = "Geometry+10" }
|
||||
LOD 400
|
||||
|
||||
Offset -1,-1
|
||||
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf BlinnPhong
|
||||
sampler2D _MainTex;
|
||||
sampler2D _BumpMap;
|
||||
fixed4 _Color;
|
||||
half _Shininess;
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
float2 uv_BumpMap;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
|
||||
o.Albedo = tex.rgb * _Color.rgb;
|
||||
o.Gloss = tex.a;
|
||||
o.Alpha = tex.a * _Color.a;
|
||||
o.Specular = _Shininess;
|
||||
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1cfdded18727a72449383d6fade4d43a
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
@ -0,0 +1,38 @@
|
||||
//Courtesy of http://answers.unity3d.com/questions/306921/add-specular-map-to-shader.html
|
||||
Shader "RoadArchitect/DX11/Road Shader" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
|
||||
_Shininess ("Shininess", Range (0.03, 1)) = 0.078125
|
||||
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
|
||||
_BumpMap ("Normalmap", 2D) = "bump" {}
|
||||
}
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
// Tags { "Queue" = "Geometry+10" }
|
||||
LOD 400
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf BlinnPhong
|
||||
sampler2D _MainTex;
|
||||
sampler2D _BumpMap;
|
||||
fixed4 _Color;
|
||||
half _Shininess;
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
float2 uv_BumpMap;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
|
||||
o.Albedo = tex.rgb * _Color.rgb;
|
||||
o.Gloss = tex.a;
|
||||
o.Alpha = tex.a * _Color.a;
|
||||
o.Specular = _Shininess;
|
||||
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c2f77b8b33b7d164d9f9572c07f6c2c7
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
@ -0,0 +1,41 @@
|
||||
//Courtesy of http://answers.unity3d.com/questions/306921/add-specular-map-to-shader.html
|
||||
Shader "RoadArchitect/Roads/Road Shader Low Quality" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
|
||||
}
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
Tags { "Queue" = "Geometry+10" }
|
||||
LOD 200
|
||||
|
||||
Offset 1,1
|
||||
|
||||
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf BlinnPhong
|
||||
|
||||
#ifndef SHADER_API_D3D11
|
||||
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
sampler2D _MainTex;
|
||||
fixed4 _Color;
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
|
||||
o.Albedo = tex.rgb * _Color.rgb;
|
||||
o.Gloss = tex.a;
|
||||
o.Alpha = tex.a * _Color.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
FallBack "VertexLit"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66ec00f19ef7f00468d5e72c6c7123a7
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
@ -0,0 +1,31 @@
|
||||
//Courtesy of http://answers.unity3d.com/questions/306921/add-specular-map-to-shader.html
|
||||
Shader "RoadArchitect/DX11/Road Shader Low Quality" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
|
||||
}
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
Tags { "Queue" = "Geometry+10" }
|
||||
LOD 200
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf BlinnPhong
|
||||
|
||||
sampler2D _MainTex;
|
||||
fixed4 _Color;
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
|
||||
o.Albedo = tex.rgb * _Color.rgb;
|
||||
o.Gloss = tex.a;
|
||||
o.Alpha = tex.a * _Color.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
FallBack "VertexLit"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d389ea73ff30810489fb7ac428eef6ad
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
@ -0,0 +1,38 @@
|
||||
//Courtesy of http://answers.unity3d.com/questions/306921/add-specular-map-to-shader.html
|
||||
Shader "RoadArchitect/Roads/Road Shoulder Shader" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
//_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
|
||||
//_Shininess ("Shininess", Range (0, 1)) = 0.078125
|
||||
_MainTex ("Base (RGB) N/A (A)", 2D) = "white" {}
|
||||
//_BumpMap ("Normalmap", 2D) = "bump" {}
|
||||
}
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
//Tags { "Queue" = "Geometry+10" }
|
||||
LOD 400
|
||||
Offset -1,-1
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf BlinnPhong
|
||||
sampler2D _MainTex;
|
||||
//sampler2D _BumpMap;
|
||||
fixed4 _Color;
|
||||
//half _Shininess;
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
//float2 uv_BumpMap;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
|
||||
o.Albedo = tex.rgb * _Color.rgb;
|
||||
//o.Gloss = tex.a;
|
||||
o.Alpha = tex.a * _Color.a;
|
||||
//o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 818846912fa069f42b9ef5d8eb0919f5
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
@ -0,0 +1,37 @@
|
||||
//Courtesy of http://answers.unity3d.com/questions/306921/add-specular-map-to-shader.html
|
||||
Shader "RoadArchitect/DX11/Road Shoulder Shader" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
//_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
|
||||
//_Shininess ("Shininess", Range (0, 1)) = 0.078125
|
||||
_MainTex ("Base (RGB) N/A (A)", 2D) = "white" {}
|
||||
//_BumpMap ("Normalmap", 2D) = "bump" {}
|
||||
}
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
//Tags { "Queue" = "Geometry+10" }
|
||||
LOD 400
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf BlinnPhong
|
||||
sampler2D _MainTex;
|
||||
//sampler2D _BumpMap;
|
||||
fixed4 _Color;
|
||||
//half _Shininess;
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
//float2 uv_BumpMap;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
|
||||
o.Albedo = tex.rgb * _Color.rgb;
|
||||
//o.Gloss = tex.a;
|
||||
o.Alpha = tex.a * _Color.a;
|
||||
//o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0fb4bbad9fbeb24b87d406b149adfd5
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
@ -0,0 +1,335 @@
|
||||
Shader "RoadArchitect/CutoutMarker"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color("Color", Color) = (1,1,1,1)
|
||||
_MainTex("Albedo", 2D) = "white" {}
|
||||
|
||||
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
|
||||
|
||||
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
|
||||
_GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
|
||||
[Enum(Metallic Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel ("Smoothness texture channel", Float) = 0
|
||||
|
||||
[Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
|
||||
_MetallicGlossMap("Metallic", 2D) = "white" {}
|
||||
|
||||
[ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
|
||||
[ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0
|
||||
|
||||
_BumpScale("Scale", Float) = 1.0
|
||||
_BumpMap("Normal Map", 2D) = "bump" {}
|
||||
|
||||
_Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02
|
||||
_ParallaxMap ("Height Map", 2D) = "black" {}
|
||||
|
||||
_OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
|
||||
_OcclusionMap("Occlusion", 2D) = "white" {}
|
||||
|
||||
_EmissionColor("Color", Color) = (0,0,0)
|
||||
_EmissionMap("Emission", 2D) = "white" {}
|
||||
|
||||
_DetailMask("Detail Mask", 2D) = "white" {}
|
||||
|
||||
_DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {}
|
||||
_DetailNormalMapScale("Scale", Float) = 1.0
|
||||
_DetailNormalMap("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0
|
||||
|
||||
|
||||
// Blending state
|
||||
[HideInInspector] _Mode ("__mode", Float) = 0.0
|
||||
[HideInInspector] _SrcBlend ("__src", Float) = 1.0
|
||||
[HideInInspector] _DstBlend ("__dst", Float) = 0.0
|
||||
[HideInInspector] _ZWrite ("__zw", Float) = 1.0
|
||||
}
|
||||
|
||||
CGINCLUDE
|
||||
#define UNITY_SETUP_BRDF_INPUT MetallicSetup
|
||||
ENDCG
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Cutout" "PerformanceChecks"="False" }
|
||||
LOD 300
|
||||
Offset -3,-2
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Base forward pass (directional light, emission, lightmaps, ...)
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
|
||||
Blend [_SrcBlend] [_DstBlend]
|
||||
ZWrite [_ZWrite]
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
|
||||
#pragma shader_feature _PARALLAXMAP
|
||||
|
||||
#pragma multi_compile_fwdbase
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma vertex vertBase
|
||||
#pragma fragment fragBase
|
||||
#include "UnityStandardCoreForward.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Additive forward pass (one light per pass)
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD_DELTA"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend [_SrcBlend] One
|
||||
Fog { Color (0,0,0,0) } // in additive pass fog should be black
|
||||
ZWrite Off
|
||||
ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
#pragma shader_feature _PARALLAXMAP
|
||||
|
||||
#pragma multi_compile_fwdadd_fullshadows
|
||||
#pragma multi_compile_fog
|
||||
|
||||
|
||||
#pragma vertex vertAdd
|
||||
#pragma fragment fragAdd
|
||||
#include "UnityStandardCoreForward.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Shadow rendering pass
|
||||
Pass {
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
ZWrite On ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _PARALLAXMAP
|
||||
#pragma multi_compile_shadowcaster
|
||||
|
||||
#pragma vertex vertShadowCaster
|
||||
#pragma fragment fragShadowCaster
|
||||
|
||||
#include "UnityStandardShadow.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Deferred pass
|
||||
Pass
|
||||
{
|
||||
Name "DEFERRED"
|
||||
Tags { "LightMode" = "Deferred" }
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma exclude_renderers nomrt
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
#pragma shader_feature _PARALLAXMAP
|
||||
|
||||
#pragma multi_compile ___ UNITY_HDR_ON
|
||||
#pragma multi_compile ___ LIGHTMAP_ON
|
||||
#pragma multi_compile ___ DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
|
||||
#pragma multi_compile ___ DYNAMICLIGHTMAP_ON
|
||||
|
||||
#pragma vertex vertDeferred
|
||||
#pragma fragment fragDeferred
|
||||
|
||||
#include "UnityStandardCore.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Extracts information for lightmapping, GI (emission, albedo, ...)
|
||||
// This pass it not used during regular rendering.
|
||||
Pass
|
||||
{
|
||||
Name "META"
|
||||
Tags { "LightMode"="Meta" }
|
||||
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_meta
|
||||
#pragma fragment frag_meta
|
||||
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
|
||||
#include "UnityStandardMeta.cginc"
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
|
||||
LOD 150
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Base forward pass (directional light, emission, lightmaps, ...)
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
|
||||
Blend [_SrcBlend] [_DstBlend]
|
||||
ZWrite [_ZWrite]
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
|
||||
// SM2.0: NOT SUPPORTED shader_feature ___ _DETAIL_MULX2
|
||||
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
|
||||
|
||||
#pragma skip_variants SHADOWS_SOFT DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
|
||||
|
||||
#pragma multi_compile_fwdbase
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma vertex vertBase
|
||||
#pragma fragment fragBase
|
||||
#include "UnityStandardCoreForward.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Additive forward pass (one light per pass)
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD_DELTA"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend [_SrcBlend] One
|
||||
Fog { Color (0,0,0,0) } // in additive pass fog should be black
|
||||
ZWrite Off
|
||||
ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
|
||||
#pragma skip_variants SHADOWS_SOFT
|
||||
|
||||
#pragma multi_compile_fwdadd_fullshadows
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma vertex vertAdd
|
||||
#pragma fragment fragAdd
|
||||
#include "UnityStandardCoreForward.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Shadow rendering pass
|
||||
Pass {
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
ZWrite On ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma skip_variants SHADOWS_SOFT
|
||||
#pragma multi_compile_shadowcaster
|
||||
|
||||
#pragma vertex vertShadowCaster
|
||||
#pragma fragment fragShadowCaster
|
||||
|
||||
#include "UnityStandardShadow.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Extracts information for lightmapping, GI (emission, albedo, ...)
|
||||
// This pass it not used during regular rendering.
|
||||
Pass
|
||||
{
|
||||
Name "META"
|
||||
Tags { "LightMode"="Meta" }
|
||||
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_meta
|
||||
#pragma fragment frag_meta
|
||||
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
|
||||
#include "UnityStandardMeta.cginc"
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FallBack "VertexLit"
|
||||
CustomEditor "StandardShaderGUI"
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22f5063cb05522b4b974284bab971f69
|
||||
timeCreated: 1488193406
|
||||
licenseType: Free
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,335 @@
|
||||
Shader "RoadArchitect/Standard-Tiling"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color("Color", Color) = (1,1,1,1)
|
||||
_MainTex("Albedo", 2D) = "white" {}
|
||||
|
||||
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
|
||||
|
||||
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
|
||||
_GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
|
||||
[Enum(Metallic Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel ("Smoothness texture channel", Float) = 0
|
||||
|
||||
[Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
|
||||
_MetallicGlossMap("Metallic", 2D) = "white" {}
|
||||
|
||||
[ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
|
||||
[ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0
|
||||
|
||||
_BumpScale("Scale", Float) = 1.0
|
||||
_BumpMap("Normal Map", 2D) = "bump" {}
|
||||
|
||||
_Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02
|
||||
_ParallaxMap ("Height Map", 2D) = "black" {}
|
||||
|
||||
_OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
|
||||
_OcclusionMap("Occlusion", 2D) = "white" {}
|
||||
|
||||
_EmissionColor("Color", Color) = (0,0,0)
|
||||
_EmissionMap("Emission", 2D) = "white" {}
|
||||
|
||||
_DetailMask("Detail Mask", 2D) = "white" {}
|
||||
|
||||
_DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {}
|
||||
_DetailNormalMapScale("Scale", Float) = 1.0
|
||||
_DetailNormalMap("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0
|
||||
|
||||
|
||||
// Blending state
|
||||
[HideInInspector] _Mode ("__mode", Float) = 0.0
|
||||
[HideInInspector] _SrcBlend ("__src", Float) = 1.0
|
||||
[HideInInspector] _DstBlend ("__dst", Float) = 0.0
|
||||
[HideInInspector] _ZWrite ("__zw", Float) = 1.0
|
||||
}
|
||||
|
||||
CGINCLUDE
|
||||
#define UNITY_SETUP_BRDF_INPUT MetallicSetup
|
||||
ENDCG
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Cutout" "PerformanceChecks"="False" }
|
||||
LOD 300
|
||||
Offset -3,-2
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Base forward pass (directional light, emission, lightmaps, ...)
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
|
||||
Blend [_SrcBlend] [_DstBlend]
|
||||
ZWrite [_ZWrite]
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
|
||||
#pragma shader_feature _PARALLAXMAP
|
||||
|
||||
#pragma multi_compile_fwdbase
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma vertex vertBase
|
||||
#pragma fragment fragBase
|
||||
#include "UnityStandardCoreForward.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Additive forward pass (one light per pass)
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD_DELTA"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend [_SrcBlend] One
|
||||
Fog { Color (0,0,0,0) } // in additive pass fog should be black
|
||||
ZWrite Off
|
||||
ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
#pragma shader_feature _PARALLAXMAP
|
||||
|
||||
#pragma multi_compile_fwdadd_fullshadows
|
||||
#pragma multi_compile_fog
|
||||
|
||||
|
||||
#pragma vertex vertAdd
|
||||
#pragma fragment fragAdd
|
||||
#include "UnityStandardCoreForward.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Shadow rendering pass
|
||||
Pass {
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
ZWrite On ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _PARALLAXMAP
|
||||
#pragma multi_compile_shadowcaster
|
||||
|
||||
#pragma vertex vertShadowCaster
|
||||
#pragma fragment fragShadowCaster
|
||||
|
||||
#include "UnityStandardShadow.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Deferred pass
|
||||
Pass
|
||||
{
|
||||
Name "DEFERRED"
|
||||
Tags { "LightMode" = "Deferred" }
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma exclude_renderers nomrt
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
#pragma shader_feature _PARALLAXMAP
|
||||
|
||||
#pragma multi_compile ___ UNITY_HDR_ON
|
||||
#pragma multi_compile ___ LIGHTMAP_ON
|
||||
#pragma multi_compile ___ DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
|
||||
#pragma multi_compile ___ DYNAMICLIGHTMAP_ON
|
||||
|
||||
#pragma vertex vertDeferred
|
||||
#pragma fragment fragDeferred
|
||||
|
||||
#include "UnityStandardCore.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Extracts information for lightmapping, GI (emission, albedo, ...)
|
||||
// This pass it not used during regular rendering.
|
||||
Pass
|
||||
{
|
||||
Name "META"
|
||||
Tags { "LightMode"="Meta" }
|
||||
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_meta
|
||||
#pragma fragment frag_meta
|
||||
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
|
||||
#include "UnityStandardMeta.cginc"
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
|
||||
LOD 150
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Base forward pass (directional light, emission, lightmaps, ...)
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
|
||||
Blend [_SrcBlend] [_DstBlend]
|
||||
ZWrite [_ZWrite]
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
|
||||
// SM2.0: NOT SUPPORTED shader_feature ___ _DETAIL_MULX2
|
||||
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
|
||||
|
||||
#pragma skip_variants SHADOWS_SOFT DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
|
||||
|
||||
#pragma multi_compile_fwdbase
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma vertex vertBase
|
||||
#pragma fragment fragBase
|
||||
#include "UnityStandardCoreForward.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Additive forward pass (one light per pass)
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD_DELTA"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend [_SrcBlend] One
|
||||
Fog { Color (0,0,0,0) } // in additive pass fog should be black
|
||||
ZWrite Off
|
||||
ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma shader_feature _NORMALMAP
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
|
||||
#pragma skip_variants SHADOWS_SOFT
|
||||
|
||||
#pragma multi_compile_fwdadd_fullshadows
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma vertex vertAdd
|
||||
#pragma fragment fragAdd
|
||||
#include "UnityStandardCoreForward.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
// ------------------------------------------------------------------
|
||||
// Shadow rendering pass
|
||||
Pass {
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
ZWrite On ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma skip_variants SHADOWS_SOFT
|
||||
#pragma multi_compile_shadowcaster
|
||||
|
||||
#pragma vertex vertShadowCaster
|
||||
#pragma fragment fragShadowCaster
|
||||
|
||||
#include "UnityStandardShadow.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Extracts information for lightmapping, GI (emission, albedo, ...)
|
||||
// This pass it not used during regular rendering.
|
||||
Pass
|
||||
{
|
||||
Name "META"
|
||||
Tags { "LightMode"="Meta" }
|
||||
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_meta
|
||||
#pragma fragment frag_meta
|
||||
|
||||
#pragma shader_feature _EMISSION
|
||||
#pragma shader_feature _METALLICGLOSSMAP
|
||||
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
||||
#pragma shader_feature ___ _DETAIL_MULX2
|
||||
|
||||
#include "UnityStandardMeta.cginc"
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FallBack "VertexLit"
|
||||
CustomEditor "StandardShaderGUI"
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6101b01373ac9434980202681f2a771a
|
||||
timeCreated: 1488361791
|
||||
licenseType: Free
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,134 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "RoadArchitect/TranShadow" {
|
||||
|
||||
Properties
|
||||
{
|
||||
// Usual stuffs
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
//_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0)
|
||||
//_Shininess ("Shininess", Range (0.01, 1)) = 0.078125
|
||||
_MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {}
|
||||
|
||||
// Shadow Stuff
|
||||
_ShadowIntensity ("Shadow Intensity", Range (0, 1)) = 0.6
|
||||
}
|
||||
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {
|
||||
"Queue"="AlphaTest"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
}
|
||||
|
||||
LOD 300
|
||||
|
||||
|
||||
// Main Surface Pass (Handles Spot/Point lights)
|
||||
CGPROGRAM
|
||||
#pragma surface surf BlinnPhong alpha vertex:vert fullforwardshadows approxview
|
||||
#pragma exclude_renderers d3d11 xbox360
|
||||
|
||||
//half _Shininess;
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _Color;
|
||||
//sampler2D _BumpMap;
|
||||
//sampler2D _ParallaxMap;
|
||||
//float _Parallax;
|
||||
|
||||
struct v2f {
|
||||
V2F_SHADOW_CASTER;
|
||||
float2 uv : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
//float2 uv_BumpMap;
|
||||
//float3 viewDir;
|
||||
};
|
||||
|
||||
v2f vert (inout appdata_full v) {
|
||||
v2f o;
|
||||
return o;
|
||||
}
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
// Comment the next 4 following lines to get a standard bumped rendering
|
||||
// [Without Parallax usage, which can cause strange result on the back side of the plane]
|
||||
// /*half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w;
|
||||
// float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir);
|
||||
// IN.uv_MainTex += offset;
|
||||
// IN.uv_BumpMap += offset;*/
|
||||
|
||||
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
|
||||
o.Albedo = tex.rgb * _Color.rgb;
|
||||
o.Gloss = tex.a;
|
||||
o.Alpha = tex.a * _Color.a;
|
||||
//clip(o.Alpha - _Cutoff);
|
||||
//o.Specular = _Shininess;
|
||||
//o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
|
||||
}
|
||||
ENDCG
|
||||
|
||||
|
||||
|
||||
// Shadow Pass : Adding the shadows (from Directional Light)
|
||||
// by blending the light attenuation
|
||||
Pass {
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Name "ShadowPass"
|
||||
Tags {"LightMode" = "ForwardBase"}
|
||||
|
||||
CGPROGRAM
|
||||
#pragma exclude_renderers d3d11 xbox360
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_fwdbase
|
||||
#pragma fragmentoption ARB_fog_exp2
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
#include "UnityCG.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
|
||||
struct v2f {
|
||||
float2 uv_MainTex : TEXCOORD1;
|
||||
float4 pos : SV_POSITION;
|
||||
LIGHTING_COORDS(3,4)
|
||||
float3 lightDir;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _Color;
|
||||
float _ShadowIntensity;
|
||||
|
||||
v2f vert (appdata_full v)
|
||||
{
|
||||
v2f o;
|
||||
o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.lightDir = ObjSpaceLightDir( v.vertex );
|
||||
TRANSFER_VERTEX_TO_FRAGMENT(o);
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float atten = LIGHT_ATTENUATION(i);
|
||||
|
||||
half4 c;
|
||||
c.rgb = 0;
|
||||
c.a = (1-atten) * _ShadowIntensity * (tex2D(_MainTex, i.uv_MainTex).a);
|
||||
return c;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
FallBack "Transparent/Specular"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3fa066443f03b0469a03d68240a69ff
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
@ -0,0 +1,138 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "RoadArchitect/TranShadowMarker" {
|
||||
|
||||
Properties
|
||||
{
|
||||
// Usual stuffs
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0)
|
||||
_Shininess ("Shininess", Range (0.01, 1)) = 0.078125
|
||||
_MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {}
|
||||
|
||||
// Bump stuffs
|
||||
//_Parallax ("Height", Range (0.005, 0.08)) = 0.02
|
||||
//_BumpMap ("Normalmap", 2D) = "bump" {}
|
||||
//_ParallaxMap ("Heightmap (A)", 2D) = "black" {}
|
||||
|
||||
// Shadow Stuff
|
||||
_ShadowIntensity ("Shadow Intensity", Range (0, 1)) = 0.6
|
||||
}
|
||||
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags {
|
||||
"Queue"="AlphaTest"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
}
|
||||
|
||||
LOD 300
|
||||
Offset -3,-2
|
||||
|
||||
|
||||
// Main Surface Pass (Handles Spot/Point lights)
|
||||
CGPROGRAM
|
||||
#pragma surface surf BlinnPhong alpha vertex:vert fullforwardshadows approxview
|
||||
|
||||
|
||||
half _Shininess;
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _Color;
|
||||
//sampler2D _BumpMap;
|
||||
//sampler2D _ParallaxMap;
|
||||
//float _Parallax;
|
||||
|
||||
struct v2f {
|
||||
V2F_SHADOW_CASTER;
|
||||
float2 uv : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
//float2 uv_BumpMap;
|
||||
//float3 viewDir;
|
||||
};
|
||||
|
||||
v2f vert (inout appdata_full v) {
|
||||
v2f o;
|
||||
return o;
|
||||
}
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
// Comment the next 4 following lines to get a standard bumped rendering
|
||||
// [Without Parallax usage, which can cause strange result on the back side of the plane]
|
||||
// /*half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w;
|
||||
// float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir);
|
||||
// IN.uv_MainTex += offset;
|
||||
// IN.uv_BumpMap += offset;*/
|
||||
|
||||
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
|
||||
o.Albedo = tex.rgb * _Color.rgb;
|
||||
o.Gloss = tex.a;
|
||||
o.Alpha = tex.a * _Color.a;
|
||||
// clip(o.Alpha - _Cutoff);
|
||||
o.Specular = _Shininess;
|
||||
//o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
|
||||
}
|
||||
ENDCG
|
||||
|
||||
|
||||
|
||||
// Shadow Pass : Adding the shadows (from Directional Light)
|
||||
// by blending the light attenuation
|
||||
Pass {
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Name "ShadowPass"
|
||||
Tags {"LightMode" = "ForwardBase"}
|
||||
// ZWrite On ZTest LEqual Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_fwdbase
|
||||
#pragma fragmentoption ARB_fog_exp2
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
#include "UnityCG.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
|
||||
struct v2f {
|
||||
float2 uv_MainTex : TEXCOORD1;
|
||||
float4 pos : SV_POSITION;
|
||||
LIGHTING_COORDS(3,4)
|
||||
float3 lightDir : TEXCOORD2;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
sampler2D _MainTex;
|
||||
float4 _Color;
|
||||
float _ShadowIntensity;
|
||||
|
||||
v2f vert (appdata_full v)
|
||||
{
|
||||
v2f o;
|
||||
o.uv_MainTex = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.lightDir = ObjSpaceLightDir( v.vertex );
|
||||
TRANSFER_VERTEX_TO_FRAGMENT(o);
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
float atten = LIGHT_ATTENUATION(i);
|
||||
half4 c;
|
||||
c.rgb = 0;
|
||||
c.a = (1-atten) * _ShadowIntensity * (tex2D(_MainTex, i.uv_MainTex).a);
|
||||
return c;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
FallBack "Transparent/Specular"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e94f0680ef6d2404dbc59e2ed5d88129
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
Reference in New Issue
Block a user