GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — Add Fog Occlusion for particles by AnOpenSauceDev · Pull Request #2766 · CaffeineMC/sodium ConversationI'm not sure if this is best suited for Sodium, but this PR fixes Minecraft's behavior of rendering particles regardless of fog occlusion. This PR makes Sodium skip particle rendering if a particle falls behind opaque fog and additionally has Fog Occlusion enabled (essentially just re-using the existing fog occlusion logic). (Render Distance is set to 2.) Let me know if I need to fix/rework anything!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
The worst-case scenario is that after joining a LAN server hosted on my home PC, the particles I'm spawning with a command block still render at over 100 blocks outside of the render distance (2 again) on the laptop. No Fog, No Fog Occlusioncommand: Fog, No Fog OcclusionIt also seems that particles are rendering over the stars when in fog. This behavior also happens in Vanilla. Fog + Fog OcclusionThis is fixed with Particle Fog Occlusion. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It seems that particles actually do render over the fog itself (w/o Fog Occlusion), but since they use the sky fog color it's not visible until sunrise/sunset. This then causes some ugly transitions with long-distance particles like campfire smoke. Side note: particles don't render behind translucent blocks/fluids, but I think this is intended behavior. BenchmarkingIn the somewhat plausible situation someone has buildings outside of render distance with lots of campfires going, performance can increase by almost 2X. (Rendering the same setup from the first image, a 15x15 fill of campfires) Rendering the scene inside of the fog distance looks like it has the same performance, so at the very least the occlusion check has a negligible impact. The performance gains from this are going to be extremely situational, probably only having an effect on large multiplayer servers, some large builds, and mods/datapacks that make use of long-distance effects (i.e. some biomes from Terralith and Better End.), but it could fix some existing visual issues with particles. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Will underwater fog and fog from blindness effect also affect particle culling? This should significantly improve performance in many mini-games related to these effects. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
As of that latest commit, Darkness + Blindness now have an effect on culling. (I forgot to use the fog end distance 😔) Water fog didn't drop the particle count by much after entering it, but I need to test that properly later. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
It looks like water fog isn't actually getting rid of particles because of fog, and I have made a few observations:
Because of that being an unrelated problem, this feature is complete and working properly. The only extra thing I could do is also factor in height for distance to cull particles in a sphere instead of a cylinder (This didn't really provide much of a boost in render time in my survival world though). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Can this be rebased to dev? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
occlusion check based off `RenderSectionManager.getEffectiveRenderDistance`
It seems that fog now has information stored within its own class, so I've just quickly updated it to match.
|
Sorry for taking so long on this. Is this workable on 1.21.11/26.1? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Not entirely sure if I'll be able to keep 'bumping' this PR into the future, so I'm wondering if this can be merged (possibly into an older version), or closed if the need for this has become obselete. I haven't touched MC seriously in ages so this may have become broken with the new renderer. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.