JameH2 / Hbm-s-Nuclear-Tech-GIT

A blazing wreck of a minecraft mod about nuclear technology that is somehow still in development. (for meme use)
GNU General Public License v3.0
58 stars 19 forks source link

About Skybox & Shaders #87

Open Darek505 opened 1 month ago

Darek505 commented 1 month ago

Edited: See 2 messages below

Darek505 commented 2 days ago

Skybox

So, as it turned out, all these problems arise due to overwriting the skybox. I removed almost everything in SkyProviderCelestial, but the problem remained. Removing world.provider.setSkyRenderer(new SkyProviderCelestial()); from ModEventHandlerClient solved the problem on earth, but the rest of the planets implement the skybox directly: https://github.com/JameH2/Hbm-s-Nuclear-Tech-GIT/blob/091fb8ebd3becaede22009aad778bfb84096aefa/src/main/java/com/hbm/dim/WorldProviderCelestial.java#L410-L414

So this cannot be resolved there yet. (or can, but need to study it in detail)


More relevant to https://github.com/JameH2/Hbm-s-Nuclear-Tech-GIT/issues/123, but also suitable for fixing skybox on earth with shaders

By the way, there is another question: why can't we use chainloader on the earth? Basically, chainloader renders the current skybox (for example from a mod) and overlays the bobmazon satellite and digamma star renders on it. And if we need to change the color of the sky in accordance with the atmosphere (quote: "if you change the atmospheric composition of the Earth, but the skybox remains a cool blue, you'll suffocate with no indication as to why"), why can't we add a color effect on top of the skybox?

This can be imagined as a small box underneath the main skybox, which is normally transparent, but as soon as the atmosphere changes, we change the color of the box from full-transparent to the semi-transparent with color of the skybox (we can do this gradually, increasing alpha, as the atmosphere color change increases).

This is actually pretty good: until you change the atmosphere, you'll see your cool (or not) modded skybox, and when the atmosphere changes, you'll see a semi-transparent atmosphere-colored box so you know from what you're going to die (suffocate), and the modded skybox will show through a bit

At least that's the best I can come up with for now (we have a death cause in the form of a changed atmosphere color and a modded skybox, better than either of those separately)

At the very least, if an invisible/semi-transparent atmosphere-colored box underneath the main skybox is a crap, it could be a config option for those who really want a modded skybox (or proper shaders)

This is roughly what I meant: ![301321321321](https://github.com/user-attachments/assets/40410c1d-4213-4b63-b034-9e7405b845dc) This is without changing the atmosphere, the ntm space skybox remains invisible, so we can see the mod skybox without problems ![21321321](https://github.com/user-attachments/assets/bcddb54d-5919-4c68-a755-aa67241a45b9) Here the atmosphere changed (for example, xenon), the ntm space skybox became semi-transparent, with the color of the atmosphere (purple from xenon). Since the skybox is semi-transparent, we can see a little of the mod skybox, but with a tint from our atmosphere skybox
Darek505 commented 1 day ago

Shaders

So, here's some updated information regarding shaders (namely, how shaders behave with ntm space skyboxes):

Optifine

Shader name State Overall rating
builders-modded-shaders-v2.4.1 Lighting bug, No ntm skybox 🟧
ComplementaryReimagined_r5.2.2 Works βœ…
BSL_v8.2.09 Works βœ…
projectLUMA-v1.54 Lighting bug, Shadow bug, GL leak ❌
SEUS Renewed No ntm skybox 🟧
Sildur's+Enhanced+Default+v1.16+Fast Lighting bug, Shadow bug 🟧
Sildur's+Vibrant+Shaders+v1.51+Extreme Broken ❌

Angelica

Shader name State Overall rating
builders-modded-shaders-v2.4.1 Unstable (sometimes it works, sometimes it doesn’t (sometimes it crashes)) ❌
ComplementaryReimagined_r5.2.2 Partially works (angelica errors) 🟧
BSL_v8.2.09 Partially works (angelica errors) 🟧
projectLUMA-v1.54 Broken (GL leak) ❌
SEUS Renewed Broken (angelica) ❌
Sildur's+Enhanced+Default+v1.16+Fast Overall it works (no Lighting bug, Shadow bug not very visible) βœ…
Sildur's+Vibrant+Shaders+v1.51+Extreme Broken (angelica?) ❌
Darek505 commented 1 day ago

Additional information:

1) All tests above contain a bug that causes the skybox to flicker. This can be fixed by binding a completely transparent texture to the skybox in all places where tessellator.addVertex (NOT tessellator.addVertexWithUV) is used. More info

2) The fix suggested in the "Skybox" comment (using chainloader + box underneath main skybox) will work on earth, but not on other planets (On earth, we use chainloader to render the shader skybox and skybox from ntm (because the earth is part of vanilla and uses vanilla SkyProvider there will be no bugs (similar to weakSkyRender from AstralSorcery)) Other planets use SkyProviderCelestial, which is different from overworld's vanilla SkyProvider , so bugs appear). While this can probably be fixed by using mixins in optifine (doesn't make much sense), it will need to be reported to the angelica bug tracker when they start testing the shaders (as these are common bugs caused by using a third party skybox in dimensions other than -1,0,1. The same thing happens for example in galacticraft, twilight forest, etc.)