ZtereoHYPE / nicer-skies

minecraft mod to tweak a few things in minecraft sky and light rendering
GNU Lesser General Public License v3.0
16 stars 3 forks source link

Nubulae rendering in front of moon. #11

Open DagothUrTheFalse opened 1 year ago

DagothUrTheFalse commented 1 year ago

Preamle/Clarifications: I am using this along with Complementary Reimagined Shaders, which is stated to be compatible, though it is the Euphoria modified version (From the discord), moon is from a resource pack but it is not modded.

Issue: As stated in the title of the issue the nebulae added by this mod are displaying in front of the moon, which is obviously kind of odd, just like stars in front would be, which funnily enough complementary does add but it is less obvious and since they flicker it is more temporary.

2023-07-14_21 07 44

ZtereoHYPE commented 1 year ago

This is gonna be hard to fix because of the way I render nebulas. Still gonna give it a shot but can't guarantee much

DagothUrTheFalse commented 1 year ago

Best suggestion I could provide is making some sort of deadzone around the moon or something?

ZtereoHYPE commented 1 year ago

A problem with doing that is that shaderpacks are able to change completely the angle at which the sun and moon render, and there's no way for me to detect that at all.

DagothUrTheFalse commented 1 year ago

Ah, thats fair.

ZtereoHYPE commented 1 year ago

I might have found a solution, but it involves a horrible hack. The main issue here is that the moon texture uses a black background so we can't really "overlay it" on top of the nebulas and hope for the best, as that would show a horrible black square.

The solution I found for this is to treat dark colours as transparent and light ones as visible. This doesn't fully fix the issue as the moon is gray so a little bit of colour bleeds through, but it does mitigate it. A problem with this is that it completely breaks down as soon as resource packs mess with the moon's colour, or make it darker. In your case the sides of the moon are darker which does concern me...

These are the results on my end using this method:

no fix image

fix image

I don't really know of any solution of this problem other than using a custom resource pack which is effectively impossible. Still, here's a test jar (inside the zipped folder) you can use with the new blending method to see if it improves things. If so, I will publish a release with it.

snapshot.zip

Edit:

I am aware this breaks during the day, if the nebulas are disabled, and in 100 other case scenarios, and I will probably fix those issues if it ever gets its way into a release

DagothUrTheFalse commented 1 year ago

Here is the resource pack I was using, the darkness on the sides of the moon in other screenshots was from the phase https://modrinth.com/resourcepack/cubic-sun-moon

It seems to have had a negative effect unfortunately while trying your fix, you may need to adjust the sensitivity, perhaps so it only makes near complete black pixels transparent. For now it has caused the sun to darken and for the moon to be slightly less visible while keeping the nebulae for the most part, the current fix also likely to still show nebulae over a new moon even in vanilla resource packs.

without "fix" 2023-07-19_15 42 10 2023-07-19_15 46 01

with "fix"

2023-07-19_15 40 58 2023-07-19_15 45 04

DagothUrTheFalse commented 1 year ago

Examples with other resource packs perhaps i have something that incompatible with the fix somehow, also the nebulae being visible during day with the fix is a problem as I have that disabled.

2023-07-19_15 56 03 2023-07-19_15 56 29 2023-07-19_15 57 32

2023-07-19_15 59 17 2023-07-19_15 59 57

ZtereoHYPE commented 1 year ago

This was the outcome I feared. I can’t really tweak values as all I did was telling OpenGL to use colour for blending instead of the (missing) alpha values.

I appreciate the time you spemt testing this, but I fear for the time being I can’t really fix this issue. I will still look into it further, but don’t get your hopes up 😅

DagothUrTheFalse commented 1 year ago

Its understandable, thank you for the effort you put in, best of luck to you. Maybe reach out in some minecraft modding discords, maybe someone will have some weird work-around idea that can help you.

ZtereoHYPE commented 1 year ago

Making this a stretch goal for v1.3.0 of nicer skies

DagothUrTheFalse commented 4 weeks ago

I'd like to say that although it might just be luck with my seed but I haven't noticed the problem anytime since he most recent version, though I'll keep an eye on it, feel free to close this issue if you have solved it.

DagothUrTheFalse commented 4 weeks ago

Seems it is still present, far less noticable on some seeds than others though, so I'm still not broken up over it. image image