How do you efficiently work with CastShadow?

The (semi) recent addition of dynamic shadows makes it easier to create beautiful worlds, but dynamic shadows can also reduce performance by a lot on older devices. Fortunately there is the CastShadow property that allows us to turn off shadows in areas where they are not needed. However, in practice I rarely ever turn off CastShadow on my BaseParts, for two reasons:

  • I find it difficult to judge which objects should have CastShadow turned on, and which objects should have it turned off.
  • My builds usually exist out of thousands of parts, so going through all of them is a ton of work with seemingly little pay off.

My question for you all is, what are some strategies, work flows or things to consider that will allow me to work with the CastShadow property in a more efficient manner? Are there ways of quickly finding out where I can safely keep shadows turned off? Are there places where I can keep shadows turned on with no impact whatsoever? Any suggestions are welcome!

3 Likes

CastShadow is always the root of my biggest problems, so I typically have builders I work with disable all CastShadows and enable very few as they work. The performance gains from this have been quite outstanding, as maps that would crash with ShadowMap or Future no longer crash and run at a solid 60fps on most devices.

We have a plugin that will disable any newly created part & we recommend our builders to use studios alt + select to select the specific part within a model to enable the shadows on as they deem fit. This solution has worked fairly well on new projects but I gave up trying to work with this on older stuff.

Though, if you weren’t using ShadowMap or Future, you are fine to leave CastShadow enabled for all parts since this becomes a micro-optimization for expensive shadow rendering. Voxel is a great solution (and it’s also the fallback for mobile devices - they can’t run ShadowMap or Future!) to this problem, as it keeps performance at a relatively good standing.

6 Likes

It’s been a while, but about a year ago shadowmapping had horrid performance in Zombie Strike. We turned CastShadow off on everything, and just turned it on wherever it looked pretty. I think we just turned on Voxel at some point, like Mullets said.

1 Like