Commit Graph

195 Commits

Author SHA1 Message Date
tom lee d1b5200fed Renderer: Fixup some stuff that maybe an issue 2021-12-14 21:28:09 +08:00
Morippi 4a4728d41e fixed some part and added the newUpdate for now (still unsuded and doesn't use the slice) 2021-12-14 14:11:11 +01:00
Morippi c9204a2094 fixed some part and made a splitted version (if we want to use it since it's possible) 2021-12-14 14:00:47 +01:00
Morippi c45f0b2414 completed the merge method 2021-12-14 13:46:10 +01:00
tom lee 97b2db84cd Quick Patch for GL43+
TODO: Check why GL43+ Vertex Attribute doesn't work
2021-12-14 18:21:40 +08:00
tom lee c389f3b391 Fix merge conflicts 2021-12-14 15:03:31 +08:00
tom lee 6049840aa6 MAJOR Renderer Rewrite
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.
2021-12-14 15:03:03 +08:00
tom lee 2dee6b0326 Add a try/catch and disable Renderer on error
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)
2021-12-14 14:51:00 +08:00
Morippi 27d9e6aeb7 Added slice in mergeAndAddData 2021-12-13 22:55:29 +01:00
Morippi c751b6fcc6 Added some other comment to the merge 2021-12-13 22:49:58 +01:00
Morippi 31f173c8e8 added the commented code to the mergeAndAddData to make the conversion to new system easier 2021-12-13 22:40:01 +01:00
Morippi 90ca3bd394 Added the position data merge 2021-12-13 22:37:40 +01:00
Morippi 30dd5526cd refactoring for future code 2021-12-13 22:12:13 +01:00
Morippi a9e31b8133 Added methods for the merge in the LevelContainer, to be implemented 2021-12-13 21:03:54 +01:00
Morippi e71cd864b4 Merge remote-tracking branch 'origin/main' into main 2021-12-13 18:59:52 +01:00
Morippi 8efc7d54e7 Changed the format 2021-12-13 18:59:42 +01:00
cola98765 e323e8d62e fixed wrong wrapper call 2021-12-13 18:38:01 +01:00
cola98765 b970ad0ab8 I hope I fixed what james broke 2021-12-13 16:13:43 +01:00
cola98765 c811e6bad6 another change to save format... now there is no static offset 2021-12-13 10:41:33 +01:00
James Seibel 8ef0d40f0c Merge branch 'main' of gitlab.com:jeseibel/distant-horizons-core 2021-12-12 17:42:25 -06:00
James Seibel 227f7d0a23 Closes #85 (Sodium Overdraw incompatibility)
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.
2021-12-12 17:42:23 -06:00
James Seibel b385b018f1 Remove a few unneeded lines 2021-12-12 17:32:38 -06:00
cola98765 4ece2de991 probable fix to a color bug that made no sense 2021-12-12 23:47:24 +01:00
cola98765 a172961112 probable fix to a color bug that made no sense 2021-12-12 21:26:40 +01:00
tom lee 9e882951ef WorldGen: Quick change to respect VersionConstants
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~
2021-12-12 23:14:52 +08:00
cola98765 1c9fe23633 fixed couple errors, but floating islands are still broken 2021-12-12 12:04:08 +01:00
James Seibel 92b6a9695d Improve the comment for the Horizontal Quality setting 2021-12-11 21:49:56 -06:00
James Seibel acc5e7af98 Add support for different Core behavior in different MC versions 2021-12-11 21:40:43 -06:00
coolGi2007 aa9e49b3e7 Please stop calling a forge wrapper from core 2021-12-12 01:30:40 +00:00
cola98765 7d86e24db5 attempt to fix generation below y=0 2021-12-12 00:25:51 +01:00
cola98765 71986d8818 attempt to fix generation below y=0 2021-12-12 00:16:34 +01:00
cola98765 e948b4dac1 attempt to fix generation below y=0 2021-12-11 23:48:04 +01:00
cola98765 0a5f7d0c11 reversed IF to attempt to avoid indexOutOfBounds 2021-12-11 23:30:11 +01:00
cola98765 1c65ef8323 made whatever leetom made build on my java 8 instance 2021-12-11 19:23:21 +01:00
cola98765 2c744dd22b made whatever leetom made build on my java 8 instance 2021-12-11 19:22:49 +01:00
tom lee 009d7ede1b WorldGen: Added support for single thread world gen
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.
2021-12-12 02:01:59 +08:00
cola98765 4199954843 fixed terraforged nullPointer. TODO fix the cause of the bug, bot it's symptoms 2021-12-11 18:06:58 +01:00
cola98765 c7ab36c6b7 since light no longer needs to be updated, I've reenabled partial regens 2021-12-11 16:58:37 +01:00
cola98765 1da6544550 actually fix FAR_FIRST 2021-12-11 16:33:27 +01:00
cola98765 c2896d1f73 now stuff should actually cull 2021-12-11 15:43:43 +01:00
cola98765 302abb1e57 fixed blocklight 2021-12-11 14:10:55 +01:00
cola98765 34c6f28173 fix nonFull and noCollision blocks not giving color 2021-12-11 10:54:26 +01:00
cola98765 75676df736 Merge remote-tracking branch 'origin/main' into main 2021-12-11 10:22:08 +01:00
coolGi2007 56b80f00e8 Fixed something that shouldnt be called 2021-12-11 09:13:12 +00:00
cola98765 c1651edb6a fix directional culling 2021-12-11 09:56:41 +01:00
Morippi c1375f7a10 small fixes, + changed variables name 2021-12-11 01:26:03 +01:00
Morippi a82ef3dcde Fixed position bug in the rendering 2021-12-11 00:42:08 +01:00
cola98765 74a97dab0d small fixes 2021-12-10 21:57:14 +01:00
cola98765 16621773af mall fix 2021-12-10 20:49:40 +01:00
Morippi c8988ad1b7 fixewd generation not working 2021-12-10 20:37:02 +01:00