Unity Playworks Plugin Real Time Shadows
Unity Playworks Plugin now supports Realtime Shadows!
The Playworks Plugin team have been working on implementing Real Time Shadows (RTS) to improve the visual experience and usability of playable builds generated with the Playworks Plugin for Unity.
Several games in the industry rely on RTS to improve the visual performance of their experiences, and our team aims to bring the same level of quality to playables.
On this page you can find out what features of Unity's Real Time Shadows Unity Playworks Plugin currently supports.
Feature details
Here are some examples of how Unity Playworks Plugin RTS can enhance your creative process.
Day and Night
- No shadows
- With shadows
Tanks!
- Angle 1
- Angle 2
Viking Village
- Angle 1
- Angle 2
- Angle 3
Supported Features and Known Issues
The current RTS solution supports the following features:
- One light source per scene.
- Shadows from
Directional Light
are supported.Point
andSpot
lights are not supported yet.
Stable Fit
shadow projection is supported.Hard
andSoft
shadows are supported.- Shadows are working only with the Built-in Rendering Pipeline.
- Shadows are working in all Unity versions supported by Luna.
- plugin RTS works with custom shadow-casting shader passes.
- The shader pass should have LightMode set to
ShadowCaster
.
- The shader pass should have LightMode set to
Supported settings
Lights
Setting | Supported | Details |
---|---|---|
Directional Light | Yes | |
Point Light | No | |
Spot Light | No | |
Multiple light sources | No | Only one light source is currently supported. |
Shadow Settings in Quality Settings
Shadow Types
Setting | Supported | Details |
---|---|---|
No shadows | Yes | |
Hard and Soft shadows | Yes |
Shadowmask Mode
Setting | Supported | Details |
---|---|---|
Shadowmask | Yes | Only Shadowmask mode is currently supported. |
Distance Shadowmask | No |
Shadow Resolution
Setting | Supported | Details |
---|---|---|
Low (512x512 px) | Yes | |
Medium (1024x1024 px) | Yes | |
High (2048x2048 px) | Yes | |
Very High (4096x4096 px) | Yes | Very High shadow resolution could not be supported on some devices due to the texture size used. |
Shadow Projection
Setting | Supported | Details |
---|---|---|
Close Fit | No | |
Stable Fit | Yes | Only Stable Fit projection is currently supported. |
Shadow Distance
Setting | Supported |
---|---|
Shadow Distance | Yes |
Shadow Near Plane Offset
Setting | Supported | Details |
---|---|---|
Near Plane | No | Both global Near Plane setting (in Quality Settings ) and individual Near Plane setting (in the Light component) are currently not supported. |
Shadow Cascades
Setting | Supported |
---|---|
No Cascades | Yes |
2 Cascades | Yes |
4 Cascades | Yes |
Cascades Split | Yes |
Shadow Settings in Light Component
Setting | Supported | Details |
---|---|---|
No shadows | Yes | |
Hard shadows | Yes | |
Soft shadows | Yes | |
Strength | Yes | |
Resolution | Yes | |
Bias | Yes | |
Normal Bias | Yes | |
Near Plane | No | Both global Near Plane setting (in Quality Settings ) and individual Near Plane setting (in the Light component) are currently not supported. |
Shadow Settings in Unity Playworks Plugin Window
Setting | Supported | Details |
---|---|---|
Realtime Shadows | Yes | This setting is used to rapidly disable shadows for the whole project without editing existing shadow settings in Light components and Quality Settings . |
Shadow Settings in Mesh Renderer
Setting | Supported |
---|---|
Cast Shadow | Yes |
Receive Shadows | Yes |
Unity versions support
All Unity versions supported by Unity Playworks Plugin are compatible with Realtime Shadows.
User Guide
Follow these step to implement Shadows in any of your projects:
- Open your Unity project and import the Unity Playworks Plugin.
- Create or open a scene.
- Add a
Directional Light
to the scene:- Ensure that Shadows Casting is enabled in the Light component.
- Select
Hard Shadows
orSoft Shadows
option inShadow Type
property.
- Add an a shadow casters (e.g. cube) to the scene:
- Ensure that
Cast Shadows
option is enabled in the Mesh Renderer component. - Ensure that
Receive Shadows
option is enabled in the Mesh Renderer component.
- Ensure that
- Open the projects Quality Settings (Edit → Project Settings → Quality)
- Select
Shadowmask
option inShadowmask Mode
field. - Select
Hard
orHard and Soft shadows
mode inShadows
field. - Select any option in
Shadow Resolution
. - Select
Stable Fit
option inShadow Projection
field. - Select the desired
Shadow Distance
. - Select any option in
Shadow Cascades
field (it is best to try theNo cascades
option first since it has the least impact on performance). - Select desirable
Cascade split
if youve selected at least 2 cascades.
- Select
- Play with the shadow settings until you the wanted result.
- Open the Unity Playworks Plugin window and enable shadows:
- Check the
Realtime Shadows
option in Settings → Advanced → Realtime Shadows (see screenshot).
- Check the
- Export Unity Playworks Plugin project and inspect the results.
Limitations and Performance Characteristics
A project with shadows enabled will perform slower than one without. Thats because each shadow-casting object that affects the final shadow image is rendered at least twice: once for shadow casting, and once for regular rendering. The number of draw-calls per caster is depending on the shadow settings (e.g. cascades count) and the number of passes for the regular mesh rendering.
Recommendations to lower hit on performance:
- Reduce the number of shadowcasters (shadows that are visible to the camera)
- Reduce the amount of cascades used (ideally
No cascades
). - Use a smaller shadow distance.
- Lower the resolution of the shadows.
- Use only
Hard
shadows.
Shadows may negatively impact performance on some devices, or they may not work at all. This could be related to the device specific limitations (e.g. GPU memory). In order to resolve this issue, try lowering the shadow settings, and ensure that Unity's WebGL1 build on the device is able to render shadows.
Universal Render Pipeline Shadows
Universal Render Pipeline (URP) shadows are not currently supported.