Model load much slower with cascadedShadow and prepassRenderer

My test playground: Babylon.js Playground. You should add a model path when testing.
Sorry I can’t share the models for some reasons, but I’ve tested many models on many PCs with chrome, firefox and edge, but they all have the same problem on 5.47.0.

For the most typical situation, I use windows 10,GPU RTX3060Ti with CPU i7-10700 on chrome 113.0.5672.93, and the first image is the param of the model with cascaded shadow opening.
As you can see in the second image, it took me around 5 seconds to load the model with cascadedShadow and ssrpipeline(to enable the prepassrenderer) on. While only 1.5 seconds with only ssr enabled or only shadow enabled.

Some things I recognized that maybe useful:

  1. Only cascadedShadow will cause the problem, it works fine with simple shadow.
  2. Neither the cascaded count of the shadow nor the faces count of the meshes can effect.

So is this situation as expected? Or any workaround would really help.

Edit: I’ve read the post, though not really sure, it is not a same problem.

I don’t reproduce.

I used this PG:

Can you test with WebGPU / Firefox (or another browser)? Maybe it’s a problem with your drivers(?)

Updated the PG just to print the elapsed time to load: Babylon.js Playground (, tested on Edge and FF and both were taking the same time. Are you sure you disabled the cache when you tested? Most of the time I saw was just regular download time.

Your playground works fine for me, I guess the model is too simple to reproduce the problem, so I updated the playground with the model from Loading time performance regression?.
New playground:

Still the same thing for me between cascaded / non cascaded: first time I come to the page, it is 1.03 - 1.08s for both, then when I click on the “Play” button, the time is around 0.75 for both.

The elapsed time showed is similar with or without the cascaded, but the time from clicking the ‘Play’ button to the GUI shows is really different, around 5s with the cascaded and 1.5s without the cascaded.
I’ve tested the playground over 5 computers and all the same problem, so I really don’t think it is a problem with hardware or driver.
May I ask are you using the playground#5 or just copy the model link? I just noticed you recalled createDefaultCamera in onsuccess callback in playground #1 and #2, this will cover up the problem.
Edit: The stuck time actually happened on the first time render but not load, sorry I don’t make it clear before.

I can reproduce, I’m currently investigating the issue.

1 Like

See my answers in this thread:

1 Like