so this is interesting.
have a play with this:
You have checkboxes to change the ShadowGenerator mapSize
and a slider to change the number of objects casting shadows.
The grid of shadow casting objects is 100 x 100.
It’s defined in the playground under
gridSize so is easily changed but my GPU seems to have a hard limit on the number of shadows it can cope with so there’s not much point me increasing that number any more.
The number of divisions in the groundplane receiving the shadow doesn’t seem to make much difference to performance so i didn’t bother putting it behind a control.
you’ll probably need to load your CPU a bit to see anything interesting if you are testing on particularly capable hardware…
(my anti virus SW is running at the moment and that actually makes things more pronounced.
On my system, the
ShadowGenerator.mapSize property makes the biggest difference.
The number of shadow casting objects does make some difference but it’s much less pronounced.
It’s hard to put hard numbers on this without a properly sandboxed system.
With other tasks competing for the CPU and/or GPU the results of this sort of testing are always going to be a bit vague.
I also see some interesting artifacts.
I presume this one is GPU dependent. Look at the attached image.
I presume the reason some of these objects are casting shadows and some aren’t is either hardware limitation of the GPU or a bug in the WebGL implementation i am using.
A limited counter size for tracking unique shadows maybe? It certainly seems to calculate the ones furthers from the light source first and gives up after ~5900 objects.
i’m not really looking for feedback here. Just found this interesting.
I’ve also get a lead to improve performance on my maps: Reduce
(Obvious in retrospect.)