• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Marshi · Aug 04, 2020 at 05:43 PM · shader programming

I'm having trouble fixing normal maps for a fluff shader using fins

Hi! as the title says, I'm having trouble fixing normal maps for a custom version of the "Standard (Specular Setup)" shader that generates fins to create a fluffy effect around the model for VRChat, what I did so far was copy a section of a friend's shader into it and adjusted the code a little to make the lighting on the fins work nicer with normal Unity lighting, however once I added the fins the normal map seemingly stopped working and I don't know how to make it work again, anyone know how I can correct this issue? I'm also having trouble getting the specular map to work correctly as well. // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)

 Shader "Standard (Specular setup fluffy)"
 {
     Properties
     {
         _Color("Color", Color) = (1,1,1,1)
         _MainTex("Albedo", 2D) = "white" {}
 
         _Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
 
         _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
         _GlossMapScale("Smoothness Factor", Range(0.0, 1.0)) = 1.0
         [Enum(Specular Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel ("Smoothness texture channel", Float) = 0
 
         _SpecColor("Specular", Color) = (0.2,0.2,0.2)
         _SpecGlossMap("Specular", 2D) = "white" {}
         [ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
         [ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0
 
         _BumpScale("Scale", Float) = 1.0
         [Normal] _BumpMap("Normal Map", 2D) = "bump" {}
 
         _Size("Size of Fur", Range(0, 5)) = 0.5
         _FluffTex("Fluff Texture", 2D) = "white" {}
         _Cutoff("Fin cutoff", Range(0,1)) = 0.5
 
         _Falloff("Falloff", Color) = (1,1,1,1)
         _Falloff2("Falloff 2", Color) = (1,1,1,1)
         _FalloffExponent("Falloff Brightness", Float) = 1
         _FalloffBrightness2("Falloff Brightness 2", Float) = 2
 
         _Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02
         _ParallaxMap ("Height Map", 2D) = "black" {}
 
         _OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
         _OcclusionMap("Occlusion", 2D) = "white" {}
 
         _EmissionColor("Color", Color) = (0,0,0)
         _EmissionMap("Emission", 2D) = "white" {}
 
         _DetailMask("Detail Mask", 2D) = "white" {}
 
         _DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {}
         _DetailNormalMapScale("Scale", Float) = 1.0
         [Normal] _DetailNormalMap("Normal Map", 2D) = "bump" {}
 
         [Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0
 
         // Blending state
         [HideInInspector] _Mode ("__mode", Float) = 0.0
         [HideInInspector] _SrcBlend ("__src", Float) = 1.0
         [HideInInspector] _DstBlend ("__dst", Float) = 0.0
         [HideInInspector] _ZWrite ("__zw", Float) = 1.0
     }
 
     CGINCLUDE
         #define UNITY_SETUP_BRDF_INPUT SpecularSetup
     ENDCG
 
     SubShader
     {
         Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
         LOD 300
 
         Pass
         {
             ZWrite On
             Blend Zero One
             CGPROGRAM
         #include "UnityCG.cginc"
             #pragma vertex vert
             #pragma fragment frag
 
         struct appdata
         {
             float4 vertex : POSITION;
         };
 
 
         struct v2f
         {
             float4 vertex : SV_POSITION;
         };
 
         v2f vert(appdata IN) {
             v2f OUT;
             OUT.vertex = UnityObjectToClipPos(IN.vertex);
             return OUT;
         }
 
         float4 frag(v2f IN) : COLOR0
         {
             return float4(0,0,0,0);
         }
 
             ENDCG
         }
 
         //Fins
 
         Pass
         {
         LOD 100
         Cull Off
         ZWrite Off
         Ztest Less
         Blend SrcAlpha OneMinusSrcAlpha
         CGPROGRAM
         #define UNITY_SHADER_NO_UPGRADE
         #pragma vertex vert
         #pragma geometry geom
         #pragma fragment frag
         #pragma multi_compile_fwd_base
         #pragma target 4.0
         #pragma require geometry
 
         #include "UnityCG.cginc"
         #include "UnityLightingCommon.cginc"
         #include "AutoLight.cginc"
 
         struct appdata
         {
             float4 vertex : POSITION;
             float2 uv : TEXCOORD0;
             float2 uv2 : TEXCOORD1;
             float3 normal : NORMAL;
         };
 
 
         struct v2g
         {
             float2 uv : TEXCOORD0;
             float2 uv_unscaled : TEXCOORD1;
             float2 uv2 : TEXCOORD2;
             float4 pos : SV_POSITION;
             float3 normal : NORMAL;
             float3 falloff : COLOR0;
             float4 diffuse : COLOR1;
             float4 ambient : COLOR2;
             SHADOW_COORDS(3)
         };
 
         struct g2f
         {
             float2 uv : TEXCOORD0;
             float2 originalUv : TEXCOORD1;
             float2 originalUv_unscaled : TEXCOORD2;
             float2 uv2 : TEXCOORD3;
             float4 vertex : SV_POSITION;
             float3 falloff : COLOR0;
             float4 diffuse : COLOR1;
             float4 ambient : COLOR2;
             SHADOW_COORDS(4)
         };
 
         sampler2D _MainTex;
         sampler2D _SideFurTex;
         sampler2D _FurMaskTex;
         float4 _MainTex_ST;
         float _Size;
         float _FurLayers;
         float4 _Comb;
         sampler2D _FluffTex;
         sampler2D _Dirt;
         sampler2D _Decals;
         float4 _Falloff;
         float _FalloffExponent;
         //float _FalloffExponent2;
         float _FalloffBrightness2;
         float4 _Falloff2;
 
         float3 DoFalloff(float lightatten, float4 normal, float4 viewDir, float3 worldNormal)
         {
             float biasedatten = lightatten * 0.5f;//pow(saturate(lightatten), _RimBias)*_RimBias;
             float4 FalloffTerm = pow(1 - dot(normal, normalize(viewDir)), 1);
             float4 Falloff1 = _Falloff * lerp(1 - worldNormal.y, 1, 0.5);
             float4 Falloff2 = _Falloff2 * lerp(worldNormal.y, 1, 0.75);
             float3 Falloff = lerp(Falloff1 * _FalloffExponent, Falloff2 * _FalloffBrightness2, biasedatten) * FalloffTerm / 3;
             return Falloff * saturate(pow(FalloffTerm, 0.35));
         }
 
         float DoSoftDiffuse(float NdotL)
         {
             NdotL = saturate(NdotL);
             return (pow(NdotL, 0.5) / 6) + (pow(NdotL, 1) / 5) + (pow(NdotL, 2) / 1.5);
         }
 
         v2g vert(appdata v)
         {
             v2g o;
             o.pos = mul(unity_ObjectToWorld, v.vertex);
             o.uv = TRANSFORM_TEX(v.uv, _MainTex);
             o.uv_unscaled = v.uv;
             o.uv2 = v.uv2;
             o.normal = mul(v.normal, unity_WorldToObject);
             float4 viewDir = float4(ObjSpaceViewDir(v.vertex),1);
             float3 normal = v.normal;
             float3 worldNormal = UnityObjectToWorldNormal(v.normal);
             float3 wNormal = worldNormal;
             worldNormal *= 1.25f;
             float3 screenNormal = mul(UNITY_MATRIX_V, UnityObjectToWorldNormal(v.normal));
             //float3 falloff = pow(1 - dot(normal, normalize(viewDir)), _FalloffExponent2) * _FalloffExponent * 0.75;
             //float falloffthingy = 1 - lerp((clamp(screenNormal.x, 0, 1) * clamp(screenNormal.x, 0, 1)), (clamp(screenNormal.y, 0, 1) * clamp(screenNormal.y, 0, 1)), 0.5f);
             o.diffuse = DoSoftDiffuse(dot(worldNormal, _WorldSpaceLightPos0.xyz));
             o.diffuse.w = 1;
             o.falloff = DoFalloff(o.diffuse, float4(normal,0), viewDir, worldNormal) * 2;//((falloff * falloffthingy * _Falloff) + ((falloff * falloff * (1 - clamp(falloffthingy, 0, 1)) / 8) * _FalloffBrightness2 * _LightColor0));
             float ambientUp = wNormal.y;
             float ambientDown = 1-wNormal.y;
             float4 ambient;
             ambient.w = 1;
             ambient.xyz = unity_AmbientSky * ambientUp;
             ambient.xyz += unity_AmbientGround * ambientDown;
             o.ambient = ambient;
             TRANSFER_SHADOW(o);
             return o;
         }
 
         [maxvertexcount(4)]
         void geom(line v2g IN[2], inout TriangleStream<g2f> triStream)
         {
             float4x4 vp = mul(UNITY_MATRIX_MVP, unity_WorldToObject);
 
             float3 eyeVec = normalize(((IN[0].pos - _WorldSpaceCameraPos) + (IN[1].pos - _WorldSpaceCameraPos)) / 2);
             float4 lineNormal = float4(normalize((IN[0].normal + IN[1].normal) / 2), 0) * 0.15 * _Size;
             float eyeDot = dot(lineNormal, eyeVec);
 
             float3 newNormal = normalize(cross(IN[1].pos - IN[0].pos, lineNormal));
             float maxOffset = 0.25f;
 
             if (eyeDot < maxOffset && eyeDot > -maxOffset)
             {
 
                 g2f pIn;
 
                 pIn.vertex = mul(vp, IN[1].pos);
                 pIn.uv = float2(0.0625+((IN[1].uv.x+ IN[1].uv.y)/2), 0);
                 pIn.originalUv = IN[1].uv;
                 pIn.originalUv_unscaled = IN[1].uv_unscaled;
                 pIn.uv2 = IN[1].uv2;
                 pIn.falloff = IN[1].falloff;
                 #if defined (SHADOWS_SCREEN) || defined (SHADOWS_DEPTH) || defined (SPOT)
                 pIn._ShadowCoord = IN[1]._ShadowCoord;
                 #endif
                 pIn.diffuse = IN[1].diffuse;
                 pIn.ambient = IN[1].ambient;
                 triStream.Append(pIn);
 
                 pIn.vertex = mul(vp, IN[1].pos + lineNormal);
                 pIn.uv = float2(0.0625 + ((IN[1].uv.x + IN[1].uv.y) / 2), 1);
                 pIn.originalUv = IN[1].uv;
                 pIn.originalUv_unscaled = IN[1].uv_unscaled;
                 pIn.uv2 = IN[1].uv2;
                 pIn.falloff = IN[1].falloff;
                 #if defined (SHADOWS_SCREEN) || defined (SHADOWS_DEPTH) || defined (SPOT)
                 pIn._ShadowCoord = IN[1]._ShadowCoord;
                 #endif
                 pIn.diffuse = IN[1].diffuse;
                 pIn.ambient = IN[1].ambient;
                 triStream.Append(pIn);
 
                 pIn.vertex = mul(vp, IN[0].pos);
                 pIn.uv = float2(((IN[1].uv.x + IN[1].uv.y) / 2), 0);
                 pIn.originalUv = IN[0].uv;
                 pIn.originalUv_unscaled = IN[0].uv_unscaled;
                 pIn.uv2 = IN[0].uv2;
                 pIn.falloff = IN[0].falloff;
                 #if defined (SHADOWS_SCREEN) || defined (SHADOWS_DEPTH) || defined (SPOT)
                 pIn._ShadowCoord = IN[0]._ShadowCoord;
                 #endif
                 pIn.diffuse = IN[0].diffuse;
                 pIn.ambient = IN[0].ambient;
                 triStream.Append(pIn);
 
                 pIn.vertex = mul(vp, IN[0].pos + lineNormal);
                 pIn.uv = float2(((IN[1].uv.x + IN[1].uv.y) / 2), 1);
                 pIn.originalUv = IN[0].uv;
                 pIn.originalUv_unscaled = IN[0].uv_unscaled;
                 pIn.uv2 = IN[0].uv2;
                 pIn.falloff = IN[0].falloff;
                 #if defined (SHADOWS_SCREEN) || defined (SHADOWS_DEPTH) || defined (SPOT)
                 pIn._ShadowCoord = IN[0]._ShadowCoord;
                 #endif
                 pIn.diffuse = IN[0].diffuse;
                 pIn.ambient = IN[0].ambient;
                 triStream.Append(pIn);
 
                 triStream.RestartStrip();
             }
 
         }
 
         fixed4 frag(g2f i) : SV_Target
         {
 
             half    shadow = 1.0;
 
             shadow = SHADOW_ATTENUATION(IN);
 
             fixed4 originalCol = tex2D(_MainTex, i.originalUv) * tex2D(_Dirt, i.originalUv_unscaled);
             fixed col = tex2D(_FluffTex, i.uv).y;
             fixed mask = tex2D(_FluffTex, i.originalUv_unscaled).x;
 
             //if (mask.r <= .5) discard;
             clip(mask.r - 0.75);
 
             float clampcolorterm_uv2 = 1;
             clampcolorterm_uv2 -= clamp((-clamp(floor(i.uv2.x), -1, 0) + (clamp(ceil(i.uv2.x), 1, 2) - 1)), 0, 1);
             float4 decaldiff = 0;
             //#if defined(DECAL)
             decaldiff = tex2D(_Decals, i.uv2);
             //#endif
             col = lerp(col, 0, pow(decaldiff.w,2)/2 * clampcolorterm_uv2);
 
             originalCol.w *= col * mask;
             originalCol.xyz *= ((i.diffuse * shadow) + i.ambient);
             originalCol.xyz += i.falloff / 4;
 
             return originalCol;// *col;
         }
 
         ENDCG
         }
 
         // ------------------------------------------------------------------
         //  Base forward pass (directional light, emission, lightmaps, ...)
         Pass
         {
             Name "FORWARD"
             Tags { "LightMode" = "ForwardBase" }
 
             Blend [_SrcBlend] [_DstBlend]
             ZWrite [_ZWrite]
 
             CGPROGRAM
             #pragma target 3.0
 
             // -------------------------------------
 
             #pragma shader_feature_local _NORMALMAP
             #pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
             #pragma shader_feature _EMISSION
             #pragma shader_feature_local _SPECGLOSSMAP
             #pragma shader_feature_local _DETAIL_MULX2
             #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
             #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF
             #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF
             #pragma shader_feature_local _PARALLAXMAP
 
             #pragma multi_compile_fwdbase
             #pragma multi_compile_fog
             #pragma multi_compile_instancing
             // Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
             //#pragma multi_compile _ LOD_FADE_CROSSFADE
 
             #pragma vertex vertBase
             #pragma fragment fragBase
             #include "UnityStandardCoreForward.cginc"
 
             ENDCG
         }
         // ------------------------------------------------------------------
         //  Additive forward pass (one light per pass)
         Pass
         {
             Name "FORWARD_DELTA"
             Tags { "LightMode" = "ForwardAdd" }
             Blend [_SrcBlend] One
             Fog { Color (0,0,0,0) } // in additive pass fog should be black
             ZWrite Off
             ZTest LEqual
 
             CGPROGRAM
             #pragma target 3.0
 
             // -------------------------------------
 
             #pragma shader_feature_local _NORMALMAP
             #pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
             #pragma shader_feature_local _SPECGLOSSMAP
             #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
             #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF
             #pragma shader_feature_local _DETAIL_MULX2
             #pragma shader_feature_local _PARALLAXMAP
 
             #pragma multi_compile_fwdadd_fullshadows
             #pragma multi_compile_fog
             // Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
             //#pragma multi_compile _ LOD_FADE_CROSSFADE
 
             #pragma vertex vertAdd
             #pragma fragment fragAdd
             #include "UnityStandardCoreForward.cginc"
 
             ENDCG
         }
         // ------------------------------------------------------------------
         //  Shadow rendering pass
         Pass {
             Name "ShadowCaster"
             Tags { "LightMode" = "ShadowCaster" }
 
             ZWrite On ZTest LEqual
 
             CGPROGRAM
             #pragma target 3.0
 
             // -------------------------------------
 
 
             #pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
             #pragma shader_feature_local _SPECGLOSSMAP
             #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
             #pragma shader_feature_local _PARALLAXMAP
             #pragma multi_compile_shadowcaster
             #pragma multi_compile_instancing
             // Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
             //#pragma multi_compile _ LOD_FADE_CROSSFADE
 
             #pragma vertex vertShadowCaster
             #pragma fragment fragShadowCaster
 
             #include "UnityStandardShadow.cginc"
 
             ENDCG
         }
         // ------------------------------------------------------------------
         //  Deferred pass
         Pass
         {
             Name "DEFERRED"
             Tags { "LightMode" = "Deferred" }
 
             CGPROGRAM
             #pragma target 3.0
             #pragma exclude_renderers nomrt
 
 
             // -------------------------------------
 
             #pragma shader_feature_local _NORMALMAP
             #pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
             #pragma shader_feature _EMISSION
             #pragma shader_feature_local _SPECGLOSSMAP
             #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
             #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF
             #pragma shader_feature_local _DETAIL_MULX2
             #pragma shader_feature_local _PARALLAXMAP
 
             #pragma multi_compile_prepassfinal
             #pragma multi_compile_instancing
             // Uncomment the following line to enable dithering LOD crossfade. Note: there are more in the file to uncomment for other passes.
             //#pragma multi_compile _ LOD_FADE_CROSSFADE
 
             #pragma vertex vertDeferred
             #pragma fragment fragDeferred
 
             #include "UnityStandardCore.cginc"
 
             ENDCG
         }
 
         // ------------------------------------------------------------------
         // Extracts information for lightmapping, GI (emission, albedo, ...)
         // This pass it not used during regular rendering.
         Pass
         {
             Name "META"
             Tags { "LightMode"="Meta" }
 
             Cull Off
 
             CGPROGRAM
             #pragma vertex vert_meta
             #pragma fragment frag_meta
 
             #pragma shader_feature _EMISSION
             #pragma shader_feature_local _SPECGLOSSMAP
             #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
             #pragma shader_feature_local _DETAIL_MULX2
             #pragma shader_feature EDITOR_VISUALIZATION
 
             #include "UnityStandardMeta.cginc"
             ENDCG
         }
     }
 
     SubShader
     {
         Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
         LOD 150
 
         // ------------------------------------------------------------------
         //  Base forward pass (directional light, emission, lightmaps, ...)
         Pass
         {
             Name "FORWARD"
             Tags { "LightMode" = "ForwardBase" }
 
             Blend [_SrcBlend] [_DstBlend]
             ZWrite [_ZWrite]
 
             CGPROGRAM
             #pragma target 2.0
 
             #pragma shader_feature_local _NORMALMAP
             #pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
             #pragma shader_feature _EMISSION
             #pragma shader_feature_local _SPECGLOSSMAP
             #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
             #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF
             #pragma shader_feature_local _GLOSSYREFLECTIONS_OFF
             #pragma shader_feature_local _DETAIL_MULX2
             // SM2.0: NOT SUPPORTED shader_feature_local _PARALLAXMAP
 
             #pragma skip_variants SHADOWS_SOFT DYNAMICLIGHTMAP_ON DIRLIGHTMAP_COMBINED
 
             #pragma multi_compile_fwdbase
             #pragma multi_compile_fog
 
             #pragma vertex vertBase
             #pragma fragment fragBase
             #include "UnityStandardCoreForward.cginc"
 
             ENDCG
         }
         // ------------------------------------------------------------------
         //  Additive forward pass (one light per pass)
         Pass
         {
             Name "FORWARD_DELTA"
             Tags { "LightMode" = "ForwardAdd" }
             Blend [_SrcBlend] One
             Fog { Color (0,0,0,0) } // in additive pass fog should be black
             ZWrite Off
             ZTest LEqual
 
             CGPROGRAM
             #pragma target 2.0
 
             #pragma shader_feature_local _NORMALMAP
             #pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
             #pragma shader_feature_local _SPECGLOSSMAP
             #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
             #pragma shader_feature_local _SPECULARHIGHLIGHTS_OFF
             #pragma shader_feature_local _DETAIL_MULX2
             // SM2.0: NOT SUPPORTED shader_feature_local _PARALLAXMAP
             #pragma skip_variants SHADOWS_SOFT
 
             #pragma multi_compile_fwdadd_fullshadows
             #pragma multi_compile_fog
 
             #pragma vertex vertAdd
             #pragma fragment fragAdd
             #include "UnityStandardCoreForward.cginc"
 
             ENDCG
         }
         // ------------------------------------------------------------------
         //  Shadow rendering pass
         Pass {
             Name "ShadowCaster"
             Tags { "LightMode" = "ShadowCaster" }
 
             ZWrite On ZTest LEqual
 
             CGPROGRAM
             #pragma target 2.0
 
             #pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
             #pragma shader_feature_local _SPECGLOSSMAP
             #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
             #pragma skip_variants SHADOWS_SOFT
             #pragma multi_compile_shadowcaster
 
             #pragma vertex vertShadowCaster
             #pragma fragment fragShadowCaster
 
             #include "UnityStandardShadow.cginc"
 
             ENDCG
         }
         // ------------------------------------------------------------------
         // Extracts information for lightmapping, GI (emission, albedo, ...)
         // This pass it not used during regular rendering.
         Pass
         {
             Name "META"
             Tags { "LightMode"="Meta" }
 
             Cull Off
 
             CGPROGRAM
             #pragma vertex vert_meta
             #pragma fragment frag_meta
 
             #pragma shader_feature _EMISSION
             #pragma shader_feature_local _SPECGLOSSMAP
             #pragma shader_feature_local _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
             #pragma shader_feature_local _DETAIL_MULX2
             #pragma shader_feature EDITOR_VISUALIZATION
 
             #include "UnityStandardMeta.cginc"
             ENDCG
         }
     }
 
     FallBack "VertexLit"
 }

,

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

209 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to affect Shader _Color by the Tint Color of Button (Through Shader) 0 Answers

Is it possible to set the 'ForceNoShadowCasting' SubShader Tag via shader properties or a custom material editor? 1 Answer

Outline Shader in VR 0 Answers

Custom shader - x-ray + shadows + double sided 1 Answer

Shader Graph Editor fails to open shaders 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges