|
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "ASESampleShaders/Transmission"
|
|
{
|
|
Properties
|
|
{
|
|
[HideInInspector] __dirty( "", Int ) = 1
|
|
_Transmission("Transmission", Color) = (0,0,0,0)
|
|
_NormalMap("Normal Map", 2D) = "bump" {}
|
|
_Color("Color", Color) = (0,0,0,0)
|
|
_BaseColor("Base Color", 2D) = "white" {}
|
|
_Metallic("Metallic", Range( 0 , 1)) = 0
|
|
_Gloss("Gloss", Range( 0 , 1)) = 0.8
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" }
|
|
Cull Back
|
|
ZTest LEqual
|
|
CGPROGRAM
|
|
#include "UnityPBSLighting.cginc"
|
|
#pragma target 3.0
|
|
#pragma surface surf StandardCustom keepalpha addshadow fullforwardshadows exclude_path:deferred
|
|
struct Input
|
|
{
|
|
float2 uv_texcoord;
|
|
};
|
|
|
|
struct SurfaceOutputStandardCustom
|
|
{
|
|
fixed3 Albedo;
|
|
fixed3 Normal;
|
|
half3 Emission;
|
|
half Metallic;
|
|
half Smoothness;
|
|
half Occlusion;
|
|
fixed Alpha;
|
|
fixed3 Transmission;
|
|
};
|
|
|
|
uniform sampler2D _NormalMap;
|
|
uniform float4 _NormalMap_ST;
|
|
uniform sampler2D _BaseColor;
|
|
uniform float4 _BaseColor_ST;
|
|
uniform fixed4 _Color;
|
|
uniform fixed _Metallic;
|
|
uniform fixed _Gloss;
|
|
uniform fixed4 _Transmission;
|
|
|
|
inline half4 LightingStandardCustom(SurfaceOutputStandardCustom s, half3 viewDir, UnityGI gi )
|
|
{
|
|
half3 transmission = max(0 , -dot(s.Normal, gi.light.dir)) * gi.light.color * s.Transmission;
|
|
half4 d = half4(s.Albedo * transmission , 0);
|
|
|
|
SurfaceOutputStandard r;
|
|
r.Albedo = s.Albedo;
|
|
r.Normal = s.Normal;
|
|
r.Emission = s.Emission;
|
|
r.Metallic = s.Metallic;
|
|
r.Smoothness = s.Smoothness;
|
|
r.Occlusion = s.Occlusion;
|
|
r.Alpha = s.Alpha;
|
|
return LightingStandard (r, viewDir, gi) + d;
|
|
}
|
|
|
|
inline void LightingStandardCustom_GI(SurfaceOutputStandardCustom s, UnityGIInput data, inout UnityGI gi )
|
|
{
|
|
UNITY_GI(gi, s, data);
|
|
}
|
|
|
|
void surf( Input i , inout SurfaceOutputStandardCustom o )
|
|
{
|
|
float2 uv_NormalMap = i.uv_texcoord * _NormalMap_ST.xy + _NormalMap_ST.zw;
|
|
o.Normal = UnpackNormal( tex2D( _NormalMap, uv_NormalMap ) );
|
|
float2 uv_BaseColor = i.uv_texcoord * _BaseColor_ST.xy + _BaseColor_ST.zw;
|
|
o.Albedo = ( tex2D( _BaseColor, uv_BaseColor ) * _Color ).xyz;
|
|
o.Metallic = _Metallic;
|
|
o.Smoothness = _Gloss;
|
|
o.Transmission = _Transmission.rgb;
|
|
o.Alpha = 1;
|
|
}
|
|
|
|
ENDCG
|
|
}
|
|
Fallback "Diffuse"
|
|
CustomEditor "ASEMaterialInspector"
|
|
}
|
|
/*ASEBEGIN
|
|
Version=12003
|
|
0;92;1541;926;1195.518;334.1495;1.3;False;False
|
|
Node;AmplifyShaderEditor.SamplerNode;1;-823.954,-122.8771;Float;True;Property;_BaseColor;Base Color;3;0;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;1.0,0;False;2;FLOAT;0.0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1.0;False;5;FLOAT4;FLOAT;FLOAT;FLOAT;FLOAT
|
|
Node;AmplifyShaderEditor.ColorNode;2;-716.0739,66.4277;Float;False;Property;_Color;Color;2;0;0,0,0,0;0;5;COLOR;FLOAT;FLOAT;FLOAT;FLOAT
|
|
Node;AmplifyShaderEditor.ColorNode;7;-372.3347,513.6476;Float;False;Property;_Transmission;Transmission;-1;0;0,0,0,0;0;5;COLOR;FLOAT;FLOAT;FLOAT;FLOAT
|
|
Node;AmplifyShaderEditor.SamplerNode;6;-513.9389,303.0193;Float;True;Property;_NormalMap;Normal Map;1;0;None;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;6;0;SAMPLER2D;0,0;False;1;FLOAT2;1.0,0;False;2;FLOAT;0.0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1.0;False;5;FLOAT3;FLOAT;FLOAT;FLOAT;FLOAT
|
|
Node;AmplifyShaderEditor.RangedFloatNode;5;-429.0605,215.0723;Float;False;Property;_Gloss;Gloss;5;0;0.8;0;1;0;1;FLOAT
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;-422.3381,-5.544991;Float;False;2;2;0;FLOAT4;0.0,0,0,0;False;1;COLOR;0.0,0,0,0;False;1;FLOAT4
|
|
Node;AmplifyShaderEditor.RangedFloatNode;4;-430.4556,117.6564;Float;False;Property;_Metallic;Metallic;4;0;0;0;1;0;1;FLOAT
|
|
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;80.91907,-11.16125;Fixed;False;True;2;Fixed;ASEMaterialInspector;0;Standard;ASESampleShaders/Transmission;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Back;0;3;False;0;0;Opaque;0.5;True;True;0;False;Opaque;Geometry;ForwardOnly;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;True;False;0;255;255;0;0;0;0;False;0;4;10;25;False;0.5;True;0;Zero;Zero;0;Zero;Zero;Add;Add;0;False;0;0,0,0,0;VertexOffset;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;0;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0.0;False;4;FLOAT;0.0;False;5;FLOAT;0.0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0.0;False;9;FLOAT;0.0;False;10;OBJECT;0.0;False;11;FLOAT3;0.0,0,0;False;12;FLOAT3;0.0,0,0;False;14;FLOAT4;0.0,0,0,0;False;15;FLOAT3;0,0,0;False;0
|
|
WireConnection;3;0;1;0
|
|
WireConnection;3;1;2;0
|
|
WireConnection;0;0;3;0
|
|
WireConnection;0;1;6;0
|
|
WireConnection;0;3;4;0
|
|
WireConnection;0;4;5;0
|
|
WireConnection;0;6;7;0
|
|
ASEEND*/
|
|
//CHKSM=D1ACCDDD4FB9E49D2BA42BFCF930909C3D4897DA
|