From d43e821ef20183694cd4202c7d43aacebb87236c Mon Sep 17 00:00:00 2001 From: Sasha Date: Thu, 14 Mar 2024 21:18:50 +0000 Subject: [PATCH] "fixed" aerochrome on dh chunks... its pretty far from perfect --- shaders/dimensions/DH_solid.fsh | 17 +++++++++++++++++ shaders/dimensions/DH_solid.vsh | 2 ++ shaders/dimensions/all_solid.fsh | 5 ++--- shaders/lib/settings.glsl | 1 + 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/shaders/dimensions/DH_solid.fsh b/shaders/dimensions/DH_solid.fsh index 01b4594..5603d90 100644 --- a/shaders/dimensions/DH_solid.fsh +++ b/shaders/dimensions/DH_solid.fsh @@ -7,6 +7,7 @@ varying vec2 lightmapCoords; varying vec4 normals_and_materials; flat varying float SSSAMOUNT; flat varying float EMISSIVE; +flat varying int dh_material_id; uniform float far; // uniform int hideGUI; @@ -123,6 +124,22 @@ void main() { // Albedo.rgb *= pow(noiseTexture, 0.6 * noiseFactor); // Albedo.rgb *= (noiseTexture*noiseTexture)*0.5 + 0.5; + #ifdef AEROCHROME_MODE + if(dh_material_id == DH_BLOCK_LEAVES || dh_material_id == DH_BLOCK_WATER) { // leaves and waterlogged blocks + float grey = dot(Albedo.rgb, vec3(0.2, 01.0, 0.07)); + Albedo.rgb = mix(vec3(grey), aerochrome_color, 0.7); + } else if(dh_material_id == DH_BLOCK_DIRT) { // dirt and grass + // separate out green colors as mask + float green = saturate(pow(normalize(Albedo.rgb).g, 3.0)); + // if(Albedo.r > 0.5) green += 0.15; + if(Albedo.b > 0.8) green += 0.15; + // calculate actual color + vec3 red = mix(Albedo.rgb, aerochrome_color, 1.0 - Albedo.g); + // apply color only to masked area + Albedo.rgb = green > 0.2 ? red : Albedo.rgb; + } + #endif + #ifdef WhiteWorld Albedo.rgb = vec3(0.5); #endif diff --git a/shaders/dimensions/DH_solid.vsh b/shaders/dimensions/DH_solid.vsh index b0e92a9..a5e0f18 100644 --- a/shaders/dimensions/DH_solid.vsh +++ b/shaders/dimensions/DH_solid.vsh @@ -7,6 +7,7 @@ varying vec2 lightmapCoords; varying vec4 normals_and_materials; flat varying float SSSAMOUNT; flat varying float EMISSIVE; +flat varying int dh_material_id; uniform vec2 texelSize; uniform int framemod8; @@ -83,6 +84,7 @@ void main() { float MATERIALS = 0.65; normals_and_materials = vec4(normalize(gl_NormalMatrix * gl_Normal), MATERIALS); + dh_material_id = dhMaterialId; #if DOF_QUALITY == 5 vec2 jitter = clamp(jitter_offsets[frameCounter % 64], -1.0, 1.0); diff --git a/shaders/dimensions/all_solid.fsh b/shaders/dimensions/all_solid.fsh index f0d1169..cb0c331 100644 --- a/shaders/dimensions/all_solid.fsh +++ b/shaders/dimensions/all_solid.fsh @@ -425,9 +425,8 @@ void main() { #ifdef AEROCHROME_MODE - vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631), AEROCHROME_PINKNESS); - float gray = dot(Albedo.rgb, vec3(0.2, 01.0, 0.07)); - if(blockID == 10001 || blockID == 10003 || blockID == 10004 || blockID == 10006) { + float gray = dot(Albedo.rgb, vec3(0.2, 1.0, 0.07)); + if(blockID == 10001 || blockID == 10003 || blockID == 10004 || blockID == 10006 || blockID == 10009) { // IR Reflective (Pink-red) Albedo.rgb = mix(vec3(gray), aerochrome_color, 0.7); } diff --git a/shaders/lib/settings.glsl b/shaders/lib/settings.glsl index 9a3c8c3..5d75855 100644 --- a/shaders/lib/settings.glsl +++ b/shaders/lib/settings.glsl @@ -568,6 +568,7 @@ uniform int moonPhase; // #define AEROCHROME_MODE // Infra-red film colors ^~^ // #define AEROCHROME_WOOL_ENABLED // Technically wool things should be affected but it affects a lot of builds and stuff #define AEROCHROME_PINKNESS 0.3 // How pink it is from red [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] +const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631), AEROCHROME_PINKNESS); //#define BICUBIC_UPSCALING