• RuntimesUnity
  • how to make Spine/RenderQuad Receive Shadows?

Hello, I was using Spine/RenderQuad to make my spine gameobject fading correctly. but the shader from unity example package dose not Receive Shadows. how to make this shader can Receive Shadows?

Related Discussions
...

The Spine/RenderQuad shader is designed to be unaffected by lighting, as it is intended to display the render texture of a skeleton that has already been lit. To make a shader like Spine/RenderQuad receive shadows, you would need to modify it to include lighting calculations and shadow receiving logic. This typically involves enabling depth writing and ensuring the shader samples lighting data per-pixel. You might consider using or modifying a shader like Spine/Sprite/Pixel Lit, which is designed to receive shadows, and adapt it to your needs for fading effects.

  • bigasa ответили на это сообщение.

    Spinebot thanks for response, I was using URP render pipline "Universal Render Pipeline/Spine/Skeleton Lit" to render spine gameobject. this shader can Receive Shadows if Spine/RenderQuad is to display the render texture of a skeleton that has already been lit.why it lost the shadow information.

    @bigasa Unfortunately the used CommandBuffer.DrawMesh call in the SkeletonRenderTexture example component does not automatically respect all lights and lighting features, and also provides no explicit way to specify which to include in the processing. If anyone knows a clean solution for this, we would be happy to integrate it in the example component.

    As workarounds you could use either an unlit shader first to render to the render texture, and then at the RenderQuad use a lit shader which receives shadows.

    Alternatively, instead of using the SkeletonRenderTexture example component, you could manually setup a Camera to render to a RenderTexture instead of letting the SkeletonRenderTexture component do the rendering.

    Sorry to say that there is no perfect solution available at the moment.