98 lines
6.4 KiB
GLSL
98 lines
6.4 KiB
GLSL
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "PBR Material Double"
|
|
{
|
|
Properties
|
|
{
|
|
_AlbedoTex("Albedo Tex", 2D) = "white" {}
|
|
_BaseCol("Base Col", Color) = (0,0,0,0)
|
|
_MetalRoughnessAo("Metal&Roughness&Ao", 2D) = "white" {}
|
|
_MetalInt("Metal Int", Range( 0 , 1)) = 0
|
|
_RoughnessInt("Roughness Int", Range( 0 , 1)) = 0
|
|
_NormalTex("Normal Tex", 2D) = "bump" {}
|
|
_NormalInt("Normal Int", Range( 0 , 3)) = 1
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
[HideInInspector] __dirty( "", Int ) = 1
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" }
|
|
Cull Off
|
|
CGPROGRAM
|
|
#pragma target 3.0
|
|
#pragma surface surf Standard keepalpha addshadow fullforwardshadows
|
|
struct Input
|
|
{
|
|
float2 uv_texcoord;
|
|
};
|
|
|
|
uniform sampler2D _NormalTex;
|
|
uniform float4 _NormalTex_ST;
|
|
uniform float _NormalInt;
|
|
uniform sampler2D _AlbedoTex;
|
|
uniform float4 _AlbedoTex_ST;
|
|
uniform float4 _BaseCol;
|
|
uniform sampler2D _MetalRoughnessAo;
|
|
uniform float4 _MetalRoughnessAo_ST;
|
|
uniform float _MetalInt;
|
|
uniform float _RoughnessInt;
|
|
|
|
void surf( Input i , inout SurfaceOutputStandard o )
|
|
{
|
|
float2 uv_NormalTex = i.uv_texcoord * _NormalTex_ST.xy + _NormalTex_ST.zw;
|
|
float3 tex2DNode8 = UnpackNormal( tex2D( _NormalTex, uv_NormalTex ) );
|
|
float3 appendResult46 = (float3(( tex2DNode8.r * _NormalInt ) , ( tex2DNode8.g * _NormalInt ) , tex2DNode8.b));
|
|
o.Normal = appendResult46;
|
|
float2 uv_AlbedoTex = i.uv_texcoord * _AlbedoTex_ST.xy + _AlbedoTex_ST.zw;
|
|
o.Albedo = ( tex2D( _AlbedoTex, uv_AlbedoTex ) * _BaseCol ).rgb;
|
|
float2 uv_MetalRoughnessAo = i.uv_texcoord * _MetalRoughnessAo_ST.xy + _MetalRoughnessAo_ST.zw;
|
|
float4 tex2DNode20 = tex2D( _MetalRoughnessAo, uv_MetalRoughnessAo );
|
|
o.Metallic = ( tex2DNode20.r * _MetalInt );
|
|
o.Smoothness = ( ( 1.0 - tex2DNode20.g ) * _RoughnessInt );
|
|
o.Alpha = 1;
|
|
}
|
|
|
|
ENDCG
|
|
}
|
|
Fallback "Diffuse"
|
|
CustomEditor "ASEMaterialInspector"
|
|
}
|
|
/*ASEBEGIN
|
|
Version=18935
|
|
7;32;1906;957;1284.882;143.6796;1;True;True
|
|
Node;AmplifyShaderEditor.SamplerNode;20;-1241.862,645.8665;Inherit;True;Property;_MetalRoughnessAo;Metal&Roughness&Ao;2;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SamplerNode;8;-1234.574,144.0176;Inherit;True;Property;_NormalTex;Normal Tex;5;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;True;bump;Auto;True;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.RangedFloatNode;9;-1128.477,366.8184;Inherit;False;Property;_NormalInt;Normal Int;6;0;Create;True;0;0;0;False;0;False;1;1;0;3;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ColorNode;26;-781.6854,-48.21597;Inherit;False;Property;_BaseCol;Base Col;1;0;Create;True;0;0;0;False;0;False;0,0,0,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SamplerNode;6;-840.9681,-331.2638;Inherit;True;Property;_AlbedoTex;Albedo Tex;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.OneMinusNode;22;-652.2739,715.7665;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;-796.6078,191.0359;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;47;-801.7852,346.0115;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;24;-715.1262,633.2165;Inherit;False;Property;_MetalInt;Metal Int;3;0;Create;True;0;0;0;False;0;False;0;1;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;25;-885.366,951.3416;Inherit;False;Property;_RoughnessInt;Roughness Int;4;0;Create;True;0;0;0;False;0;False;0;1;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;19;-484.0583,-129.0162;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;23;-389.6737,734.6655;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;21;-399.323,562.252;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;46;-490.7852,261.0115;Inherit;True;FLOAT3;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;45;-42.33704,350.6596;Float;False;True;-1;2;ASEMaterialInspector;0;0;Standard;PBR Material alphamask;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Off;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;True;Opaque;;Geometry;All;18;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;True;Relative;0;;0;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;False;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
|
|
WireConnection;22;0;20;2
|
|
WireConnection;10;0;8;1
|
|
WireConnection;10;1;9;0
|
|
WireConnection;47;0;8;2
|
|
WireConnection;47;1;9;0
|
|
WireConnection;19;0;6;0
|
|
WireConnection;19;1;26;0
|
|
WireConnection;23;0;22;0
|
|
WireConnection;23;1;25;0
|
|
WireConnection;21;0;20;1
|
|
WireConnection;21;1;24;0
|
|
WireConnection;46;0;10;0
|
|
WireConnection;46;1;47;0
|
|
WireConnection;46;2;8;3
|
|
WireConnection;45;0;19;0
|
|
WireConnection;45;1;46;0
|
|
WireConnection;45;3;21;0
|
|
WireConnection;45;4;23;0
|
|
ASEEND*/
|
|
//CHKSM=D069092E7C6DE57D0C1B90DD8E564D89F8EEA8C7 |