Clouds + Realistic lighting style causes a huge amount of shadow draws when character is visible

If the local player’s character model is visible on screen in an experience with the Realistic lighting style, and clouds, there will be a massive amount of shadow draw calls per frame.

(Character model visible on screen.)


(Character model not visible on screen, in this case going into first person, scene and depth calls are higher due to different camera angle.)

In this scene I have a semi-complex level, the player character in this scene is not being affected by any local light sources. Disabling CastShadow on the character has no effect, so it is specifically the presence of the character on screen causing shadow draws to spike tremendously.

When I tried this with Soft + Prioritized, there was only 36 draws per frame when the character was on screen, and 0 when not, so long as the camera wasn’t moving. With Realistic LightingStyle, I consistently would see 750-1000 shadow draws (depending on level geometry complexity) per frame when in third person, these draws would go back down to 0 when in first person. Disabling clouds would put the shadow draws down to 36 per frame in third person.

On my computer with this scene, this costs roughly 1.5ms on the CPU and 2ms on the GPU per frame while the character is visible.

System Information:
OS: Windows 10 Home
CPU: I7-7700K
GPU: GTX 1080Ti (11GB)
RAM: 16GB DDR4
Main Display: 2560x1440

Expected behavior

I would expect that the shadow draw counts don’t massively increase while in third person in a scene with clouds and Realistic lighting style.

8 Likes

Thank you for reporting this. Could you please send a repro file with the character model for us to try to repro this internally? Thank you.

1 Like

Hey mobsterlobster, I have done a bit more digging since making this bug report and found that my initial post had an inaccuracy, this happens on both Soft + Prioritized and Realistic lighting styles, and additionally, I’ve noticed that this doesn’t always happen, even with the same character position and model it sometimes will behave as normal, but when global wind was enabled it would happen to me every time.

Here’s a video of it happening to me & the reproduction place:


SDrawReproduction.rbxl (180.8 KB)
In this case I’ve also set the StarterCharacter model to be my avatar, though I should note that in my testing changing avatars did not have an effect on the outcome.

1 Like

This would explain why a lot of people have been reporting framerate issues after I’ve added clouds to various maps in my experience. Quite a few now have the Cloud instance and pretty strong GlobalWinds to make said clouds move faster and appear more lively, I bet this bug is showing up and causing the performance problems.

1 Like