fix warden glowy parts

This commit is contained in:
Xonk 2023-06-30 17:07:47 -04:00
parent dab7d25472
commit bd08dab55f
6 changed files with 59 additions and 73 deletions

View File

@ -941,7 +941,7 @@ void main() {
#ifdef Variable_Penumbra_Shadows
SSS = SubsurfaceScattering_sun(albedo, SHADOWBLOCKERDEPTBH, LabSSS, clamp(dot(np3, WsunVec),0.0,1.0)) ;
SSS *= DirectLightColor;
if (isEyeInWater == 0) SSS *= lightleakfix; // light leak fix
#endif
@ -1053,7 +1053,7 @@ void main() {
#if indirect_effect != 1
ScreenSpace_SSS(SkySSS, fragpos, blueNoise(gl_FragCoord.xy).rg, FlatNormals, isLeaf);
#endif
Indirect_lighting += SubsurfaceScattering_sky(albedo, SkySSS, LabSSS) * ((AmbientLightColor* 2.0 * ambient_brightness)* 8./150.) * pow(newLightmap.y,3) * pow(1.0-clamp(abs(ambientCoefs.y+0.5),0.0,1.0),0.1) ;
SSS += SubsurfaceScattering_sky(albedo, SkySSS, LabSSS) * ((AmbientLightColor* 2.0 * ambient_brightness)* 8./150.) * pow(newLightmap.y,3) * pow(1.0-clamp(abs(ambientCoefs.y+0.5),0.0,1.0),0.1) ;
// Indirect_lighting += SubsurfaceScattering_sky(albedo, SkySSS, LabSSS) * ((AmbientLightColor* 2.0 * ambient_brightness)* 8./150.) * pow(newLightmap.y,3);
}
#endif
@ -1133,13 +1133,8 @@ void main() {
Direct_lighting = DoDirectLighting(DirectLightColor, Shadows, NdotL, 0.0);
//combine all light sources
vec3 FINAL_COLOR = Indirect_lighting + Direct_lighting;
vec3 FINAL_COLOR = Indirect_lighting + Direct_lighting + SSS;
#ifdef Variable_Penumbra_Shadows
FINAL_COLOR += SSS*DirectLightColor * lightleakfix;
#endif
#ifndef ambientSSS_view
FINAL_COLOR *= albedo;
#endif

View File

@ -310,7 +310,7 @@ void main() {
float estEyeDepth = clamp((14.0-eyeBrightnessSmooth.y/255.0*16.0)/14.0,0.,1.0);
estEyeDepth *= estEyeDepth*estEyeDepth*34.0;
vec3 ambientColVol = max(averageSkyCol_Clouds*8./150./1.5,MIN_LIGHT_AMOUNT*0.0015);
vec3 ambientColVol = averageSkyCol_Clouds*8./150./1.5;
vec3 lightColVol = (lightCol.rgb / 80.);
estEyeDepth = max(Water_Top_Layer - cameraPosition.y,0.0);

View File

@ -191,6 +191,7 @@ void main() {
vec4 dataUnpacked1 = vec4(decodeVec2(data_opaque.z),decodeVec2(data_opaque.w)); // normals, lightmaps
// vec4 dataUnpacked2 = vec4(decodeVec2(data.z),decodeVec2(data.w));
bool hand = abs(dataUnpacked1.w-0.75) < 0.01;
vec2 lightmap = dataUnpacked1.yz;
////// --------------- UNPACK TRANSLUCENT GBUFFERS --------------- //////
@ -216,6 +217,8 @@ void main() {
vec2 tempOffset = TAA_Offset;
vec3 fragpos = toScreenSpace(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z));
vec3 fragpos2 = toScreenSpace(vec3(texcoord/RENDER_SCALE-vec2(tempOffset)*texelSize*0.5,z2));
vec3 p3 = mat3(gbufferModelViewInverse) * fragpos;
vec3 np3 = normVec(p3);
@ -229,7 +232,7 @@ void main() {
float refractedalpha = decodeVec2(texture2D(colortex11,refractedCoord).b).g;
float refractedalpha2 = texture2D(colortex7,refractedCoord).a;
if( refractedalpha <= 0.001 ) refractedCoord = texcoord; // remove refracted coords on solids
if( refractedalpha <= 0.001 ||z < 0.56) refractedCoord = texcoord; // remove refracted coords on solids
#endif
/// --- MAIN COLOR BUFFER --- ///
@ -247,7 +250,7 @@ void main() {
vec4 vl = BilateralUpscale(colortex0, depthtex1, gl_FragCoord.xy, frDepth, vec2(0.0));
if (TranslucentShader.a > 0.0){
if (TranslucentShader.a > 0.0 && !hand){
#ifdef Glass_Tint
if(albedo.a > 0.2) color = color*albedo.rgb + color * clamp(pow(1.0-luma(albedo.rgb),20.),0.0,1.0);
#endif

View File

@ -244,44 +244,9 @@ float ld(float dist) {
}
// float EndPortalEffect(
// inout vec4 ALBEDO,
// vec3 FragPos,
// vec3 WorldPos,
// mat3 tbnMatrix
// ){
// float endportalGLow = 0.0;
// vec3 viewVec = normalize(tbnMatrix*FragPos);
// if (length(FragPos) < MAX_OCCLUSION_DISTANCE) {
// ALBEDO = vec4(0,0,0,1);
// float depth = 0.2;
// if ( viewVec.z < 0.0) {
// float noise = interleaved_gradientNoise_temp();
// vec3 interval = (viewVec.xyz /-viewVec.z/MAX_OCCLUSION_POINTS * POM_DEPTH) * 0.6 ;
// vec3 coord = vec3((lmtexcoord.st)/4, 1.0);
// coord += interval * noise;
// float sumVec = noise;
// for (int loopCount = 0; (loopCount < MAX_OCCLUSION_POINTS) && (1.0 - depth + depth * (1-readNoise(coord.st).r - readNoise((-coord.st*3 )).b*0.2) ) < coord.p && coord.p >= 0.0; ++loopCount) {
// coord = coord+interval ;
// sumVec += 1.0 ;
// endportalGLow += 0.01*0.6;
// }
// ALBEDO.rgb = vec3(0.5,0.75,1.0) * sqrt(endportalGLow);
// return clamp(pow(endportalGLow*3.5,5),0,1);
// }
// }
// }
vec4 readNoise(in vec2 coord){
return texture2D(noisetex,coord*vtexcoordam.pq + vtexcoordam.st);
// return texture2D(noisetex,coord*vtexcoordam.pq+vtexcoord.st);
return texture2DGradARB(noisetex,coord*vtexcoordam.pq + vtexcoordam.st,dcdx,dcdy);
}
float EndPortalEffect(
inout vec4 ALBEDO,
@ -299,7 +264,7 @@ float EndPortalEffect(
float Depth = 0.3;
vec3 interval = (viewVec.xyz /-viewVec.z/quality*Depth) * (0.7 + (blueNoise()-0.5)*0.1);
vec3 coord = vec3(-(abs(WorldPos.zx + WorldPos.zx))/4, 1.0);
vec3 coord = vec3(WorldPos.xz , 1.0);
coord += interval;
for (int loopCount = 0; (loopCount < quality) && (1.0 - Depth + Depth * ( 1.0-readNoise(coord.st).r - readNoise(-coord.st*3).b*0.2 ) ) < coord.p && coord.p >= 0.0; ++loopCount) {
@ -452,7 +417,7 @@ void main() {
vec4 Albedo = texture2D_POMSwitch(texture, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM) * color;
if(LIGHTNING > 0) Albedo = vec4(1);
// float ENDPORTAL_EFFECT = PORTAL > 0 ? EndPortalEffect(Albedo, fragpos, worldpos, tbnMatrix) : 0;
float ENDPORTAL_EFFECT = PORTAL > 0 ? EndPortalEffect(Albedo, fragpos, worldpos, tbnMatrix) : 0;
#ifdef WhiteWorld
Albedo.rgb = vec3(1.0);
@ -556,10 +521,10 @@ void main() {
gl_FragData[2].b = SpecularTex.b;
#endif
// if(PORTAL > 0){
// gl_FragData[2].rgb = vec3(0);
// gl_FragData[2].a = clamp(ENDPORTAL_EFFECT * 0.9, 0,0.9);
// }
if(PORTAL > 0){
gl_FragData[2].rgb = vec3(0);
gl_FragData[2].a = clamp(ENDPORTAL_EFFECT * 0.9, 0,0.9);
}
#endif

View File

@ -11,18 +11,45 @@ vec3 toLinear(vec3 sRGB){
return sRGB * (sRGB * (sRGB * 0.305306011 + 0.682171111) + 0.012522878);
}
vec4 encode (vec3 n, vec2 lightmaps){
n.xy = n.xy / dot(abs(n), vec3(1.0));
n.xy = n.z <= 0.0 ? (1.0 - abs(n.yx)) * sign(n.xy) : n.xy;
vec2 encn = clamp(n.xy * 0.5 + 0.5,-1.0,1.0);
return vec4(encn,vec2(lightmaps.x,lightmaps.y));
}
//encoding by jodie
float encodeVec2(vec2 a){
const vec2 constant1 = vec2( 1., 256.) / 65535.;
vec2 temp = floor( a * 255. );
return temp.x*constant1.x+temp.y*constant1.y;
}
float encodeVec2(float x,float y){
return encodeVec2(vec2(x,y));
}
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
/* DRAWBUFFERS:18 */
/* DRAWBUFFERS:28 */
void main() {
vec3 albedo = texture2D(texture, texcoord).rgb * color.rgb;
vec4 Albedo = texture2D(texture, texcoord);
gl_FragData[0].rgb = albedo;
// if (Albedo.a > 0.1) Albedo.a = 1.0;
// else Albedo.a = 0.0;
gl_FragData[1].a = 0.5;
// vec4 data1 = vec4(1);
// gl_FragData[0] = vec4(encodeVec2(Albedo.x,data1.x), encodeVec2(Albedo.y,data1.y), encodeVec2(Albedo.z,data1.z), encodeVec2(data1.w,Albedo.w));
Albedo *= color;
Albedo.rgb = toLinear(Albedo.rgb);
gl_FragData[0] = Albedo;
gl_FragData[1] = vec4(0.0,0.0,0.0,0.5);
}

View File

@ -11,23 +11,19 @@ Read the terms of modification and sharing before changing something below pleas
!! DO NOT REMOVE !!
*/
varying vec4 lmtexcoord;
varying vec4 color;
varying vec2 texcoord;
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.);
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
//////////////////////////////VOID MAIN//////////////////////////////
@ -38,7 +34,7 @@ void main() {
gl_Position = ftransform();
// if(gl_Color.a < 1.0 ) gl_Position = vec4(10,10,10,1);
// if(gl_Color.a < 0.1 ) gl_Position = vec4(10,10,10,1);
texcoord = (gl_MultiTexCoord0).xy;
color = gl_Color;