Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shader error in urp: invalid subscript 'shadowCoord' #44

Closed
Personuo opened this issue Apr 21, 2020 · 3 comments
Closed

shader error in urp: invalid subscript 'shadowCoord' #44

Personuo opened this issue Apr 21, 2020 · 3 comments
Labels

Comments

@Personuo
Copy link

Personuo commented Apr 21, 2020

2020-05-12
☑ QA if the shader error is fixed.

Now, the shader is compatible with SRP 7.1.7, 7.3.1, 8.0.1, 9.0.0preview.

@kaku1923
Copy link

@cn914287516
I encountered the same error when I upgrade to URP 7.3.1,
and the error appears when I enable the shadow cascades.

I also found that there are two ways to fix it.

  1. Downgrade to URP 7.1.8
  2. In UniversalToonBody.hlsl
    line 558:
-#  ifdef _MAIN_LIGHT_SHADOWS
+#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)

line 562:

-#  ifdef _ADDITIONAL_LIGHTS
+#if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)

line 997:

-#  ifdef _MAIN_LIGHT_SHADOWS
+#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)

line 1001:

-#  ifdef _ADDITIONAL_LIGHTS
+#if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)

@Personuo
Copy link
Author

@cn914287516
I encountered the same error when I upgrade to URP 7.3.1,
and the error appears when I enable the shadow cascades.

I also found that there are two ways to fix it.

  1. Downgrade to URP 7.1.8
  2. In UniversalToonBody.hlsl
    line 558:
-#  ifdef _MAIN_LIGHT_SHADOWS
+#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)

line 562:

-#  ifdef _ADDITIONAL_LIGHTS
+#if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)

line 997:

-#  ifdef _MAIN_LIGHT_SHADOWS
+#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)

line 1001:

-#  ifdef _ADDITIONAL_LIGHTS
+#if defined(REQUIRES_WORLD_SPACE_POS_INTERPOLATOR)

Thank you for help! I try this and success!
But I use toony shader for my project now.

yuki4080 pushed a commit to yuki4080/com.unity.toonshader that referenced this issue Dec 22, 2022
* On the way to fix steps.

* Checking EvaluateBSDF_Punctual() [skip ci]

* fixed adding #define LIGHTLOOP_DISABLE_TILE_AND_CLUSTER in HDRP Shaders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants