mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-20 16:07:22 +08:00
Fix water exploding on iris. tweak RTAO / SSGI's AO to look more like it used to in bliss v2
This commit is contained in:
parent
ec7a73fefa
commit
adaa2db9e6
@ -590,7 +590,10 @@ void ApplySSRT(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, vec2 li
|
|||||||
skycontribution = (skyCloudsFromTex(rayDir, colortex4).rgb / 15.0) * skyLM + torchlight;
|
skycontribution = (skyCloudsFromTex(rayDir, colortex4).rgb / 15.0) * skyLM + torchlight;
|
||||||
#else
|
#else
|
||||||
if(isGrass) rayDir.y = clamp(rayDir.y + 0.25,-1,1);
|
if(isGrass) rayDir.y = clamp(rayDir.y + 0.25,-1,1);
|
||||||
skycontribution = skylightcolor * max(rayDir.y * min(AO_Strength,1.0), 0.05) + torchlight;
|
|
||||||
|
float SkyLightDir = rayDir.y > 0.0 ? 1.0 : max(rayDir.y,0.25); // the positons where the occlusion happens
|
||||||
|
|
||||||
|
skycontribution = skylightcolor * SkyLightDir + torchlight;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (rayHit.z < 1.){
|
if (rayHit.z < 1.){
|
||||||
@ -599,6 +602,7 @@ void ApplySSRT(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, vec2 li
|
|||||||
vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rayHit) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
vec3 previousPosition = mat3(gbufferModelViewInverse) * toScreenSpace(rayHit) + gbufferModelViewInverse[3].xyz + cameraPosition-previousCameraPosition;
|
||||||
previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
previousPosition = mat3(gbufferPreviousModelView) * previousPosition + gbufferPreviousModelView[3].xyz;
|
||||||
previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
previousPosition.xy = projMAD(gbufferPreviousProjection, previousPosition).xy / -previousPosition.z * 0.5 + 0.5;
|
||||||
|
|
||||||
if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0){
|
if (previousPosition.x > 0.0 && previousPosition.y > 0.0 && previousPosition.x < 1.0 && previousPosition.x < 1.0){
|
||||||
radiance += (texture2D(colortex5,previousPosition.xy).rgb + skycontribution) * GI_Strength;
|
radiance += (texture2D(colortex5,previousPosition.xy).rgb + skycontribution) * GI_Strength;
|
||||||
} else{
|
} else{
|
||||||
@ -611,6 +615,7 @@ void ApplySSRT(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, vec2 li
|
|||||||
|
|
||||||
occlusion += skycontribution * GI_Strength;
|
occlusion += skycontribution * GI_Strength;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
radiance += skycontribution;
|
radiance += skycontribution;
|
||||||
}
|
}
|
||||||
@ -618,7 +623,14 @@ void ApplySSRT(inout vec3 lighting, vec3 normal,vec2 noise,vec3 fragpos, vec2 li
|
|||||||
|
|
||||||
occlusion *= AO_Strength;
|
occlusion *= AO_Strength;
|
||||||
|
|
||||||
lighting = max(radiance/nrays - occlusion/nrays, 0.0);
|
lighting = radiance/nrays - occlusion/nrays;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// lighting = GI ;
|
||||||
|
// radiance = radiance/nrays - (skycontribution + occlusion/nrays);
|
||||||
|
// lighting = skycontribution - occlusion/nrays + radiance;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -853,7 +865,7 @@ void main() {
|
|||||||
bool lightningBolt = abs(dataUnpacked1.w-0.50) <0.01;
|
bool lightningBolt = abs(dataUnpacked1.w-0.50) <0.01;
|
||||||
bool entities = abs(dataUnpacked1.w-0.45) < 0.01;
|
bool entities = abs(dataUnpacked1.w-0.45) < 0.01;
|
||||||
bool hand = abs(dataUnpacked1.w-0.75) < 0.01;
|
bool hand = abs(dataUnpacked1.w-0.75) < 0.01;
|
||||||
bool blocklights = abs(dataUnpacked1.w-0.8) <0.01;
|
// bool blocklights = abs(dataUnpacked1.w-0.8) <0.01;
|
||||||
bool isGrass = abs(dataUnpacked1.w-0.60) < 0.01;
|
bool isGrass = abs(dataUnpacked1.w-0.60) < 0.01;
|
||||||
|
|
||||||
float vanilla_AO = normalAndAO.a;
|
float vanilla_AO = normalAndAO.a;
|
||||||
@ -1129,7 +1141,6 @@ void main() {
|
|||||||
//////////////////////////////// UNDER WATER SHADING ////////////////////////////////
|
//////////////////////////////// UNDER WATER SHADING ////////////////////////////////
|
||||||
//////////////////////////////// ////////////////////////////////
|
//////////////////////////////// ////////////////////////////////
|
||||||
|
|
||||||
vec3 waterabsorb_speculars = vec3(1);
|
|
||||||
if ((isEyeInWater == 0 && iswater) || (isEyeInWater == 1 && !iswater)){
|
if ((isEyeInWater == 0 && iswater) || (isEyeInWater == 1 && !iswater)){
|
||||||
|
|
||||||
vec3 fragpos0 = toScreenSpace(vec3(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5,z0));
|
vec3 fragpos0 = toScreenSpace(vec3(texcoord/RENDER_SCALE-TAA_Offset*texelSize*0.5,z0));
|
||||||
@ -1153,7 +1164,7 @@ void main() {
|
|||||||
// Indirect_lighting *= 0.5 + max(pow(Ambient_Caustics, 2.0),0.0);
|
// Indirect_lighting *= 0.5 + max(pow(Ambient_Caustics, 2.0),0.0);
|
||||||
|
|
||||||
DirectLightColor *= Absorbtion;
|
DirectLightColor *= Absorbtion;
|
||||||
Indirect_lighting = (Indirect_lighting/exp2(-estimatedDepth*0.5)) * Absorbtion;
|
if(isEyeInWater == 1 ) Indirect_lighting = (Indirect_lighting/exp2(-estimatedDepth*0.5)) * Absorbtion;
|
||||||
|
|
||||||
if(isEyeInWater == 0) DirectLightColor *= max(eyeBrightnessSmooth.y/240., 0.0);
|
if(isEyeInWater == 0) DirectLightColor *= max(eyeBrightnessSmooth.y/240., 0.0);
|
||||||
DirectLightColor *= cloudShadow;
|
DirectLightColor *= cloudShadow;
|
||||||
|
@ -85,6 +85,7 @@ void main() {
|
|||||||
/* DRAWBUFFERS:3 */
|
/* DRAWBUFFERS:3 */
|
||||||
vec2 resScale = vec2(1920.,1080.)/(max(vec2(viewWidth,viewHeight),vec2(1920.0,1080.))/BLOOM_QUALITY);
|
vec2 resScale = vec2(1920.,1080.)/(max(vec2(viewWidth,viewHeight),vec2(1920.0,1080.))/BLOOM_QUALITY);
|
||||||
vec2 texcoord = ((gl_FragCoord.xy)*2.+0.5)*texelSize;
|
vec2 texcoord = ((gl_FragCoord.xy)*2.+0.5)*texelSize;
|
||||||
|
|
||||||
vec3 bloom = texture2D_bicubic(colortex3,texcoord/2.0).rgb; //1/4 res
|
vec3 bloom = texture2D_bicubic(colortex3,texcoord/2.0).rgb; //1/4 res
|
||||||
|
|
||||||
bloom += texture2D_bicubic(colortex6,texcoord/4.).rgb; //1/8 res
|
bloom += texture2D_bicubic(colortex6,texcoord/4.).rgb; //1/8 res
|
||||||
@ -94,7 +95,9 @@ bloom += texture2D_bicubic(colortex6,texcoord/8.+vec2(0.25*resScale.x+2.5*texelS
|
|||||||
bloom += texture2D_bicubic(colortex6,texcoord/16.+vec2(0.375*resScale.x+4.5*texelSize.x,.0)).rgb; //1/32 res
|
bloom += texture2D_bicubic(colortex6,texcoord/16.+vec2(0.375*resScale.x+4.5*texelSize.x,.0)).rgb; //1/32 res
|
||||||
|
|
||||||
bloom += texture2D_bicubic(colortex6,texcoord/32.+vec2(0.4375*resScale.x+6.5*texelSize.x,.0)).rgb*1.0; //1/64 res
|
bloom += texture2D_bicubic(colortex6,texcoord/32.+vec2(0.4375*resScale.x+6.5*texelSize.x,.0)).rgb*1.0; //1/64 res
|
||||||
|
|
||||||
bloom += texture2D_bicubic(colortex6,texcoord/64.+vec2(0.46875*resScale.x+8.5*texelSize.x,.0)).rgb*1.0; //1/128 res
|
bloom += texture2D_bicubic(colortex6,texcoord/64.+vec2(0.46875*resScale.x+8.5*texelSize.x,.0)).rgb*1.0; //1/128 res
|
||||||
|
|
||||||
bloom += texture2D_bicubic(colortex6,texcoord/128.+vec2(0.484375*resScale.x+10.5*texelSize.x,.0)).rgb*1.0; //1/256 res
|
bloom += texture2D_bicubic(colortex6,texcoord/128.+vec2(0.484375*resScale.x+10.5*texelSize.x,.0)).rgb*1.0; //1/256 res
|
||||||
|
|
||||||
//bloom = texture2D_bicubic(colortex6,texcoord).rgb*6.; //1/8 res
|
//bloom = texture2D_bicubic(colortex6,texcoord).rgb*6.; //1/8 res
|
||||||
|
@ -104,7 +104,10 @@ void main() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
vec3 bloom = texture2D(colortex3,texcoord/clampedRes*vec2(1920.,1080.)*0.5*BLOOM_QUALITY).rgb/2./7.0;
|
// vec3 bloom = (texture2D(colortex3,texcoord/clampedRes*vec2(1920.,1080.)*0.5*BLOOM_QUALITY).rgb)/2./7.0;
|
||||||
|
|
||||||
|
vec3 bloom = texture2D(colortex3, texcoord/clampedRes*vec2(1920.,1080.)*0.5*BLOOM_QUALITY).rgb / 2.0 / 7.0;
|
||||||
|
|
||||||
|
|
||||||
float lightScat = clamp(BLOOM_STRENGTH * 0.05 * pow(exposure.a, 0.2) ,0.0,1.0)*vignette;
|
float lightScat = clamp(BLOOM_STRENGTH * 0.05 * pow(exposure.a, 0.2) ,0.0,1.0)*vignette;
|
||||||
|
|
||||||
@ -113,9 +116,15 @@ void main() {
|
|||||||
|
|
||||||
VL_abs = clamp( (1.0-VL_abs)*BLOOMY_FOG*0.75*(1.0-purkinje),0.0,1.0)*clamp(1.0-pow(cdist(texcoord.xy),15.0),0.0,1.0);
|
VL_abs = clamp( (1.0-VL_abs)*BLOOMY_FOG*0.75*(1.0-purkinje),0.0,1.0)*clamp(1.0-pow(cdist(texcoord.xy),15.0),0.0,1.0);
|
||||||
|
|
||||||
float lightleakfix = clamp(eyeBrightnessSmooth.y/240.0,0.0,1.0);
|
// bloom *= lightScat;
|
||||||
|
// apply bloom and bloomy fog
|
||||||
|
// col = mix(col, bloom, VL_abs);
|
||||||
|
// col += bloom*lightScat;
|
||||||
|
|
||||||
col = (mix(col,bloom,VL_abs)+bloom * lightScat) * mix(exposure.rgb,min(exposure.rgb,0.01), 0);
|
// // apply exposure
|
||||||
|
// col *= exposure.rgb;
|
||||||
|
|
||||||
|
col = (mix(col,bloom,VL_abs)+bloom * lightScat) * exposure.rgb;
|
||||||
|
|
||||||
//Purkinje Effect
|
//Purkinje Effect
|
||||||
float lum = dot(col,vec3(0.15,0.3,0.55));
|
float lum = dot(col,vec3(0.15,0.3,0.55));
|
||||||
|
@ -344,8 +344,6 @@ void main() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isEyeInWater == 0){
|
if (isEyeInWater == 0){
|
||||||
|
|
||||||
|
|
||||||
vec3 fragpos = toScreenSpace(vec3(tc/RENDER_SCALE,z));
|
vec3 fragpos = toScreenSpace(vec3(tc/RENDER_SCALE,z));
|
||||||
|
|
||||||
#ifdef Cumulus
|
#ifdef Cumulus
|
||||||
@ -372,9 +370,9 @@ void main() {
|
|||||||
gl_FragData[0] = clamp(VL_Fog,0.0,65000.);
|
gl_FragData[0] = clamp(VL_Fog,0.0,65000.);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isEyeInWater == 1){
|
||||||
} else {
|
|
||||||
|
|
||||||
float dirtAmount = Dirt_Amount;
|
float dirtAmount = Dirt_Amount;
|
||||||
vec3 waterEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B);
|
vec3 waterEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B);
|
||||||
|
@ -311,8 +311,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// apply VL fog to the scene
|
// apply VL fog to the scene
|
||||||
color *= vl.a;
|
// color *= vl.a;
|
||||||
color += vl.rgb;
|
// color += vl.rgb;
|
||||||
|
|
||||||
// bloomy rain effect
|
// bloomy rain effect
|
||||||
float rainDrops = clamp(texture2D(colortex9,texcoord).a, 0.0,1.0);
|
float rainDrops = clamp(texture2D(colortex9,texcoord).a, 0.0,1.0);
|
||||||
|
@ -425,7 +425,7 @@ void main() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WhiteWorld
|
#ifdef WhiteWorld
|
||||||
Albedo.rgb = vec3(1.0);
|
Albedo.rgb = vec3(0.5);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef AEROCHROME_MODE
|
#ifdef AEROCHROME_MODE
|
||||||
|
@ -11,7 +11,7 @@ void DoRTAmbientLighting (vec3 TorchColor, vec2 Lightmap, inout float SkyLM, ino
|
|||||||
|
|
||||||
SkyLM = (pow(Lightmap.y,15.0)*2.0 + pow(Lightmap.y,2.5))*0.5;
|
SkyLM = (pow(Lightmap.y,15.0)*2.0 + pow(Lightmap.y,2.5))*0.5;
|
||||||
|
|
||||||
SkyLight = (SkyLight * ambient_brightness) / 10.0;
|
SkyLight = (SkyLight * ambient_brightness) / 30.0;
|
||||||
SkyLight = max(SkyLight * SkyLM, vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.025 + nightVision));
|
SkyLight = max(SkyLight * SkyLM, vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.025 + nightVision));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user