Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
WIP: renderer: merge lightmap and vertex (lightgrid) world and entity lighting #301
Also includes commits from #300.
This is work in progress. There is currently a nasty bug that makes it unmergeable.
This merges world lightmapping glsl, world lightgrid lighting glsl (wrongly called vertex world) and entity lightgrid glsl (wrongly called vertex entity).
This prevent the risk of mistakes by not copy pasting 90% of the same code between files. This also helps to improve feature parity between all rendering options.
It makes possible to do or to implement:
Also it would be possible to implement rim lighting on world but I don't think there is any usage for that, in any way it would be very easy to do.
The implementation is rendering properly world and entities using either light maps or light grid, and normal maps are rendererd properly using either deluxe maps or light grid.
BUG: an unknown bug that is not yet solved is making some surfaces going void (like if all their pixels were discarded) depending on the angle of view? Once this bug is fixed this change may be mergeable I guess. I need help to fix this bug.
The “invisible surface” bug related to viewing angle is probably not in GLSL code.
The bug is probably not in
On C++ side, there is low chance the bug would be in
One interesting thing is that the code stores lighgrid1 (used to compute light color) as lightmap when lightmap is disabled or unavailable, and stores lightgrid2 (used to compute light direction) as deluxemap when deluxe map is disabled or unavailable. This way there is only two binds for light color and light direction whatever the combination of features used. Then some