Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Shader error in 'Shader Graphs/GrassShader': invalid subscript 'shadowCoord' at

$
0
0
Hello, IDK how to fix this, but i know: 1. my URP(10.8.1) 2. this happen when i try to set material type to unlit 3. and i have a code sample, and i know that this happen at 114 str, see below #if (SHADERPASS == SHADERPASS_SHADOWCASTER) float3 _LightDirection; #endif Varyings BuildVaryings(Attributes input) { Varyings output = (Varyings)0; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); #if defined(FEATURES_GRAPH_VERTEX) // Evaluate Vertex Graph VertexDescriptionInputs vertexDescriptionInputs = BuildVertexDescriptionInputs(input); VertexDescription vertexDescription = VertexDescriptionFunction(vertexDescriptionInputs); // Assign modified vertex attributes input.positionOS = vertexDescription.Position; #if defined(VARYINGS_NEED_NORMAL_WS) input.normalOS = vertexDescription.Normal; #endif //FEATURES_GRAPH_NORMAL #if defined(VARYINGS_NEED_TANGENT_WS) input.tangentOS.xyz = vertexDescription.Tangent.xyz; #endif //FEATURES GRAPH TANGENT #endif //FEATURES_GRAPH_VERTEX // TODO: Avoid path via VertexPositionInputs (Universal) VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz); // Returns the camera relative position (if enabled) float3 positionWS = TransformObjectToWorld(input.positionOS); #ifdef ATTRIBUTES_NEED_NORMAL float3 normalWS = TransformObjectToWorldNormal(input.normalOS); #else // Required to compile ApplyVertexModification that doesn't use normal. float3 normalWS = float3(0.0, 0.0, 0.0); #endif #ifdef ATTRIBUTES_NEED_TANGENT float4 tangentWS = float4(TransformObjectToWorldDir(input.tangentOS.xyz), input.tangentOS.w); #endif // TODO: Change to inline ifdef // Do vertex modification in camera relative space (if enabled) #if defined(HAVE_VERTEX_MODIFICATION) ApplyVertexModification(input, normalWS, positionWS, _TimeParameters.xyz); #endif #ifdef VARYINGS_NEED_POSITION_WS output.positionWS = positionWS; #endif #ifdef VARYINGS_NEED_NORMAL_WS output.normalWS = normalWS; // normalized in TransformObjectToWorldNormal() #endif #ifdef VARYINGS_NEED_TANGENT_WS output.tangentWS = tangentWS; // normalized in TransformObjectToWorldDir() #endif #if (SHADERPASS == SHADERPASS_SHADOWCASTER) // Define shadow pass specific clip position for Universal output.positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, _LightDirection)); #if UNITY_REVERSED_Z output.positionCS.z = min(output.positionCS.z, output.positionCS.w * UNITY_NEAR_CLIP_VALUE); #else output.positionCS.z = max(output.positionCS.z, output.positionCS.w * UNITY_NEAR_CLIP_VALUE); #endif #elif (SHADERPASS == SHADERPASS_META) output.positionCS = MetaVertexPosition(float4(input.positionOS, 0), input.uv1, input.uv2, unity_LightmapST, unity_DynamicLightmapST); #else output.positionCS = TransformWorldToHClip(positionWS); #endif #if defined(VARYINGS_NEED_TEXCOORD0) || defined(VARYINGS_DS_NEED_TEXCOORD0) output.texCoord0 = input.uv0; #endif #if defined(VARYINGS_NEED_TEXCOORD1) || defined(VARYINGS_DS_NEED_TEXCOORD1) output.texCoord1 = input.uv1; #endif #if defined(VARYINGS_NEED_TEXCOORD2) || defined(VARYINGS_DS_NEED_TEXCOORD2) output.texCoord2 = input.uv2; #endif #if defined(VARYINGS_NEED_TEXCOORD3) || defined(VARYINGS_DS_NEED_TEXCOORD3) output.texCoord3 = input.uv3; #endif #if defined(VARYINGS_NEED_COLOR) || defined(VARYINGS_DS_NEED_COLOR) output.color = input.color; #endif #ifdef VARYINGS_NEED_VIEWDIRECTION_WS output.viewDirectionWS = GetWorldSpaceViewDir(positionWS); #endif #ifdef VARYINGS_NEED_SCREENPOSITION output.screenPosition = ComputeScreenPos(output.positionCS, _ProjectionParams.x); #endif #if (SHADERPASS == SHADERPASS_FORWARD) || (SHADERPASS == SHADERPASS_GBUFFER) OUTPUT_LIGHTMAP_UV(input.uv1, unity_LightmapST, output.lightmapUV); OUTPUT_SH(normalWS, output.sh); #endif #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT half3 vertexLight = VertexLighting(positionWS, normalWS); half fogFactor = ComputeFogFactor(output.positionCS.z); output.fogFactorAndVertexLight = half4(fogFactor, vertexLight); #endif #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) output.shadowCoord = GetShadowCoord(vertexInput); #endif return output; } Full text of error: Shader error in 'Shader Graphs/GrassShader': invalid subscript 'shadowCoord' at /Users/Rim/Desktop/LeGro/UnityProjects/LabHero3D/Library/PackageCache/com.unity.render-pipelines.universal@10.8.1/Editor/ShaderGraph/Includes/Varyings.hlsl(114) (on d3d11) Compiling Vertex program with _MAIN_LIGHT_SHADOWS Platform defines: SHADER_API_DESKTOP UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_FULL_HDR UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS Disabled keywords: DIRLIGHTMAP_COMBINED DOTS_INSTANCING_ON FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADER_API_GLES30 SHADOWS_SHADOWMASK UNITY_ASTC_NORMALMAP_ENCODING UNITY_COLORSPACE_GAMMA UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_FULL_STANDARD_SHADER UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHTS_VERTEX _MAIN_LIGHT_SHADOWS_CASCADE _SAMPLE_GI

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>