diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-11-06 15:12:42 -0500 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-11-06 15:12:42 -0500 |
commit | eb84bb298d2b95aec7b2ae12cbf25ac64f25379a (patch) | |
tree | efd616a157df06ab661c6d56651853431ac6b08b /VRCSDK3Worlds/Assets/VRCSDK/Sample Assets/Shaders/Mobile/VRChat-Mobile-BumpedMappedSpecular.shader | |
download | unityprojects-eb84bb298d2b95aec7b2ae12cbf25ac64f25379a.tar.gz unityprojects-eb84bb298d2b95aec7b2ae12cbf25ac64f25379a.tar.bz2 unityprojects-eb84bb298d2b95aec7b2ae12cbf25ac64f25379a.zip |
move to self host
Diffstat (limited to 'VRCSDK3Worlds/Assets/VRCSDK/Sample Assets/Shaders/Mobile/VRChat-Mobile-BumpedMappedSpecular.shader')
-rw-r--r-- | VRCSDK3Worlds/Assets/VRCSDK/Sample Assets/Shaders/Mobile/VRChat-Mobile-BumpedMappedSpecular.shader | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/VRCSDK3Worlds/Assets/VRCSDK/Sample Assets/Shaders/Mobile/VRChat-Mobile-BumpedMappedSpecular.shader b/VRCSDK3Worlds/Assets/VRCSDK/Sample Assets/Shaders/Mobile/VRChat-Mobile-BumpedMappedSpecular.shader new file mode 100644 index 00000000..025c8720 --- /dev/null +++ b/VRCSDK3Worlds/Assets/VRCSDK/Sample Assets/Shaders/Mobile/VRChat-Mobile-BumpedMappedSpecular.shader @@ -0,0 +1,54 @@ +// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) + +// Simplified Bumped Specular shader. Differences from regular Bumped Specular one: +// - no Main Color nor Specular Color +// - specular lighting directions are approximated per vertex +// - writes zero to alpha channel +// - Normalmap uses Tiling/Offset of the Base texture +// - no Deferred Lighting support +// - no Lightmap support +// - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. + +Shader "VRChat/Mobile/Bumped Mapped Specular" +{ + Properties + { + _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} + _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 + _SpecColor ("Specular Color", Color) = (1,1,1,1) + [NoScaleOffset] _BumpMap ("Normalmap", 2D) = "bump" {} + } + + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 250 + + CGPROGRAM + #pragma target 3.0 + #pragma surface surf BlinnPhong exclude_path:prepass exclude_path:deferred noforwardadd noshadow nodynlightmap nolppv noshadowmask + + UNITY_DECLARE_TEX2D(_MainTex); + UNITY_DECLARE_TEX2D(_BumpMap); + half _Shininess; + + struct Input + { + float2 uv_MainTex; + float4 color : COLOR; + }; + + void surf (Input IN, inout SurfaceOutput o) + { + fixed4 tex = UNITY_SAMPLE_TEX2D(_MainTex, IN.uv_MainTex); + o.Albedo = tex.rgb * IN.color; + o.Gloss = tex.a; + o.Alpha = 1.0f; + o.Specular = _Shininess; + o.Normal = UnpackNormal(UNITY_SAMPLE_TEX2D(_BumpMap, IN.uv_MainTex)); + } + ENDCG + } + + Fallback "VRChat/Mobile/Diffuse" +} |