Sodium Reloaded (Unofficial)

Sodium Reloaded (Unofficial)

0 Downloads

Clouds with a custom Resource Pack texture does not scale as expected.

mistrk7 opened this issue · 8 comments

commented

Version information

mc1.19.3-0.4.8+build.22

Expected Behavior

If a Resource Pack uses a custom cloud.png texture higher than the default (256x256), it is expected that the clouds will scale to size.

This is actually done in Vanilla, but with hilariously buggy results if you use Fancy clouds. (img: using my 'xBR Clouds' resource pack, 1024x1024 sized cloud file)

image

Actual Behavior

Instead, the texture keeps its pixel density and becomes larger across the sky. (img: sodium 0.4.8, resource pack on)

image

The Vanilla solution would be to just use Fast clouds, but the new cloud rendering optimisation fix in 0.4.7 removed that. It would be great that this would be fixed. I can no longer use this Vanilla workaround when Sodium is installed... :)

Reproduction Steps

  1. Download my Resource Pack or create a cloud.png texture higher than 256x256 in assets\minecraft\textures\environment. (Note: Lower resolutions not tested. might want to check.)
  2. Launch Sodium 0.4.7 or later
  3. Load up a world, and look at the sky.

When this bug is fixed it should look like how Vanilla attempts to do it, but fixed.

Java version

Java 17

CPU

Intel Core i7-10700F

GPU

NVIDIA GeForce RTX 2070 SUPER

Additional information

No response

commented

I've got a build that fixes the issue shown above and also fixes a few other things that honestly you'd only ever find if you were trying to find/cause issues.

however, as jelly has said increasing the cloud size with the current method doesn't scale well as you end up generating not only more geometry but refreshing it more frequently. and it's possible to crash the game if your clouds.png is large enough to exceed the max size of the buffer

i think next ill see where just making it update less frequently gets it by letting it translate the clouds further than a single cell at higher cloud resolutions, as long as it updates before the fog starts it should be identical.

Nice one.
Please keep us updated on this. Thanks

commented

If someone else wants to work on the code to implement Fast mode rendering, or to make the fancy-cloud rendering more performant at high texture resolutions, we're open to that...

We removed the Fast mode because it was additional work, and our Fancy clouds were so much faster than even vanilla's Fast clouds. It just didn't make sense to maintain both code paths. Probably it still doesn't, but we can fix Fancy clouds so people don't need to resort to this.

commented

It's possible for us to patch the "fancy cloud" rendering code to take into account the texture resolution. But that would require a lot more time on the CPU to generate the cloud geometry. The algorithm we're using isn't very fast, but it's fast enough that at the default cloud texture size (256x256) it ends up being a non-issue. With additional optimizations we could probably "cache" the geometry so that the performance is better, though that would need quite a bit of additional work.

commented

I've got a build that fixes the issue shown above and also fixes a few other things that honestly you'd only ever find if you were trying to find/cause issues.

however, as jelly has said increasing the cloud size with the current method doesn't scale well as you end up generating not only more geometry but refreshing it more frequently. and it's possible to crash the game if your clouds.png is large enough to exceed the max size of the buffer

i think next ill see where just making it update less frequently gets it by letting it translate the clouds further than a single cell at higher cloud resolutions, as long as it updates before the fog starts it should be identical.

image
image

1024px clouds
image

256px clouds
image

commented

@Altirix At the end of the day HD clouds are completely optional and nothing exists to take advantage of them yet. I would like to see this implemented into the mod so that more people can start using the vanilla fix, including people who use my resource pack.

commented

Have you checked if this is still an issue? The cloud renderer was rewritten recently

commented

@Altirix At the end of the day HD clouds are completely optional and nothing exists to take advantage of them yet. I would like to see this implemented into the mod so that more people can start using the vanilla fix, including people who use my resource pack.

the test build i made that used the prior implementation was never submitted as in real world scenarios using the large cloud.png was detrimental to frametimes as shown by the results posted. it was mostly just to investigate the impact of making the clouds more dense.

it effectively leads to perceived stuttering as the frametime fluctuates a lot depending on if clouds need to be rebuilt or not. which occurs more frequently the larger clouds.png is, and each rebuild takes more time.

as is you wouldn’t want to use it. it’s one of those that i’d think are better kept as a limitation until a good solution is made rather than force it to work, knowing it will be detrimental to the perceived performance under real world usage

the rewrite doesn’t look to handle this case still. as vertex positions are constant. but it seems it won’t discard the previous cloud geometry now so it might not cause such a swing in frame times.

commented

This bug also seems to make Fluff Clouds show incorrectly.