• RuntimesUnity
  • Pinkish RenderTexture from SkeletonRenderTexture with URP and Ortho Camera

Using the RenderTexture FadeOut Transparency scene as example on URP with a forward renderer, when the Camera projection is set to Orthographic, and the material shader is set to Universal Render Pipeline/Spine/Skeleton, the resulting texture produced by the SkeletonRenderTexture component has a pink tint on it.

By default, the sample scene uses Perspective projection, and the Spine/Skeleton shader.

Issue is present in both 4.1 and 4.2 runtimes. Any idea what's causing this?

  • Misaki ha risposto a questo messaggio
    Related Discussions
    ...

    When encountering a pink tint on materials in Unity, especially when using the Universal Render Pipeline (URP), it typically indicates a shader compatibility issue or a shader compilation error. Given that the issue persists across both 4.1 and 4.2 runtimes and specifically arises when using an Orthographic camera with the Universal Render Pipeline/Spine/Skeleton shader, it suggests that the shader may not be fully compatible with the Orthographic projection in the context of rendering to a RenderTexture.

    To address shader compatibility issues with URP, especially when dealing with specific rendering features like Orthographic projection or RenderTexture outputs, it's crucial to ensure that the shaders are correctly set up for URP and that they support the intended rendering path (e.g., Forward Renderer). The Spine URP shaders are designed to work with the URP setup, but certain configurations or specific uses like rendering to a RenderTexture with an Orthographic camera might require additional considerations or adjustments.

    Since the provided contexts do not directly address the issue of pink tint in RenderTexture outputs with Orthographic projection using URP, the best approach would be to verify that the shader is up to date and fully compatible with URP's requirements for rendering to textures. Additionally, checking for any known issues or updates related to shader compatibility with Orthographic projection in the Spine-Unity runtime documentation or the Spine URP shader package might provide further insights or solutions.

    abgtan I was able to reproduce the state you described. My guess is that the Spine Examples/Scripts/Sample Components/SkeletonRenderTexture/RenderQuadShader shader used by RenderQuadMaterial in the same folder is not URP compatible. Unfortunately, I am not familiar with shaders and am not sure of the solution for this, and Harald, our Unity expert, is off this week and will be back next week, so I would appreciate it if you could wait until then for a more detailed answer.

    • abgtan ha risposto a questo messaggio

      Misaki Thank you. It does seem like it's already pink at the point where the mesh is rendered unto the RenderTexture, so I'm not sure if it's the RenderQuadShader. Will check further on my end while I wait for Harald.

      I found the root cause here. Line 190 of SkeletonRenderTexture.cs.

      When using shaderPass -1 and it renders all shader passes, the depth only pass renders the pink tint on top of the forward pass.

      When I set shaderPass to 0, then it renders properly with the URP shader. If I set to 2, then it only renders the pink tint.

      5 giorni dopo

      @abgtan Thanks for reporting and sorry for the troubles! We have added a Shader Passes array property at the SkeletonRenderTexture example components, via this commit on the 4.2 branch. By default the array contains one entry set to -1 to keep the existing behaviour and render all passes. You can set the first element to 0 to only render the first pass.

      A new spine-unity 4.2 unitypackage is available for download here as usual:
      https://esotericsoftware.com/spine-unity-download

      Thank you Harald!

      No problem, thanks again for reporting.