# Shadow caster budget several point lights casting at once. ```{raw} html ▶ Run in browser ``` **Tags:** `3d` ``WorldEnvironment.shadow_caster_count`` is how many point lights, and how many spot lights, may cast a shadow in the same frame. It defaults to 1 of each: one caster draws every shadow-casting mesh six times, and pays that again whenever its light, the casting geometry or a material they are drawn with changes, so the budget is a quality dial you raise deliberately rather than a limit to max out. A still scene draws each of its shadow maps once and then keeps them. Four coloured lamps ring the scene, each with its own block to throw a shadow from. Press 1-4 to set the budget and watch shadows appear and disappear: the lamps that fit the budget cast, the rest still light the scene and cast nothing (the renderer logs that once). Which lamps fit is decided by ``PointLight3D.shadow_priority`` first and then by how much each lamp is worth to the camera (its brightness and reach against its distance), so orbiting round hands the shadow to the lamp you approach. A lamp already casting keeps its map until another is worth a clear margin more, so the handover lands just past the halfway point between two lamps rather than exactly on it. The dial reallocates the shadow atlases, so expect a hitch on the frame it changes -- set it once for a scene, not per frame. Controls: 1 / 2 / 3 / 4 - Shadow caster budget A / D - Orbit camera W / S - Zoom in / out Run: uv run python examples/features/3d/shadow_casters.py ## Source ```{literalinclude} ../../examples/features/3d/shadow_casters.py :language: python :linenos: ```