fix translucent reflections not working in the end/nether on iris

This commit is contained in:
Xonk 2023-08-03 17:40:08 -04:00
parent 848cccd9da
commit 3096f7a9ba
2 changed files with 75 additions and 95 deletions

View File

@ -1,67 +1,53 @@
// #version 120
//#extension GL_EXT_gpu_shader4 : disable
#include "/lib/settings.glsl"
#include "/lib/res_params.glsl"
varying vec4 lmtexcoord;
varying vec4 color;
uniform sampler2D normals;
varying vec4 tangent;
const bool colortex4MipmapEnabled = true;
uniform sampler2D noisetex;
uniform sampler2D depthtex1;
uniform sampler2D colortex5;
uniform sampler2D texture;
uniform sampler2D specular;
uniform sampler2D normals;
varying vec4 tangent;
varying vec4 normalMat;
varying vec3 binormal;
varying vec3 viewVector;
#include "/lib/settings.glsl"
#include "/lib/res_params.glsl"
uniform sampler2D texture;
uniform sampler2D noisetex;
uniform sampler2DShadow shadow;
// uniform sampler2D gaux2;
// uniform sampler2D gaux1;
uniform sampler2D colortex5;
uniform sampler2D depthtex1;
const bool colortex4MipmapEnabled = true;
uniform vec3 sunVec;
uniform float frameTimeCounter;
uniform float lightSign;
uniform float near;
uniform float far;
uniform float sunElevation;
uniform int isEyeInWater;
uniform float rainStrength;
uniform float skyIntensityNight;
uniform float skyIntensity;
uniform int frameCounter;
uniform float frameTimeCounter;
uniform vec2 texelSize;
uniform int framemod8;
flat varying vec3 WsunVec;
uniform mat4 gbufferPreviousModelView;
uniform vec3 previousCameraPosition;
uniform float moonIntensity;
uniform float sunIntensity;
uniform vec3 sunColor;
uniform vec3 nsunColor;
uniform vec3 upVec;
uniform float sunElevation;
uniform float fogAmount;
uniform vec2 texelSize;
uniform float rainStrength;
uniform float skyIntensityNight;
uniform float skyIntensity;
flat varying vec3 WsunVec;
uniform mat4 gbufferPreviousModelView;
uniform vec3 previousCameraPosition;
uniform int framemod8;
uniform sampler2D specular;
uniform int frameCounter;
uniform int isEyeInWater;
uniform ivec2 eyeBrightness;
uniform ivec2 eyeBrightnessSmooth;
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
flat varying vec3 averageSkyCol_Clouds;
// flat varying vec3 averageSkyCol;
#include "/lib/Shadow_Params.glsl"
@ -72,7 +58,7 @@ flat varying vec3 averageSkyCol_Clouds;
#include "/lib/clouds.glsl"
#include "/lib/stars.glsl"
#include "/lib/volumetricClouds.glsl"
#define OVERWORLD_SHADER
#define OVERWORLD
#include "/lib/diffuse_lighting.glsl"
@ -298,6 +284,7 @@ if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize
vec4 COLORTEST = vec4(Albedo,UnchangedAlpha);
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos + gbufferModelViewInverse[3].xyz;
vec3 normal = normalMat.xyz;
@ -336,6 +323,7 @@ if (gl_FragCoord.x * texelSize.x < RENDER_SCALE.x && gl_FragCoord.y * texelSize
gl_FragData[2] = vec4(encodeVec2(TangentNormal), encodeVec2(COLORTEST.rg), encodeVec2(COLORTEST.ba), UnchangedAlpha);
vec3 WS_normal = viewToWorld(normal);
vec2 lightmaps2 = lmtexcoord.zw;

View File

@ -2,7 +2,7 @@
//#extension GL_EXT_gpu_shader4 : disable
#include "/lib/settings.glsl"
#include "/lib/res_params.glsl"
#include "/lib/bokeh.glsl"
/*
!! DO NOT REMOVE !!
@ -15,7 +15,8 @@ varying vec4 lmtexcoord;
varying vec4 color;
varying vec4 normalMat;
varying vec3 binormal;
varying vec3 tangent;
varying vec4 tangent;
uniform mat4 gbufferModelViewInverse;
varying vec3 viewVector;
@ -32,34 +33,33 @@ uniform float sunElevation;
varying vec4 tangent_other;
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
flat varying vec3 avgAmbient;
uniform int frameCounter;
uniform float far;
uniform float aspectRatio;
uniform float viewHeight;
uniform float viewWidth;
uniform int hideGUI;
uniform float screenBrightness;
uniform vec2 texelSize;
uniform int framemod8;
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
vec2(-1.,3.)/8.,
vec2(5.0,1.)/8.,
vec2(-3,-5.)/8.,
vec2(-5.,5.)/8.,
vec2(-7.,-1.)/8.,
vec2(3,7.)/8.,
vec2(7.,-7.)/8.);
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
vec2(-1.,3.)/8.,
vec2(5.0,1.)/8.,
vec2(-3,-5.)/8.,
vec2(-5.,5.)/8.,
vec2(-7.,-1.)/8.,
vec2(3,7.)/8.,
vec2(7.,-7.)/8.);
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
vec4 toClipSpace3(vec3 viewSpacePosition) {
return vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition),-viewSpacePosition.z);
}
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
@ -71,57 +71,49 @@ void main() {
vec4 Swtich_gl_vertex = gl_Vertex;
lmtexcoord.xy = (gl_MultiTexCoord0).xy;
vec2 lmcoord = gl_MultiTexCoord1.xy/255.;
vec2 lmcoord = gl_MultiTexCoord1.xy / 255.0; // is this even correct? lol
lmtexcoord.zw = lmcoord;
vec3 position = mat3(gl_ModelViewMatrix) * vec3(Swtich_gl_vertex) + gl_ModelViewMatrix[3].xyz;
gl_Position = toClipSpace3(position);
color = gl_Color;
color = vec4(gl_Color.rgb,1.0);
float mat = 0.0;
if(mc_Entity.x == 8.0 || mc_Entity.x == 9.0) {
mat = 1.0;
if(mc_Entity.x == 8.0) {
mat = 1.0;
gl_Position.z -= 1e-4;
}
gl_Position.z -= 1e-4;
}
if (mc_Entity.x == 10002) mat = 0.2;
if (mc_Entity.x == 72) mat = 0.5;
// if (mc_Entity.x == 8) mat = 0.1;
#ifdef ENTITIES
mat = 0.2;
#endif
normalMat = vec4(normalize( gl_NormalMatrix*gl_Normal),mat);
tangent = vec4(normalize(gl_NormalMatrix *at_tangent.rgb),at_tangent.w);
normalMat = vec4(normalize(gl_NormalMatrix * gl_Normal), 1.0);
normalMat.a = mat;
vec3 tangent2 = normalize( gl_NormalMatrix *at_tangent.rgb);
binormal = normalize(cross(tangent2.rgb,normalMat.xyz)*at_tangent.w);
tangent_other = vec4(normalize(gl_NormalMatrix * at_tangent.rgb),normalMat.a);
tangent = normalize( gl_NormalMatrix *at_tangent.rgb);
binormal = normalize(cross(tangent.rgb,normalMat.xyz)*at_tangent.w);
mat3 tbnMatrix = mat3(tangent.x, binormal.x, normalMat.x,
tangent.y, binormal.y, normalMat.y,
tangent.z, binormal.z, normalMat.z);
mat3 tbnMatrix = mat3(tangent2.x, binormal.x, normalMat.x,
tangent2.y, binormal.y, normalMat.y,
tangent2.z, binormal.z, normalMat.z);
viewVector = ( gl_ModelViewMatrix * Swtich_gl_vertex).xyz;
viewVector = normalize(tbnMatrix * viewVector);
// #ifdef TAA_UPSCALING
// gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
// #endif
#ifdef TAA_UPSCALING
gl_Position.xy = gl_Position.xy * RENDER_SCALE + RENDER_SCALE * gl_Position.w - gl_Position.w;
#endif
#ifdef TAA
gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize;
#endif
vec3 sc = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
lightCol.a = float(sunElevation > 1e-5)*2-1.;
lightCol.rgb = sc;
WsunVec = lightCol.a*normalize(mat3(gbufferModelViewInverse) *sunPosition);
avgAmbient = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
}