From 802d7887b67155bbf70eaca40d08d18cfa1f8b4c Mon Sep 17 00:00:00 2001 From: Merlin1809 <88194861+Merlin1809@users.noreply.github.com> Date: Sun, 23 Nov 2025 18:48:33 +0100 Subject: [PATCH] Fix aether and twilight forest dimensions --- shaders/world0_with_aether_flag/begin.csh | 5 ++++ .../gbuffers_terrain.gsh | 7 +++++ .../gbuffers_terrain.tcs | 7 +++++ .../gbuffers_terrain.tes | 7 +++++ shaders/world0_with_aether_flag/shadow.vsh | 26 +++++++++++++++---- .../begin.csh | 5 ++++ .../gbuffers_terrain.gsh | 7 +++++ .../gbuffers_terrain.tcs | 7 +++++ .../gbuffers_terrain.tes | 7 +++++ .../shadow.vsh | 26 +++++++++++++++---- 10 files changed, 94 insertions(+), 10 deletions(-) create mode 100644 shaders/world0_with_aether_flag/begin.csh create mode 100644 shaders/world0_with_aether_flag/gbuffers_terrain.gsh create mode 100644 shaders/world0_with_aether_flag/gbuffers_terrain.tcs create mode 100644 shaders/world0_with_aether_flag/gbuffers_terrain.tes create mode 100644 shaders/world0_with_twilight_forest_flag/begin.csh create mode 100644 shaders/world0_with_twilight_forest_flag/gbuffers_terrain.gsh create mode 100644 shaders/world0_with_twilight_forest_flag/gbuffers_terrain.tcs create mode 100644 shaders/world0_with_twilight_forest_flag/gbuffers_terrain.tes diff --git a/shaders/world0_with_aether_flag/begin.csh b/shaders/world0_with_aether_flag/begin.csh new file mode 100644 index 0000000..10de247 --- /dev/null +++ b/shaders/world0_with_aether_flag/begin.csh @@ -0,0 +1,5 @@ +#version 430 + +#define OVERWORLD_SHADER + +#include "/dimensions/begin.csh" \ No newline at end of file diff --git a/shaders/world0_with_aether_flag/gbuffers_terrain.gsh b/shaders/world0_with_aether_flag/gbuffers_terrain.gsh new file mode 100644 index 0000000..e690daa --- /dev/null +++ b/shaders/world0_with_aether_flag/gbuffers_terrain.gsh @@ -0,0 +1,7 @@ +#version 430 compatibility + +#define OVERWORLD_SHADER + +#define WORLD + +#include "/dimensions/all_solid.gsh" \ No newline at end of file diff --git a/shaders/world0_with_aether_flag/gbuffers_terrain.tcs b/shaders/world0_with_aether_flag/gbuffers_terrain.tcs new file mode 100644 index 0000000..b764b85 --- /dev/null +++ b/shaders/world0_with_aether_flag/gbuffers_terrain.tcs @@ -0,0 +1,7 @@ +#version 430 compatibility + +#define OVERWORLD_SHADER + +#define WORLD + +#include "/dimensions/all_solid.tcs" \ No newline at end of file diff --git a/shaders/world0_with_aether_flag/gbuffers_terrain.tes b/shaders/world0_with_aether_flag/gbuffers_terrain.tes new file mode 100644 index 0000000..fde3ac9 --- /dev/null +++ b/shaders/world0_with_aether_flag/gbuffers_terrain.tes @@ -0,0 +1,7 @@ +#version 430 compatibility + +#define OVERWORLD_SHADER + +#define WORLD + +#include "/dimensions/all_solid.tes" \ No newline at end of file diff --git a/shaders/world0_with_aether_flag/shadow.vsh b/shaders/world0_with_aether_flag/shadow.vsh index cc5b6c9..472da41 100644 --- a/shaders/world0_with_aether_flag/shadow.vsh +++ b/shaders/world0_with_aether_flag/shadow.vsh @@ -1,6 +1,9 @@ #version 430 compatibility +#include "/lib/SSBOs.glsl" + + #include "/lib/settings.glsl" -#ifdef IS_LPV_ENABLED +#if defined IS_LPV_ENABLED || WATER_INTERACTION == 2 || defined SHADER_GRASS #extension GL_ARB_explicit_attrib_location: enable #extension GL_ARB_shader_image_load_store: enable #endif @@ -28,6 +31,7 @@ uniform mat4 gbufferProjection; uniform mat4 gbufferProjectionInverse; uniform int hideGUI; uniform vec3 cameraPosition; +uniform vec3 relativeEyePosition; uniform float frameTimeCounter; uniform int frameCounter; uniform float screenBrightness; @@ -43,6 +47,7 @@ uniform vec3 shadowLightVec; uniform float shadowMaxProj; attribute vec4 mc_midTexCoord; varying vec4 color; +varying vec3 vertexPos; attribute vec4 mc_Entity; uniform int blockEntityId; @@ -53,7 +58,7 @@ uniform int entityId; #include "/lib/blocks.glsl" #include "/lib/entities.glsl" -#ifdef IS_LPV_ENABLED +#if defined IS_LPV_ENABLED || WATER_INTERACTION == 2 || defined SHADER_GRASS #ifdef IRIS_FEATURE_BLOCK_EMISSION_ATTRIBUTE attribute vec4 at_midBlock; #else @@ -69,6 +74,8 @@ uniform int entityId; const float PI48 = 150.796447372*WAVY_SPEED; float pi2wt = PI48*frameTimeCounter; +out float LIGHTNING; + vec2 calcWave(in vec3 pos) { float magnitude = abs(sin(dot(vec4(frameTimeCounter, pos),vec4(1.0,0.005,0.005,0.005)))*0.5+0.72)*0.013; @@ -138,6 +145,8 @@ vec3 viewToWorld(vec3 viewPos) { return pos.xyz; } +varying vec3 playerpos; + // uniform int renderStage; // uniform mat4 gbufferModelViewInverse; @@ -199,10 +208,10 @@ void main() { // #endif // #if defined IS_LPV_ENABLED || defined WAVY_PLANTS || !defined PLANET_CURVATURE - vec3 playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz; + playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz; // #endif - #if defined IS_LPV_ENABLED && defined MC_GL_ARB_shader_image_load_store + #if defined IS_LPV_ENABLED && defined MC_GL_ARB_shader_image_load_store || WATER_INTERACTION == 2 || defined SHADER_GRASS PopulateShadowVoxel(playerpos); #endif @@ -255,12 +264,19 @@ void main() { } #endif + LIGHTNING = 0.0; + if (entityId == ENTITY_LIGHTNING) LIGHTNING = 1.0; + #ifdef PLANET_CURVATURE float curvature = length(worldpos) / (16*8); worldpos.y -= curvature*curvature * CURVATURE_AMOUNT; #endif - position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz; + #ifdef CUSTOM_MOON_ROTATION + position = mat3(customShadowMatrixSSBO) * worldpos + customShadowMatrixSSBO[3].xyz; + #else + position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz; + #endif #ifdef DISTORT_SHADOWMAP if (entityId == ENTITY_SSS_MEDIUM || entityId == ENTITY_SLIME) diff --git a/shaders/world0_with_twilight_forest_flag/begin.csh b/shaders/world0_with_twilight_forest_flag/begin.csh new file mode 100644 index 0000000..10de247 --- /dev/null +++ b/shaders/world0_with_twilight_forest_flag/begin.csh @@ -0,0 +1,5 @@ +#version 430 + +#define OVERWORLD_SHADER + +#include "/dimensions/begin.csh" \ No newline at end of file diff --git a/shaders/world0_with_twilight_forest_flag/gbuffers_terrain.gsh b/shaders/world0_with_twilight_forest_flag/gbuffers_terrain.gsh new file mode 100644 index 0000000..e690daa --- /dev/null +++ b/shaders/world0_with_twilight_forest_flag/gbuffers_terrain.gsh @@ -0,0 +1,7 @@ +#version 430 compatibility + +#define OVERWORLD_SHADER + +#define WORLD + +#include "/dimensions/all_solid.gsh" \ No newline at end of file diff --git a/shaders/world0_with_twilight_forest_flag/gbuffers_terrain.tcs b/shaders/world0_with_twilight_forest_flag/gbuffers_terrain.tcs new file mode 100644 index 0000000..b764b85 --- /dev/null +++ b/shaders/world0_with_twilight_forest_flag/gbuffers_terrain.tcs @@ -0,0 +1,7 @@ +#version 430 compatibility + +#define OVERWORLD_SHADER + +#define WORLD + +#include "/dimensions/all_solid.tcs" \ No newline at end of file diff --git a/shaders/world0_with_twilight_forest_flag/gbuffers_terrain.tes b/shaders/world0_with_twilight_forest_flag/gbuffers_terrain.tes new file mode 100644 index 0000000..fde3ac9 --- /dev/null +++ b/shaders/world0_with_twilight_forest_flag/gbuffers_terrain.tes @@ -0,0 +1,7 @@ +#version 430 compatibility + +#define OVERWORLD_SHADER + +#define WORLD + +#include "/dimensions/all_solid.tes" \ No newline at end of file diff --git a/shaders/world0_with_twilight_forest_flag/shadow.vsh b/shaders/world0_with_twilight_forest_flag/shadow.vsh index cc5b6c9..472da41 100644 --- a/shaders/world0_with_twilight_forest_flag/shadow.vsh +++ b/shaders/world0_with_twilight_forest_flag/shadow.vsh @@ -1,6 +1,9 @@ #version 430 compatibility +#include "/lib/SSBOs.glsl" + + #include "/lib/settings.glsl" -#ifdef IS_LPV_ENABLED +#if defined IS_LPV_ENABLED || WATER_INTERACTION == 2 || defined SHADER_GRASS #extension GL_ARB_explicit_attrib_location: enable #extension GL_ARB_shader_image_load_store: enable #endif @@ -28,6 +31,7 @@ uniform mat4 gbufferProjection; uniform mat4 gbufferProjectionInverse; uniform int hideGUI; uniform vec3 cameraPosition; +uniform vec3 relativeEyePosition; uniform float frameTimeCounter; uniform int frameCounter; uniform float screenBrightness; @@ -43,6 +47,7 @@ uniform vec3 shadowLightVec; uniform float shadowMaxProj; attribute vec4 mc_midTexCoord; varying vec4 color; +varying vec3 vertexPos; attribute vec4 mc_Entity; uniform int blockEntityId; @@ -53,7 +58,7 @@ uniform int entityId; #include "/lib/blocks.glsl" #include "/lib/entities.glsl" -#ifdef IS_LPV_ENABLED +#if defined IS_LPV_ENABLED || WATER_INTERACTION == 2 || defined SHADER_GRASS #ifdef IRIS_FEATURE_BLOCK_EMISSION_ATTRIBUTE attribute vec4 at_midBlock; #else @@ -69,6 +74,8 @@ uniform int entityId; const float PI48 = 150.796447372*WAVY_SPEED; float pi2wt = PI48*frameTimeCounter; +out float LIGHTNING; + vec2 calcWave(in vec3 pos) { float magnitude = abs(sin(dot(vec4(frameTimeCounter, pos),vec4(1.0,0.005,0.005,0.005)))*0.5+0.72)*0.013; @@ -138,6 +145,8 @@ vec3 viewToWorld(vec3 viewPos) { return pos.xyz; } +varying vec3 playerpos; + // uniform int renderStage; // uniform mat4 gbufferModelViewInverse; @@ -199,10 +208,10 @@ void main() { // #endif // #if defined IS_LPV_ENABLED || defined WAVY_PLANTS || !defined PLANET_CURVATURE - vec3 playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz; + playerpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz; // #endif - #if defined IS_LPV_ENABLED && defined MC_GL_ARB_shader_image_load_store + #if defined IS_LPV_ENABLED && defined MC_GL_ARB_shader_image_load_store || WATER_INTERACTION == 2 || defined SHADER_GRASS PopulateShadowVoxel(playerpos); #endif @@ -255,12 +264,19 @@ void main() { } #endif + LIGHTNING = 0.0; + if (entityId == ENTITY_LIGHTNING) LIGHTNING = 1.0; + #ifdef PLANET_CURVATURE float curvature = length(worldpos) / (16*8); worldpos.y -= curvature*curvature * CURVATURE_AMOUNT; #endif - position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz; + #ifdef CUSTOM_MOON_ROTATION + position = mat3(customShadowMatrixSSBO) * worldpos + customShadowMatrixSSBO[3].xyz; + #else + position = mat3(shadowModelView) * worldpos + shadowModelView[3].xyz; + #endif #ifdef DISTORT_SHADOWMAP if (entityId == ENTITY_SSS_MEDIUM || entityId == ENTITY_SLIME)