sp614x / optifine

1.8k stars 418 forks source link

World sea level as macro WORLD_SEA_LEVEL #676

Open sp614x opened 7 years ago

sp614x commented 7 years ago

Add world sea level as a macro "#define WORLD_SEA_LEVEL 64.0". Alternatively an uniform. Request by @jaekmichie97.

Builderb0y commented 7 years ago

Alternatively an uniform.

Correct me if I'm wrong, but I'm pretty sure the only way for the sea level to change while in-game would be if you changed dimensions. Since shaders are already reloaded when this happens, making it a uniform is not necessary; macros will do just fine. In fact, macros would also make it easier to add backwards-compatibility for older versions of optifine which don't support it.

sp614x commented 6 years ago

The sea level is only defined for the overworld in for single-player mode. The nether could use the lava level (fixed) and the end does not have a sea level at all.

This would not work in multiplayer (overworld) or with custom maps (sky block).