[Released] Corgi Cached Shadows (for URP!) - 'bake' your real-time shadows for mobile games!

Cached shadows allow for almost-real-time shadow casting on mobile hardware! Note: This plugin only supports URP!

~Documentation~
~Asset Store~
~Discord~

8921021--1222082--upload_2023-4-1_16-29-23.png

This simple plugin gives your game the ability to have semi-real-time shadows casting in your mobile game. (URP 11+)

Features:

  • Simple to setup and easy to use. Slot in the RenderFeature and hit play and you’ll immediately see results.
  • Fast by default with easy to use quality options.
  • Works with VR and even with Single Pass Instanced (SPI) rendering.
  • Includes a simple blob shadow implementation, for dynamic objects.
  • Includes full source code!
  • Works on all platforms unity supports. If you find an issue on a specific platform, please let me know!
4 Likes

It’s finally live!

1 Like

Pushed a hotfix for Unity 2022.2+ (unity keeps breaking things)

1 Like

Incoming update

Small update:

small update, for clarifying things in the documentation ^

1 Like

Please tell me this works in 2022.3 this would be a game changer for urp

yea, it works with 2021.3 and 2022.3

1 Like

Great tool!
Do you have any performance numbers to share?

What number would you like to see, exactly? It varies heavily based on the shadow casters in your scene. But it’s essentially “CPU cost of drawing shadows” turned into nearly 0 on the frames that don’t update shadows.

Maybe how much performance difference you saw in a test project. Can be fps or difference in ms in the profiler.

I could do that if you’d like - but you should be weary of assets promoting stuff like that. I could very easily tailor a demo scene and make it look like “SAVES 1000 FPS WOAH” but it really means nothing, because it is very much dependent on your actual project.

Try profiling your own project. How much is shadow casting taking up on your CPU? Subtract that, that’s roughly what you’ll get from this plugin. If that’s every frame or not is up to you and how you design your game. Some games can “bake once” and be done, some need to update often. It really depends on your project.

1 Like

Hey hello I got this warning in editor non stop:

m_CreateEmptyShadowmap == true
UnityEngine.Debug:LogWarning (object)
CorgiCachedShadows.CachedShadowsRenderPass:PostShadowPassConfigureKeywords (UnityEngine.Rendering.ScriptableRenderContext&,UnityEngine.Rendering.CullingResults&,UnityEngine.Rendering.Universal.LightData&,UnityEngine.Rendering.Universal.ShadowData&) (at Assets/Third Parties/CorgiCachedShadows/Scripts/RenderFeatures/CachedShadowsRenderPass.cs:478)
CorgiCachedShadows.CachedShadowsPostShadowRenderSettingsPass:Execute (UnityEngine.Rendering.ScriptableRenderContext,UnityEngine.Rendering.Universal.RenderingData&) (at Assets/Third Parties/CorgiCachedShadows/Scripts/RenderFeatures/CachedShadowsPostShadowRenderSettingsPass.cs:21)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Any idea why?

Using 2022.3.22f1 URP.

Can you email me or message on discord? I’ll need more info to help you out. Info in the documentation at the bottom.

Pushing an update:

Hello, this asset looks really promising. However, I have some questions before I could use it:

I have large amount of static MeshRenderers in scene (~10000) and only a few movable SkinnedMeshRenderers (~20). Is it possible to render the shadows for static objects only once (and cache them), and then on top of this render shadows for skinned meshes every frame ?

Also, I see you are demonstrating blob shadows for dynamic objects. But, it’s not clear to me is it possible to have normal shadows for dynamic objects aswell ?

2 Likes

The way this plugin currently works, no that would not really be an option. It’s all or nothing with these cached shadows, but blob shadows are a decent alternative, considering the type of platform you’d typically need the performance gains from this plugin.

If you really want both dynamic and static shadows, let me know and I’ll consider it a feature request, it might be possible.

1 Like

but blob shadows are a decent alternative

not in my use-case, I need high-quality shadows for skinned meshes.

considering the type of platform you’d typically need the performance gains from this plugin

why do you think that only mobile platforms need cached shadows ? Rendering shadows can be a performance bottleneck on Desktop aswell. In my use-case, I have a lot of static geometry generated at runtime, so I can’t used baked shadowmaps, only realtime shadows.

btw, Unity has this feature on the roadmap:
https://portal.productboard.com/unity/1-unity-platform-rendering-visual-effects/c/2152-shadow-maps-caching

sadly, it’s in “Under Consideration” since April 2023.

Hello @funkyCoty,

We are having troubles with running your plugin Corgi Cached Shadows on 2023.2.19 Unity because it’s using outdated API. Could you update your plugin to support this engine version or provide updated plugin here?