IrisShaders / Iris

A modern shaders mod for Minecraft compatible with existing OptiFine shader packs
https://irisshaders.dev
GNU Lesser General Public License v3.0
3.36k stars 641 forks source link

Allow shaders to specify dimension overrides by dimension name instead of by integer identifiers #292

Closed coderbot16 closed 1 year ago

coderbot16 commented 3 years ago

This is necessary for non vanilla dimension overrides to work at all on 1.16+. Integer identifiers are only a reliable way of naming dimensions on earlier versions, and are unstable on 1.16 and above.

OttCS commented 2 years ago

This would be incredibly helpful! This is part of the reason complementary blew up huge: They support a TON of custom dimensions like the Twilight forest.

At the very least, it'd be useful to have a uniform int that tells if there's a sun/moon as well as one for if the dimension has a roof. Instead of having to implement a dimension name detection in the shader, those are generally the only pieces of data needed to more accurately light the world.

I don't know about the technical feasibility of this, but I'll start poking around in data packs and the Optifine ShaderDoc to see if I can find anything that makes this feasible.

NOTE: I do know that compatibility is still the number one goal and this would be a HUGE workflow change, I'm just tossing my opinion out there.

IMS212 commented 2 years ago

The uniform idea would be really simple, but won't work in many cases sadly.

OttCS commented 2 years ago

Darn, I was just hoping IRIS could access the new dimension data pack things that specify skylight/roof. Oh well

IMS212 commented 2 years ago

It can, I meant that it wouldn't be enough for most shaders.

OttCS commented 2 years ago

OH I get it. Is there a uniform for it or is there a workaround way that you know of for detecting if a dimension has a skylight and/or roof? Thanks for the help

IMS212 commented 2 years ago

We can easily add it, it's more of a question of if it'd be actually useful to shader developers, which the answer is likely no.

OttCS commented 2 years ago

I'd definitely find it super useful, it'd allow shaders to provide a decent stand-in visual estimate for data packs that use custom dimensions. I'm working on GravityShade right now, and it would be much simpler to add "if (hasSkyLight== 1) {...}" to light dimensions differently. It'd definitely beat making a "default" shader for custom dimensions that only has one method of lighting, or making duplicates of the files in world1/world-1/world# to support custom datapacks one at a time.

Just an added note: If this does end up being added, keeping the uniform names consistent with datapack options would nice. The shader-relevant datapack attributes are:

This could also help datapack developers make their datapack dimensions look closer to what they want with shaders.

Thanks, and let me know if I can help out at all! I appreciate the work you all are doing 👍

IMS212 commented 1 year ago

Done.