Posted June 28, 2025 by RodZilla
As the end of the voting period of Godot Wild Jam #82 is approaching, I'm trying to fix the bugs that have been found in Little Shadow, and some of them are quite interesting:
Unsurprisingly, most of those problems are related to the light detection feature, and since this has been requested in the comments, I'll first describe how this is done.
I started with this very nice video tutorial, that explain how a small subviewport can be used together with a very simple mesh and a dedicated camera to measure light:
The first bug is about shadows that change depending on the view angle, and is clearly visible in the forest area.
This problem is quite easy to understand: shadows are stored in an atlas, and the number of shadows stored in each part of the atlas can be configured. The default configuration stores a few shadows in the first quadrants and lots of others in the last one, and consequently, not all shadows are stored with the same precision. An easy workaround is to change that part of the configuration to store 16 shadows in each quadrant (we want to handle 64 lights, because that game is all about shadows). Shadows are a little bit less precise (and this could be compensated by increasing the shadow atlas resolution), but they do not change anymore.
This problem is also related to shadows, but a little bit different: our cute creature takes damage while in shadow.
This one is due to the fact the view and light detection use different cameras, and consequently, the renderer also generates different shadow atlases. Moving the light detection camera to the exact location of the view camera, and pointing it to the light detection mesh with a very small view angle (and near and far distances carefully selected so only the detection mesh is captured) completely solved the problem.
I don't know yet why this flickering problem occurs, but I know it is related to the light detection viewport (the flickering frequency is the same as the update frequency of the light detection viewport). It seems it could be a bug in Godot's Compatibility renderer, and it might be related to this issue, but I am not completely sure yet.
An easy fix is to switch to the Forward+ renderer (since the Web export is important for gamejams, we are not sure we want to keep it) and tweak the light detection system so it measures the same values with both renderers.
All those problems (plus a few others) will be gone soon after the end of Godot Wild Jam #82. If you noticed other problems, please don't hesitate to report them in this devlog comments so I can fix them as well.
Have fun and stay in the shadows!