I'm using baked lighting in my renderer, which is calculated by ray testing from a point on a surface to every light. If the ray doesn't hit anything, calculate lighting for that point. If the ray is blocked, store a black pixel for that point in the surface's lightmap texture. Points are evenly distributed in world-space units.
I want to use lightmaps over dynamic lighting, but it's very hard to find good resources on baked lighting other than generating the lightmap itself, which I've been able to figure out.
One problem I'm facing now is hard edges between colors. The texels of the lightmap are very large when placed on a surface which gives this blocky look:
![](https://uploads.gamedev.net/forums/monthly_2021_03/4ed1f4b7cf794e229c2352474e86cc6c.edge.png)
Obviously, reducing the lightmap resolution will improve it, but not without using a huge amount of memory (and it still looks bad). I assume I need to do something in the pixel shader to smooth this out properly, but I'm not sure what. Does anyone know what I can do to improve this?
Another problem which might only be solvable by increasing the resolution is this:
![](https://uploads.gamedev.net/forums/monthly_2021_03/f76ba16b797c43a3ba5b44be4a6c25e7.off.png)
The circled area is unshadowed because the lightmap resolution isn't high enough to consider it, so it bleeds through. The piece of geometry casting the shadow is touching the one beneath it, so there is no opening between them.
If anyone has any insight, or knows of any good books or resources for the rendering step of baked lighting, I'd appreciate it.