MirceaKitsune wrote: ↑Sun Apr 16, 2023 02:46
I got back into MT after hearing there's finally support for shadows and other pretty effects […]
Offtopic, but you could have have had dynamic shadows in Minetest for years by simply using the Irrlicht library feature:
1. First, enable the stencil buffer – this is a flag on
createDevice().
2. Call the
addShadowVolumeSceneNode() function for your mesh node.
3. Add some light node to the scene. The only light node I could find in Minetest 5.4.1 is attached to the camera for reasons unknown to me (could this be the reason for some lighting bugs related to the removed bump mapping feature?).
The shadows generated by Irrlicht are an extrusion of the mesh outline. They can only be a single color, but are reasonably fast and have crisp edges and handle self-shadowing for free (basically you get shadows like in DOOM 3). I suspect it does not become as computationally expensive as shadow maps do when you add more lights to the scene, but I have not tested that.
This means shadows of leaves and colored glass will probably not work. You will also notice that it seems to look wrong for many models. The reason for that is probably that the outline optimization in Irrlicht fails to handle models that are not entirely closed (i.e. if you would fill them with fluid, it would leak out somewhere). You can just disable that optimization, then it looks correct.
I have suggested this a long time ago, but so far it was rejected every time to even try – it seems no one even wanted to look at that part of the Irrlicht documentation. I could not figure it out myself, but Fleckenstein was more persistent and implemented it some time back – turns out I did forget to enable the stencil buffer.
I also made a comic after sfan5 wrote on IRC that rendering shadows like this will
never be done due to being “legacy OpenGL” (lol).