OpenBlocks

OpenBlocks

56M Downloads

Sky Blocks cause massive lag

wwboynton opened this issue · 17 comments

commented

Hello!

I love the sky block and inverted sky block. My understanding however (after some research) is that sky blocks, even when connected, each render their own individual cropped skybox. This is extremely resource intensive on the client-side, and makes even higher-powered systems fall to their knees when looking at an array of connected sky blocks. This is true even when looking toward the blocks through a wall (presumably because of the way Minecraft loads and renders visuals).

My impression is that contiguous sky blocks should render one skybox across them, though I'm sure that has its own implications. As someone who has not spent much time in the Minecraft and Forge APIs, my goal with this ticket is simply to document a problem I am seeing that I could not find in any other tickets.

Repro Instructions:

  1. Place lots of sky blocks on your ceiling, dawg
  2. Look at 'em
  3. Lag to hell
  4. Cry
commented

Skyblock rendering has changed quite significantly between 1.7.10 and more recent version, so I'm not sure what version are you referring to. Anyway, basic idea is:

  • For 1.7.10 - render all skyblocks to stencil (cutout) buffer, then render sky (from ground up)
  • For 1.10-1.12 - if there is any skyblock, copy screen content after screen is rendered, but before ground. For any block, render it on cutout and then render sky texture over it (so instead of rendering texture twice, it renders single textured quad per block). So theoretically single block is "lighter" than chest.

Anyway, from my experiments, I don't experience any performance problems even with large number of skyblocks on my 4-year old laptop GPU, There is of course possibility that degradation is caused by driver problems...

commented

Sorry, I'm a goon for not listing the versions. I'm on MC 1.12.2. When I'm home, I'll get the forge version.

It's been tested on two machines with a 52x52 array of inverted sky blocks:

  • Both machines are running a 2017 Intel Core i7 6700K 4.00 GHz Skylake.
  • One machine running an Nvidia GTX 980, one running two GTX 970s in SLI (I know SLI has dubious usefulness in MC). Both using OpenGL, with the latest Nvidia drivers (I can be more specific when I'm home if need be)
  • Both machines have 32GB of RAM, and have allocated 4GB to the JVM for Minecraft.
  • Both machines running on a 4k monitor

In both cases, either reducing the window size drastically or running in fullscreen with a resolution less than 1080p helped alleviate the problem somewhat, although the frame drop stayed consistently severe when looking toward the blocks.

commented

New world, another 52x52 grid, and I'm seeing similar issues. FPS hitting the 120 cap easily when looking down, but choking hard to 4-5 FPS when looking up.
javaw_2018-02-26_17-46-57
javaw_2018-02-26_17-47-07

commented

Ok, as a test, can you check if this changes anything? Just run it on new world, since it contains some new stuff.

commented

Will check when I'm home later today, both in server-client configuration and in single-player.

commented

It's client only change, no need to test on server, so single-player is enough.

commented

I will be running the profiler shortly. Expect an attachment within the half-hour :)

commented

Ok, can you run sampler for me? After world loads call command /sampler start, look at skyblocks, then /sampler stop and then /sampler export. You should get in chat something like [some number] samples have been exported to .[some path]\sampler-snapshot.nps.. After that, can you post that NPS file here?

commented

Hmm, interesting. Can you do the same without v-sync?

commented

This is quite curious, since I still see most of the time spent on waiting for next frame to begin rendering - which means there is still quite a lot of time budget for rendering and FPS should be stable. Anyway, I see some bad places which I can fix (though they are also bad on my PC and I don't see quite dramatic FPS drop).

commented

I found some time to do some general improvements, maybe it's faster now: https://www.dropbox.com/s/pl7lqpf3843l8mh/OpenBlocks-sky-2.zip?dl=0

commented

I'll give it a try tomorrow or Monday when I'm back home.

It's strange that it would spend most of its time waiting for the next render... In any case, thanks for your time. I'll let you know what I find.

commented

i`m playing 1.20 pack of stoneblock, problem still exists….. has there been any update to this since?

commented

I did what I could, but it's just resource-heavy decoration block - don't expect miracles.

commented

I have another strange, thing with this though…. on a stoneblock server i play on, i have the entire ceiling covered in skyblocks…. IF i look straigth up and have no other blocks in sight, my fps stabilizes at 90-100. if i look at the edge (where the edge of skyblock meats real blocks) the framrate drops to 20-25, if i looks straight down, my framerate is approx 150, my "cave" is approx 70 x 70 blocks in size