125 lines
5.8 KiB
Plaintext
125 lines
5.8 KiB
Plaintext
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
|
|
|
// Shader created with Shader Forge v1.27
|
|
// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
|
|
// Note: Manually altering this data may prevent you from opening it in Shader Forge
|
|
/*SF_DATA;ver:1.27;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:1,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:0,bdst:1,dpts:2,wrdp:True,dith:0,rfrpo:True,rfrpn:Refraction,coma:15,ufog:False,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:3138,x:32719,y:32712,varname:node_3138,prsc:2|emission-5273-OUT;n:type:ShaderForge.SFN_Color,id:7241,x:32120,y:32811,ptovrint:False,ptlb:Color,ptin:_Color,varname:node_7241,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:1,c2:1,c3:1,c4:1;n:type:ShaderForge.SFN_LightAttenuation,id:2224,x:32120,y:32973,varname:node_2224,prsc:2;n:type:ShaderForge.SFN_Tex2d,id:1771,x:32330,y:32633,ptovrint:False,ptlb:MainTex,ptin:_MainTex,varname:node_1771,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,ntxv:0,isnm:False;n:type:ShaderForge.SFN_Multiply,id:5273,x:32504,y:32811,varname:node_5273,prsc:2|A-1771-RGB,B-5918-OUT;n:type:ShaderForge.SFN_Color,id:1234,x:32120,y:32640,ptovrint:False,ptlb:Shadow Color,ptin:_ShadowColor,varname:node_1234,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.5,c2:0.5,c3:0.5,c4:1;n:type:ShaderForge.SFN_Lerp,id:5918,x:32330,y:32811,varname:node_5918,prsc:2|A-1234-RGB,B-7241-RGB,T-2224-OUT;proporder:7241-1771-1234;pass:END;sub:END;*/
|
|
|
|
Shader "CubedParadox/Unit Shadowed" {
|
|
Properties {
|
|
_Color ("Color", Color) = (1,1,1,1)
|
|
_MainTex ("MainTex", 2D) = "white" {}
|
|
_ShadowColor ("Shadow Color", Color) = (0.5,0.5,0.5,1)
|
|
}
|
|
SubShader {
|
|
Tags {
|
|
"RenderType"="Opaque"
|
|
}
|
|
|
|
CGPROGRAM
|
|
#pragma surface surf Lambert addshadow
|
|
struct Input {
|
|
float4 color : COLOR;
|
|
};
|
|
void surf(Input IN, inout SurfaceOutput o) {
|
|
o.Albedo = 1;
|
|
}
|
|
ENDCG
|
|
|
|
Pass {
|
|
Name "FORWARD"
|
|
Tags {
|
|
"LightMode"="ForwardBase"
|
|
}
|
|
|
|
|
|
CGPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
#define UNITY_PASS_FORWARDBASE
|
|
#include "UnityCG.cginc"
|
|
#include "AutoLight.cginc"
|
|
#include "Lighting.cginc"
|
|
#pragma multi_compile_fwdbase_fullshadows
|
|
#pragma exclude_renderers gles3 metal d3d11_9x xbox360 xboxone ps3 ps4 psp2
|
|
#pragma target 3.0
|
|
uniform float4 _Color;
|
|
uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
|
|
uniform float4 _ShadowColor;
|
|
struct VertexInput {
|
|
float4 vertex : POSITION;
|
|
float2 texcoord0 : TEXCOORD0;
|
|
};
|
|
struct VertexOutput {
|
|
float4 pos : SV_POSITION;
|
|
float2 uv0 : TEXCOORD0;
|
|
LIGHTING_COORDS(1,2)
|
|
};
|
|
VertexOutput vert (VertexInput v) {
|
|
VertexOutput o = (VertexOutput)0;
|
|
o.uv0 = v.texcoord0;
|
|
o.pos = UnityObjectToClipPos(v.vertex );
|
|
TRANSFER_VERTEX_TO_FRAGMENT(o)
|
|
return o;
|
|
}
|
|
float4 frag(VertexOutput i) : COLOR {
|
|
////// Lighting:
|
|
float attenuation = LIGHT_ATTENUATION(i);
|
|
////// Emissive:
|
|
float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(i.uv0, _MainTex));
|
|
float3 emissive = (_MainTex_var.rgb*lerp(_ShadowColor.rgb,_Color.rgb,attenuation));
|
|
float3 finalColor = emissive;
|
|
return fixed4(finalColor,1);
|
|
}
|
|
ENDCG
|
|
}
|
|
Pass {
|
|
Name "FORWARD_DELTA"
|
|
Tags {
|
|
"LightMode"="ForwardAdd"
|
|
}
|
|
Blend One One
|
|
|
|
|
|
CGPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
#define UNITY_PASS_FORWARDADD
|
|
#include "UnityCG.cginc"
|
|
#include "AutoLight.cginc"
|
|
#include "Lighting.cginc"
|
|
#pragma multi_compile_fwdadd_fullshadows
|
|
#pragma exclude_renderers gles3 metal d3d11_9x xbox360 xboxone ps3 ps4 psp2
|
|
#pragma target 3.0
|
|
uniform float4 _Color;
|
|
uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
|
|
uniform float4 _ShadowColor;
|
|
struct VertexInput {
|
|
float4 vertex : POSITION;
|
|
float2 texcoord0 : TEXCOORD0;
|
|
};
|
|
struct VertexOutput {
|
|
float4 pos : SV_POSITION;
|
|
float2 uv0 : TEXCOORD0;
|
|
LIGHTING_COORDS(1,2)
|
|
};
|
|
VertexOutput vert (VertexInput v) {
|
|
VertexOutput o = (VertexOutput)0;
|
|
o.uv0 = v.texcoord0;
|
|
o.pos = UnityObjectToClipPos(v.vertex );
|
|
TRANSFER_VERTEX_TO_FRAGMENT(o)
|
|
return o;
|
|
}
|
|
float4 frag(VertexOutput i) : COLOR {
|
|
////// Lighting:
|
|
float attenuation = LIGHT_ATTENUATION(i);
|
|
float3 finalColor = 0;
|
|
return fixed4(finalColor * 1,0);
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
FallBack "Diffuse"
|
|
CustomEditor "ShaderForgeMaterialInspector"
|
|
}
|