Why does one object count as many shadow casters?

I have objects in my scene, which are combined at runtime. My environments are procedural rooms with four walls. How I combine them is all four walls at once, grouped by material, into a single mesh (I’m not sure this explicitly matters for my case but I’ll bring it up later). There is no directional light.

One of these sections can count as a dozen+ of shadow casters with a point light in the center. I believe this happens due to cubemap stuff, where one point light actually counts as six lights, but there’s very little online on how this works, hidden amidst a sea of similar but irrelevant information. Plus, it’s still just one object and one light, how can it be more than six? (again, no directional light)

Related to this, could I expect better performance by grouping meshes by singular wall (so I have four flat meshes) rather than one larger more complex mesh, since one side of the point light will be hitting one or two sidea which technically contains the data for the other sides?

you should check the frame debugger to see if you can garner where the extra passes are from. i’m testing this with just a single object with a point light touching it, and i get exactly 6 shadowcaster passes as you would expect.

in debugger, you may want to look for the message that tells you exactly why certain passes couldn’t render together in one batch if it’s drawing the objects twice, though this may not be the case for you.

-maybe your objects are being incorrectly combined, or can’t be combined?
-maybe you have a floor/ceiling being lit as well? though i figure you would’ve mentioned that.

1 Like