| 1 | Shader "OvrAvatar/AvatarSurfaceShaderPBSV2" { |
| 2 | Properties { |
| 3 | _AlbedoMultiplier ("Albedo Multiplier", Color) = (1,1,1,1) |
| 4 | _Albedo ("Albedo (RGB)", 2D) = "white" {} |
| 5 | _Metallicness("Metallicness", 2D) = "grey" {} |
| 6 | _GlossinessScale ("Glossiness Scale", Range(0,1)) = 0.5 |
| 7 | } |
| 8 | SubShader { |
| 9 | Tags { "RenderType"="Opaque" } |
| 10 | LOD 200 |
| 11 | |
| 12 | CGPROGRAM |
| 13 | // Physically based Standard lighting model, and enable shadows on all light types |
| 14 | #pragma surface surf Standard fullforwardshadows |
| 15 | |
| 16 | // Use shader model 3.0 target, to get nicer looking lighting |
| 17 | #pragma target 3.0 |
| 18 | |
| 19 | sampler2D _Albedo; |
| 20 | sampler2D _Metallicness; |
| 21 | |
| 22 | struct Input { |
| 23 | float2 uv_Albedo; |
| 24 | }; |
| 25 | |
| 26 | float _GlossinessScale; |
| 27 | float4 _AlbedoMultiplier; |
| 28 | |
| 29 | void surf (Input IN, inout SurfaceOutputStandard o) { |
| 30 | fixed4 c = tex2D (_Albedo, IN.uv_Albedo) * _AlbedoMultiplier; |
| 31 | o.Albedo = c.rgb; |
| 32 | o.Metallic = tex2D (_Metallicness, IN.uv_Albedo).r; |
| 33 | o.Smoothness = _GlossinessScale; |
| 34 | o.Alpha = 1.0; |
| 35 | } |
| 36 | ENDCG |
| 37 | } |
| 38 | FallBack "Diffuse" |
| 39 | } |