Unity 2022.3.35
Spine 4.2

GraphicsSettings.asset
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}

  • Düzenlendi

To address the issue of Depth of Field (DoF) not working correctly with Spine assets in Unity's Universal Render Pipeline (URP), you can try the following steps:

  1. Shader Modification: Ensure that the Spine shaders are writing to the depth buffer. Most Spine shaders do not write to the depth buffer by default to allow for better alpha blending. You can modify the shader to include ZWrite On and AlphaTest tags. This will help the DoF effect to correctly interpret the depth of the Spine assets.

  2. Render Queue Adjustment: Modify the render queue of the Spine shaders. By default, the render queue might be set to AlphaTest (2450). You can change it to a higher value, such as 3000, to ensure it is rendered after opaque objects. This can be done by editing the shader or through the material settings in Unity.

  3. Transparency Sort Mode: Ensure that the transparency sort mode is set correctly. From your GraphicsSettings.asset, it looks like you have set m_TransparencySortMode: 0 and m_TransparencySortAxis: {x: 0, y: 0, z: 1}, which is correct for sorting by depth.

  4. Post-Processing Order: Adjust the order of the DoF effect in the render queue. You might need to apply the DoF effect after transparent objects instead of after opaque objects. This can be done by modifying the post-processing settings or using a different DoF implementation that supports this.

  5. URP Asset Settings: Ensure that the URP asset settings are configured correctly. Sometimes, switching to a different URP asset (like the example URP asset included in the Spine URP Shaders UPM package) can resolve issues with post-processing effects.

Here are some useful links and references from the context:

By following these steps, you should be able to get the Depth of Field effect working correctly with your Spine assets in Unity's URP.

spine-unity Runtime 4.2.76
Unity 2019.3-2023.1: spine.urp-shaders 4.2 (2024-05-23)
Using the above steps did not solve,



    Thora spine-unity Runtime 4.2.76
    Unity 2019.3-2023.1: spine.urp-shaders 4.2 (2024-05-23)
    Using the above steps did not solve,

    This image shows that there is no alpha-testing (alpha-cutoff) in action in the above screenshot, while the depth is properly written to the Z-buffer.

    We have just pushed a commit to the 4.2 branch. Universal Render Pipeline/Spine/Skeleton shader now performs proper alpha-testing when Depth Write is enabled, using the existing Shadow alpha cutoff parameter.

    A new Spine URP Shaders UPM package is available for download here as usual:
    https://esotericsoftware.com/spine-unity-download

    Thank you. Solved the problem.

    Glad to hear, thanks for getting back to us.