PeytonPlayz595 / Shadow-4.0

Optifine client for Eaglercraft u34 with support for EaglerForge v1.3 mods
https://peytonplayz595.github.io/Shadow-4.0/javascript/
MIT License
17 stars 32 forks source link

Chunks not rendering in 1 chunk render distance #2

Closed catfoolyou closed 4 months ago

catfoolyou commented 4 months ago

If the render distance is set to one chunk, it will not render chunks close to the player. Setting the render distance to anything above 1 seems to fix this, however FPS drops horribly. The vanilla client gives better FPS than this, and I had all of Optifine's fast math and other optimisations turned on.

PeytonPlayz595 commented 4 months ago

Are you on a Chromebook? People have been reporting issues with FPS drops and chunk loading on the latest commit, especially on Chromebooks, people seem to have no issue with it on Windows for some reason (as far as I know). Anyways, later tonight I'll try to go back and see if I can find what's in the commit that's causing the FPS drops and chunk issues. I think one issue for chunk loading is I've changed some gluPerspective calls in the EntityRenderer and RenderGlobal classes to match Optifine because chunks along with custom skies would have this weird clipping issue with lower render distance chunks but I'll just make the sky not render and change the gluPerspective calls back to normal if the render distance is set to 1 chunk, all of that is not supposed to render anyways unless the render distance is set to 4 (8 for custom skies) or higher but I know most people are probably playing on Chromebook's and wouldn't be able to use it so I decided to make it render at a lower render distance, I've done some testing and it doesn't seem to affect performance, it just has some weird bugs that need to be worked out.

PeytonPlayz595 commented 4 months ago

Be aware that this is not an "official" release, it is a beta version that is still being worked on and still has some bugs I'm trying to fix. I'll create a release on the GitHub page when I feel like the client is ready.

PeytonPlayz595 commented 4 months ago

Oh also @catfoolyou don't use the offline download or web files from this GitHub, they are VERY outdated, I'll compile whenever I get a chance but for now just use the offline download from the Discord server.

Edit: Never mind, I just pushed a commit compiling it, the latest offline download's and web files are in the javascript directory, If you need me to I can send you a file with the exported settings to get you the most possible FPS (Some settings may have different results on some devices so you will have to experiment with them).

catfoolyou commented 4 months ago

I'm on a Windows laptop, using an offline download because I'm too lazy to run a single command to start an HTTP server. I'll check out the new downloads today, thanks.

catfoolyou commented 4 months ago

Also some pics of the bug and the lag spikes. It goes from 115 to 14 FPS, while I get a stable 80-100 FPS on vanilla desktop clients and on my 1.12 desktop runtime. Screenshot 2024-04-16 081218 Screenshot 2024-04-16 081133

PeytonPlayz595 commented 4 months ago

Also some pics of the bug and the lag spikes. It goes from 115 to 14 FPS, while I get a stable 80-100 FPS on vanilla desktop clients and on my 1.12 desktop runtime. Screenshot 2024-04-16 081218 Screenshot 2024-04-16 081133

Yeah it turns out setting the thread priority in TeaVM causes MASSIVE lag spikes for some reason, I pushed a commit changing the singleplayer server thread priority, the TPS is slightly better but it causes a huge dip in FPS. The chunk loading issue's you're having in the screenshots above have been fixed in the latest version but I'll push a new commit in a few minutes changing the thread priority back to normal which should fix the lag spikes.

PeytonPlayz595 commented 4 months ago

After doing some testing I have found that this is a bug that only occurs when fog is turned on, I fixed the bug with fog off but it still happens if the player has fog turned on

PeytonPlayz595 commented 4 months ago

Just fixed it, I also changed the thread priority back to normal, I'm not sure if that is the reason for the lag spikes or not, I don't have any lag spikes anyways so I'm unable to test, it runs just fine on my PC and Chromebook so idk.

PeytonPlayz595 commented 4 months ago

This has been fixed in the most recent version, there are still some issues with FPS but I think that has to do with Custom Items and Custom Colors, just turn them off and you should be fine, I'm working on a fix for it and should be released within a day or two.

If you do not have a dedicated GPU and are using integrated graphics turn smooth FPS off, it uses glFinish to make the GPU wait for all previous commands to be executed before continuing, integrated graphics are slower so it'll have to stall longer for it to finish executed the previous registered commands, therefor dropping the FPS.