With the release of 2019.3 the 2D Renderer is now available in Universal Render Pipeline.
The 2D Renderer includes:
2D Lights
Lit and Unlit Sprite Masternode in Shader Graph
Pixel Perfect Camera component
As a reminder: This will be the new home for Pixel Perfect Camera. The standalone package will still receive bug fixes, but new features will only be added here.
This is the same component with the same workflow as the one in the Pixel Perfect package. The main change is that Pixel Perfect is now compatible with the 2D Renderer in Universal Render Pipeline.
Normal map support for all the other 2D renderers:
Create a new Pipeline Asset by right clicking in the assets view of the project window, and selecting: Create > Rendering > Universal Render Pipeline > Pipeline Asset (Forward Renderer)
Create a new 2D Renderer by right clicking in the assets view of the project window, and selecting: Create > Rendering > Universal Render Pipeline > 2D Renderer
3. Select the created Pipeline Asset then assign the created 2D Renderer to the first item under General → Renderer List
4. In the graphics settings set your Scriptable Render Pipeline Settings to use the created Pipeline Asset
The 2D Renderer should now be configured.
Documentation
Click on the View Documentation link in the Package Manager.
Upgrading
If you are installing the package into a Project with pre-existing Prefabs, materials or Scenes, you will need to upgrade any materials used to a lighting compatible Shader. The following functions allow you to do so. Do note that this is a one way process and cannot be reverted.
Upgrading a Scene
To upgrade the currently opened Scene, go to: Edit > Render Pipeline > Universal Render Pipeline > 2D Renderer > Upgrade Scene To 2D Renderer
Upgrading a Project
To upgrade all Prefabs and materials in your Project, go to: Edit > Render Pipeline > Universal Render Pipeline > 2D Renderer > Upgrade Project To 2D Renderer
Improvements
Here are more details on improvements we’ve made to the 2D Renderer in Universal Render Pipeline 7.2.0
Added Transparency Sort Mode and Transparency Sort Axis (as seen in the built-in render pipeline)
Set default material to use when creating new Sprites. This is useful when you have a custom Sprite shader that you want to apply to all new Sprites in your project.
Blend Styles in the 2D Renderer Data are now automatically enabled/disabled, depending on whether there are 2D Lights that actually use them.
Using the 2D Renderer without lights (e.g.: to use Shader Graph) is now faster than it was. We now recognise that no 2D Lights are present and thus we can render with a faster rendering path.
Please share your experience with the tools by replying to this post or creating a new one. How does this feature help you achieve your desired outcomes? What works as expected? And what doesn’t? We’re excited to hear back from you!
If you’d like to see examples of 2D Lights, Pixel Perfect Camera, Post-Processing, Shader Graph and 2D Shadows, download or clone the 2D Renderer samples from:
I want to highlight a need to cull light better, since it is not being done well and when I generate a larger scene with lights it still goes through all of the lights in the scene that should be frustrum culled or distance culled at the very least. Can take 8ms in a not too big scene. We do our own culling now on everything but it would be nice if it was not needed for the lights.
Also want to mention that there are some iffyness when you want to use meshes and bones that are rotated quirky, the normal map stuff uses the rotation a bit weird since it uses the same functions for 3D normal code. I will see if I can get time to share this at some point.
Would like to take the time and show that we are using it for Source of Madness
Here is a small visual tease.
We use the shape light to highlight the entrance to the shop for example, I also made a special light type for the global light that adds and acts as a sort of ambient fog.
Also we at Carry Castle will be at GDC to speak at the machine learning talk o/
We’ll take a step back and re-evaluate the current 2D shadow workflow, because we think there are some improvements we can make. This means it will take some time before we add any new features related to shadows.
Is it possible to have more than one 2D Renderer Camera in the scene for doing funky blitting stuff? It seems that camera stacking isn’t supported (will it do so any time soon?) and trying to grab rendertextures from more than one camera isn’t allowed at the moment?
It is not anything fancy, we spawn a lot of prefab/rooms in a big grid, and now we distance cull grid cells based on openings. However we only need to do that because the lights take too long to render when there exist a lot of them in the active scene even if you are not remotely close to them. I think it got to do with how you do the global light but I need to take a look at it again. Preferably it would be nice with some inbuilt culling for the 2D lights like there are for most featuers and other light types.
The normal map texture you create is affected by rotations that a 2D renderer should not care about so our 2d rendered meshes gets weird artifacts since it is very difficult to import completly clean armature setups into unity. I need to find my documentated images to explain this properly, but in essence we do not get even light distribution on our “2D meshes” because things are rotated and that affects the image you create for the light directions.
The big issue with the normal is when we stack our objects infront of each other and they get vastly different lighting result because of their different transform matrices.
I’m getting a lot of inconsistent behavior when trying to add any of the experimental 2D lights to the hierarchy. Sometimes it adds a light, sometimes it doesn’t. There are no errors in the console when it doesn’t.
Makes me believe there are some rules or conditions that need to be met that are unclear and uncommunicated.
Using 2019.3.2f1 with URP package 7.2.1
Likewise, when I do get a PointLight added to the hierarchy, adding the Light 2D script gives me a warning which I do not agree with since I’m using the 2D renderer data with URP and everything is assigned in the inspector
Nuking the default assetPipelines that come with the template seems to clean up the situation. So I’m guessing there’s some references that are not being reset when starting a fresh project from a template
@Livealot , I didn’t read your previous comment at first, but it solved my problem too! thanks!
Is deleting those files something we want to do, though?
I looked into this today. Because the Universal RP template assigns its assets in the Quality settings it does not respect the asset in the graphics settings.
Until we have a template with the 2D renderer I would suggest you use the 2D template instead of the Universal RP template.
However, if the Universal RP template is your starting point, then I would suggest assigning the 2D Renderer asset to the UniversalRP-HighQuality, UniversalRP-MediumQuality, and UniversalRP-LowQuality assets.
Or you can assign the new asset in the quality settings.