Skip to content

Commit

Permalink
Reimagined r2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
EminGT committed Mar 7, 2023
1 parent 13b5df2 commit d45e638
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
5 changes: 3 additions & 2 deletions shaders/lib/atmospherics/volumetricLight.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ vec4 DistortShadow(vec4 shadowpos, float distortFactor) {
vec4 GetVolumetricLight(inout float vlFactor, vec3 translucentMult, float lViewPos, vec3 nViewPos, float VdotL, float VdotU, vec2 texCoord, float z0, float z1, float dither) {
if (max(blindness, darknessFactor) > 0.1) return vec4(0.0);
vec4 volumetricLight = vec4(0.0);
vec3 vlColorReducer = vec3(1.0);

#ifdef OVERWORLD
vec3 vlColor = lightColor;
Expand All @@ -33,10 +34,10 @@ vec4 GetVolumetricLight(inout float vlFactor, vec3 translucentMult, float lViewP
vlMult = 0.6 + 0.4 * max0(far - lViewPos) / far;
vlColor = normalize(pow(vlColor, vec3(1.0 - max0(1.0 - 1.5 * nightFactor))));
vlColor *= 0.0766 + 0.0766 * vsBrightness;
} else {
vlColorReducer = 1.0 / sqrt(vlColor);
}

vec3 vlColorReducer = 1.0 / sqrt(vlColor);

float VdotLM = max((VdotL + 1.0) / 2.0, 0.0);
float VdotUM = mix(pow2(1.0 - max(VdotU, 0.0)), 1.0, 0.5 * vlSceneIntensity);
VdotUM = smoothstep1(VdotUM);
Expand Down
23 changes: 12 additions & 11 deletions shaders/lib/materials/materialHandling/terrainMaterials.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1436,23 +1436,24 @@ if (mat < 10512) {
noSmoothLighting = true;
lmCoordM.x = 0.77;

if (color.r < color.b) { // Lantern:Metal Part
#include "/lib/materials/specificMaterials/terrain/lanternMetal.glsl"
} else { // Lantern:Emissive Part
emission = pow2(color.g) * 5.0 + 1.0;
#include "/lib/materials/specificMaterials/terrain/lanternMetal.glsl"

color.gb *= vec2(0.8, 0.7);
}
emission = 3.0 * max0(color.r - color.b);
emission += min(pow2(pow2(0.75 * dot(color.rgb, color.rgb))), 5.0);
color.gb *= pow(vec2(0.8, 0.7), vec2(sqrt(emission) * 0.5));

#ifdef SNOWY_WORLD
snowFactor = 0.0;
#endif
}
else /*if (mat == 10564)*/ { // Soul Lantern
noSmoothLighting = true;
lmCoordM.x = min(lmCoordM.x, 0.77); // consistency748523

if (min1(color.r * 3.0) >= color.g + 0.25) { // Soul Lantern:Metal Part
#include "/lib/materials/specificMaterials/terrain/lanternMetal.glsl"
} else { // Soul Lantern:Emissive Part
emission = color.r * 3.0 + 0.5;
}
#include "/lib/materials/specificMaterials/terrain/lanternMetal.glsl"

emission = 0.9 * max0(color.g - color.r * 2.0);
emission += min(pow2(pow2(0.55 * dot(color.rgb, color.rgb))), 3.5);

#ifdef SNOWY_WORLD
snowFactor = 0.0;
Expand Down
11 changes: 9 additions & 2 deletions shaders/lib/materials/specificMaterials/terrain/lava.glsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
// Tweak to revent the animation of lava causing brightness pulsing
color.rgb /= (max(GetLuminance(texture2DLod(texture, texCoord, 100.0).rgb) * 2.5, 0.001));
// Tweak to prevent the animation of lava causing brightness pulsing
vec3 avgColor = vec3(0.0);
ivec2 itexCoordC = ivec2(midCoord * atlasSize + 0.0001);
for (int x = -8; x < 8; x += 2) {
for (int y = -8; y < 8; y += 2) {
avgColor += texelFetch(texture, itexCoordC + ivec2(x, y), 0).rgb;
}
}
color.rgb /= (max(GetLuminance(avgColor) * 0.0390625, 0.001));

#ifdef NETHER
vec3 worldPos = playerPos + cameraPosition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ glColorM = sqrt1(glColorM) * vec3(1.0, 0.85, 0.8);
#endif

#define PHYSICS_OCEAN_INJECTION
#if defined GENERATED_NORMALS && WATER_STYLE >= 3 || defined PHYSICS_OCEAN
#if defined GENERATED_NORMALS && (WATER_STYLE >= 3 || defined PHYSICS_OCEAN)
noGeneratedNormals = true;
#endif

Expand Down
4 changes: 3 additions & 1 deletion shaders/program/gbuffers_terrain.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ in vec2 texCoord;
in vec2 lmCoord;
in vec2 signMidCoordPos;
flat in vec2 absMidCoordPos;
flat in vec2 midCoord;

flat in vec3 upVec, sunVec, northVec, eastVec;
in vec3 normal;
Expand Down Expand Up @@ -342,6 +343,7 @@ out vec2 texCoord;
out vec2 lmCoord;
out vec2 signMidCoordPos;
flat out vec2 absMidCoordPos;
flat out vec2 midCoord;

flat out vec3 upVec, sunVec, northVec, eastVec;
out vec3 normal;
Expand Down Expand Up @@ -400,7 +402,7 @@ void main() {
northVec = normalize(gbufferModelView[2].xyz);
sunVec = GetSunVector();

vec2 midCoord = (gl_TextureMatrix[0] * mc_midTexCoord).st;
midCoord = (gl_TextureMatrix[0] * mc_midTexCoord).st;
vec2 texMinMidCoord = texCoord - midCoord;
signMidCoordPos = sign(texMinMidCoord);
absMidCoordPos = abs(texMinMidCoord);
Expand Down

0 comments on commit d45e638

Please sign in to comment.