DarkShadow44 / CptsModdingLight

Do What The F*ck You Want To Public License
5 stars 1 forks source link

Water Doesn't Light Properly in Worldgen #29

Closed DarianLStephens closed 2 years ago

DarianLStephens commented 4 years ago

Water will be lit properly if it receives a block update (Usually, it requires a direct one), but otherwise will usually start unlit, with odd patches (Most commonly near an overhang or other terrain) where it's lit correctly: 2019-12-09_05 24 10 Small bodies are usually fine, with the occasional artifact: 2019-12-09_05 23 27 Interestingly, looking at that first image, it looks as thought sunlight is hitting the shore and only spreading out from there, leaving the majority of the water unlit? I wonder if sunlight ignores or incorrectly interacts with water in some way?

Speaking of water, I don't suppose there are plans to make the new light color filtering work with water? It would be pretty neat to have light turn blue as it goes through water, though a minor concern would be how this would interact with biome water colors that differ extremely from the original...

DarkShadow44 commented 4 years ago

It wasn't planned, but feel free to open a feature request. Apart from differently colored water, it shouldn't be too hard to implement. I mean, I can query the water color at position X, so I could theoretically calculate the new color for filtering in a certain way. But I need to try before I can tell.

DarkShadow44 commented 4 years ago

Should be fixed. Can you please test the newest version 2.1.1 (https://www.curseforge.com/minecraft/mc-mods/light-overhaul/files/2851549) and report back? I hope the performance didn't degrade too much.

DarianLStephens commented 4 years ago

Re-lighting every chunk when it loads is an interesting idea, even outside of Colored Lights. A big concern I have is what happens on a server with a bunch of people moving around? Re-lighting each chunk then doesn't sound so great. Theoretically, if you're actually fixing the lighting and it's not just client-side, you'd only need to do it once per chunk. Although, if it is client-side, then the server performance issue is null.

DarkShadow44 commented 4 years ago

Light needs to be calculated on the server side, but only once a chunk is loaded/generated. Just moving around doesn't cause a recalculation.

DarianLStephens commented 4 years ago

Sorry, I meant moving around as in travelling long distances. Whether generating new chunks or re-loading old ones.

DarkShadow44 commented 4 years ago

I'm not sure about the performance, but I needed to do something. If it gives problems, I'll rework it.

DarianLStephens commented 4 years ago

Unfortunately, this does seem to have adversely affected performance. There's noticeable stuttering when generating new chunks and travelling through old (Already-generated) chunks. This is especially prominent when loading a world in Singleplayer; you can stay at 0 FPS for a while.

Although, when it re-does the lighting, it fixes the black spots in world-gen, so that's nice. Oddly enough, I did see some of that black lighting until I left and re-entered the chunks, so it didn't actually entire cure it.

DarianLStephens commented 4 years ago

However, despite all that, it's very nice to be able to look out at a non-pure-black ocean: 2019-12-30_11 47 52

DarianLStephens commented 4 years ago

Although, upon further testing, I don't seem to be able to enter the Nether; the world never loads, and I'm stuck falling in a red void.

DarkShadow44 commented 4 years ago

Thanks for testing, I can confirm that the performance in the nether is terrible. It loads eventually, but that takes way too long. On the bright side, there are no render glitches. I need to find a balance there, without that lighting fix the nether is pretty buggy.

DarianLStephens commented 4 years ago

Perhaps you could add a single bit of data to the chunks after your re-lighting happens? Set it to 1 when you're done, and that way each chunk only does it once, which should be enough to fix at least the vast majority of lighting glitches. Although, thinking further, I'm not sure that would actually help with the Nether's loading time (Initially, at least), since you're probably only doing this once when the chunk is loaded.

DarkShadow44 commented 4 years ago

Water is a PITA. Just uploaded 2.1.2, this would both fix the performance issue and the water lightning issues. Turns out, water was simply implemented wrong - it doesn't take it's own light value for rendering, but the light from the block above it. Please test and see if both water and the nether are fixed. Disclaimer: Existing worlds might be buggy, new should work just fine though.

DarianLStephens commented 4 years ago

Not only has that fixed water in worldgen, it's also restored it to original brightness, rather than the odd slightly-darker water that I assumed was just a consequence of colored lights: 2019-12-31_16 55 38 So, all in all, a massive success!

There are still some slightly odd spots where the lighting itself didn't work quite right, and ambient occlusion is still way too dark, but it's leagues better than before: 2019-12-31_16 56 42 With those spots of light, maybe it's got something to do with chunk boundaries? It does seem a bit too coincidental that all the ones in this swamp that I checked fell on one side or the other of a chunk boundary.

DarianLStephens commented 4 years ago

Although, the Nether is... a bit... Well, it loads much faster, at least: 2019-12-31_17 03 14 Interestingly, it almost looks like those weird lines are scanning across the chunks incredibly slowly: 2019-12-31_17 03 29 This one was taken a minute after the previous: 2019-12-31_17 04 39 2019-12-31_17 05 07 2019-12-31_17 05 38

DarianLStephens commented 4 years ago

Also interestingly, although lava falls now seem to be properly lit, the topmost block touching another block isn't: 2019-12-31_17 09 43 It's not a lighting glitch, either, since I've tried updating them to no avail. It will also turn pure black if you put a block next to it period, so it's likely something to do with how the liquid renders: 2019-12-31_17 12 05 2019-12-31_17 12 19 Additionally, lighting glitches in general seem to be less common. I have yet to see a 'dark fire' (Fire that won't emit light without being updated), and the vast majority of the colored glowstone seems to all be lit properly, whereas in previous versions they'd be so commonplace I'd practically have to ignore them or go mad.

DarkShadow44 commented 4 years ago

Thanks for testing, will take a look at it the next year.

DarianLStephens commented 4 years ago

Fair enough, I'll look forward to some more info next decade.

DarkShadow44 commented 2 years ago

1.7.10 version is out of date, the rework is written from scratch, so I close this bug.