# Added lights and shadows.

Per-pixel line-traced shadow mapping. Works per-pixel, not per tile.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708704299437/7bc4215f-3edd-4e0d-b8de-66bb1a94242b.png align="center")

Now works with multiple lights.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708708005513/d6bbf88f-541b-46bb-86e3-6a7652f19a55.png align="center")

Added sprites to the engine, which can be anywhere on the map, and have individual rotation/scaling along-side the map rotation/scaling. all done beneath the surface by the engine, you simply set rotation/position and the engine does the rest. Here's an example,

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708776789557/8ca34df3-4bb4-46ac-a936-3f2f7c6f765c.png align="center")

Sprites can now cast shadows also.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708778871525/703fb6e4-0fc9-4790-a8d0-4b011340578e.png align="center")

Improved the shadowing technique to eliminate any slow down caused by zooming in/out, it now remains a constant. i.e any zoom runs at the same speed as native zoom=1.0;

Here's the magic bit of the shader, just before the line tracing of the shadow map.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708788158178/50e051ef-5ede-4626-b73f-bf41a0f11cc4.png align="center")

It even works in reverse, meaning as close up as you get the shadows don't get more blurry. but this *does* cost more gpu cycles.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1708788244621/391aa0a9-5288-443b-9ec5-4f0a8bd76bdc.png align="center")

but still, even this close up it remains non-blurry for want of a better term.
