The renderer rework is done. Fixed some non-issues and optimized away
some bind() calls. Also added some FIXME comments to some place that I
noticed needs to be fixed.
Fixed someone calling world.getMinHeight() on LodBuilder static init.
The world hasn't even been loaded... Also added it so that it updates on
world / dimension change.
Newer versions of sodium store chunks in such a way that using reflection to get them is complicated at best. So for now we will just use the render distance and estimate which chunks should be loaded.
Rewriten almost all stuff in core.render. Changes made:
1. Added LightmapTexture object
2. Moved&Renamed LodShader & LodShaderProgram to be under render/objects/
3. All class under render/objects are actual objects for OpenGL
4. Add LodRenderProgram which is a ShaderProgram + VertexAttribute. If
we change the method on how we render stuff (Like modifying
input/output), we should change this file as this is the
repesentation of the Rendering Program that we are using.
5. Add VertexAttribute, and a GL43+ vesion of it. I implemented both
versions because the GL43+ will get a noticable speedup due to some
additions to OpenGL standard. However I still included older version
for backward compatibilities. To access VertexAttributes, it is
recommended to access it though the VertexAttribute abstract class's
method.
6. Rewritten the main renderLod() method. Now it will cache as much
stuff as possible.
7. To do '6.', now the renderer has a setup() and a cleanup() method,
both that must be called inside Render Thread. The renderer should
automatically detects when it needs to call the setup() and
cleanup(). However, you can expicitly request the renderer to do
cleanup() on next rendering by calling markForCleanup().
8. ...I think that's all? Don't quite remember tbh. Hopefully I didn't
miss any points.
Note: This overhaul of the renderer means that THERE WILL BE BUGS. I
can't test all versions on both Nvidia and AMD cards with all OPENGL
versions so please report any bugs to me straight away. Thanks in
advance!
Note 2: I will add more docs in the source code next.