VulkanMod icon indicating copy to clipboard operation
VulkanMod copied to clipboard

Basic frustum changes

Open tr7zw opened this issue 3 years ago • 3 comments

  • Use a parallelStream to recalculate the frustum, so the cpu is better utilized
  • Add a bit? of overdraw, but heavily reduce how often the frustum is recalculated

This slightly reduces the fps while standing still, but can up to double the fps while moving the camera/player. In the future this should probably work more like Sodium does: with a flood fill and better optimized Frustums.

tr7zw avatar Jun 16 '22 20:06 tr7zw

  • Use a parallelStream to recalculate the frustum, so the cpu is better utilized
  • Add a bit? of overdraw, but heavily reduce how often the frustum is recalculated

This slightly reduces the fps while standing still, but can up to double the fps while moving the camera/player. In the future this should probably work more like Sodium does: with a flood fill and better optimized Frustums.

Nice to see such movement on this mod. :) I was testing it for couple minutes, but I don't know how to check if it helped. I didn't see much difference on fps.

andreasdc avatar Jun 16 '22 21:06 andreasdc

To test the difference: Stand still and circle the mouse. The fps will drop by a lot, with this change a bit less(but still drop). Edit: the drop depends on the render distance. At <= 16 it's probably not too noticeable, at 32 it will /3 the fps easily. Edit2: locally did some more tweaking and got some more performance out of it. Gonna update the pr later.

tr7zw avatar Jun 16 '22 21:06 tr7zw

@tr7zw i tested your build, indeed, we loose less FPS with your change (i noticed a maximum loss of 20 fps: from 100 to 80fps). Good job, mate ! 👌

SpidFightFR avatar Jul 11 '22 11:07 SpidFightFR

Will it help for this? Maybe it can be implemented? image

andreasdc avatar Oct 19 '22 15:10 andreasdc

Yea it's exactly what this pr aimed to improve, but it's janky(and outdated). Probably better to fix it correctly like Sodium/Optifine do.

tr7zw avatar Oct 19 '22 16:10 tr7zw

Would be nice to see the fix 🚀

andreasdc avatar Oct 19 '22 17:10 andreasdc

Latest update addresses this aspect in a better way, from how chunks are updated to optimized frustum culling. Frustum computations could still be made multi threaded but the benefits would be minimal. I'll close this PR for now, if you still want to try or come up with something better open a new one. Thank you for your efforts.

xCollateral avatar Dec 14 '22 14:12 xCollateral

Yea I've seen the dev builds and new releases, don't think I will be able to get around to try to make anything that can compete, since I'm tried up with other projects.

tr7zw avatar Dec 14 '22 15:12 tr7zw