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.
Rendering exceptions usually happens every frame, which cause a lot of
spam. So I added a try/catch and a bool to check if Renderer has
encountered an error, in which the Renderer will be disabled until the
game restarts. (This could probibly be changed)
One minor issue: Sodium returns chunks differently than vanilla MC or Optifine. Specifically as of 1.16.5 (12-12-2021) it also returns one layer of chunks further than what is currently rendered.
Changed it so that even in FULL mode, it respects the VersionConstants
setting. Who knows if one day we might get even FULL chunk gen in
multithreading~
Reworked the world gen so that it no longer creates like 5 new threads
every server tick. And combined LodGenWorker into LodWorldGenerator as
being a seperate object is not needed.