Unity Universal Render Pipeline support

March 9th, 2020

Animated Universal Render 2D Demo

We are happy to announce support for Unity 2019.3's Universal Render Pipeline and its 2D Renderer feature set in our spine-unity runtime!

The Universal Render Pipeline (URP) is a prebuilt Scriptable Render Pipeline (SRP) optimized for delivering high graphics performance and is the successor of the Lightweight Render Pipeline (LWRP). It scales seamlessly from mobile platforms to high-end PCs and consoles. It adds a new 2D Renderer workflow, providing a flexible 2D lighting system designed specifically for 2D games.

There is now an additional Unity Package Manager (UPM) package com.esotericsoftware.spine.urp-shaders available for download which extends the spine-unity runtime by adding URP support.

Why a separate package

Unity has moved many of their optional modules to the new Unity Package Manager (UPM) ecosystem. Their URP base shader files are also provided as a UPM package under the name Universal RP and not part of every new Unity project out of the box.

Including our URP Spine shaders in the spine-unity runtime would lead to confusing error messages and additional configuration steps in case Unity's Universal RP package has not been installed in a project. By providing our URP Spine shaders as a UPM package, such dependencies are automatically resolved, making it easier to use this additional functionality.

Going forward, we will provide separate UPM packages for other spine-unity features that depend on Unity's optional packages.

Installation

You can download the UPM package via the download page or find it in the spine-unity/Modules subdirectory in the Git repository. Please follow the guidelines on Installing Extension UPM Packages on our spine-unity documentation pages on how to install the package.

URP examples

URP shader selection

The package contains two example scenes similar to the animated GIFs above at com.esotericsoftware.spine.urp-shaders-3.8/Examples/2D/URP 2D Shaders.unity and com.esotericsoftware.spine.urp-shaders-3.8/Examples/3D/URP 3D Shaders.unity for you to check out. These demonstrate how to use the URP shaders in the respective 2D and 3D renderer setup. Note that the scenes react to changing the settings of your current UniversalRenderPipelineAsset, set under Project Settings - Graphics.

Usage

The standard Spine shaders in the spine-unity runtime Spine/Skeleton Lit, Spine/Sprite/Vertex Lit and Pixel Lit are not compatible with the universal render pipeline. Instead, the Spine Universal RP Shaders package provides shaders specifically built for the universal render pipeline, including 2D Renderer support:

  1. Universal Render Pipeline/2D/Spine/Skeleton Lit

    Universal 2D Renderer variant of the Spine/Skeleton Lit shader.

  2. Universal Render Pipeline/2D/Spine/Sprite

    Universal 2D Renderer variant of the Spine/Sprite/Vertex Lit and Pixel Lit shaders.

  3. Universal Render Pipeline/Spine/Skeleton

    Universal variant of the Spine/Skeleton shader.

  4. Universal Render Pipeline/Spine/Skeleton Lit

    Universal variant of the Spine/Skeleton Lit shader.

  5. Universal Render Pipeline/Spine/Sprite

    Universal variant of the Spine/Sprite/Vertex Lit and Pixel Lit shaders.

The shaders can be assigned to materials as usual via the Shader menu in the material properties:

URP shader selection

The universal render pipeline shaders will respect your settings of the assigned UniversalRenderPipelineAsset under Project Settings - Graphics. The following GIF shows how the characters in the scene are affected by changing these settings:

Project settings - URP asset

URP asset settings live update

Restrictions

Like all other Spine shaders, the LWRP shaders do not support Premultiply alpha (PMA) atlas textures when using the Linear color space. If you are using the Linear color space, please export your atlas textures as straight alpha textures by disabling the Premultiply alpha setting. See these instructions for straight alpha export and import settings for more information.

If you are unsure you can check the currently active color space via Edit > Project Settings > Player > Other Settings > Color Space.

Player Settings - Gamma

We hope that these additions to the spine-unity runtime let you create even more impressive games and apps for both high- and low-end devices. Share your thoughts on the forum.