diff --git a/gradle.properties b/gradle.properties index e535693..ba0cfd7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,5 +24,5 @@ compatibleVersions=1.21.1 compatibleLoaders=fabric # mod compat -enable_sodium=false +enable_sodium=true enable_axiom=false diff --git a/src/main/resources/assets/crystalline_sky/shaders/sodium_compat/block_layer_sky.fsh b/src/main/resources/assets/crystalline_sky/shaders/sodium_compat/block_layer_sky.fsh index ca4eb5a..a50fbdb 100644 --- a/src/main/resources/assets/crystalline_sky/shaders/sodium_compat/block_layer_sky.fsh +++ b/src/main/resources/assets/crystalline_sky/shaders/sodium_compat/block_layer_sky.fsh @@ -4,7 +4,7 @@ in vec4 v_Color; // The interpolated vertex color in vec4 v_TexProj; // The interpolated sky texture coordinates -in vec2 v_FragDistance; // The fragment's distance from the camera (cylindrical and spherical) +in float v_FragDistance; // The fragment's distance from the camera in float v_MaterialMipBias; in float v_MaterialAlphaCutoff; @@ -12,8 +12,8 @@ in float v_MaterialAlphaCutoff; uniform sampler2D u_BlockTex; // The block (sky) texture uniform vec4 u_FogColor; // The color of the shader fog -uniform vec2 u_EnvironmentFog; // The start and end position for environmental fog -uniform vec2 u_RenderFog; // The start and end position for border fog +uniform float u_FogStart; // The starting position of the shader fog +uniform float u_FogEnd; // The ending position of the shader fog uniform vec4 u_ColorModulator; @@ -46,5 +46,5 @@ void main() { } #endif - fragColor = _linearFog(diffuseColor, v_FragDistance, u_FogColor, u_EnvironmentFog, u_RenderFog); + fragColor = _linearFog(diffuseColor, v_FragDistance, u_FogColor, u_FogStart, u_FogEnd); } diff --git a/src/main/resources/assets/crystalline_sky/shaders/sodium_compat/block_layer_sky.vsh b/src/main/resources/assets/crystalline_sky/shaders/sodium_compat/block_layer_sky.vsh index 1ce49e2..990d002 100644 --- a/src/main/resources/assets/crystalline_sky/shaders/sodium_compat/block_layer_sky.vsh +++ b/src/main/resources/assets/crystalline_sky/shaders/sodium_compat/block_layer_sky.vsh @@ -16,9 +16,10 @@ out float v_MaterialAlphaCutoff; #endif #ifdef USE_FOG -out vec2 v_FragDistance; +out float v_FragDistance; #endif +uniform int u_FogShape; uniform vec3 u_RegionOffset; uvec3 _get_relative_chunk_coord(uint pos) { @@ -38,7 +39,7 @@ void main() { vec3 position = _vert_position + translation; #ifdef USE_FOG - v_FragDistance = getFragDistance(position); + v_FragDistance = getFragDistance(u_FogShape, position); #endif // Transform the vertex position into model-view-projection space