mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2024-12-23 01:59:39 +08:00
hand shaped hole in bloom when TAAU is on
This commit is contained in:
parent
23c8c49b70
commit
634be75b20
@ -308,13 +308,13 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
|||||||
|
|
||||||
#ifdef Vanilla_like_water
|
#ifdef Vanilla_like_water
|
||||||
if (iswater > 0.95){
|
if (iswater > 0.95){
|
||||||
// gl_FragData[0].a = luma(Albedo.rgb);
|
Albedo *= sqrt(luma(Albedo));
|
||||||
Albedo = color.rgb * sqrt(luma(Albedo.rgb));
|
// Albedo = toLinear( gl_FragData[0].rgb * sqrt(luma(gl_FragData[0].rgb)));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (iswater > 0.95){
|
if (iswater > 0.95){
|
||||||
Albedo = vec3(0.0);
|
Albedo = vec3(0.0);
|
||||||
gl_FragData[0] = vec4(vec3(0.0),1.0/255.0);
|
gl_FragData[0].a = 1.0/255.0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -454,6 +454,8 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
|||||||
|
|
||||||
// float skylight = max(pow(viewToWorld(flatnormal).y*0.5+0.5,0.1) + viewToWorld(normal).y, 0.25) * 1.35;
|
// float skylight = max(pow(viewToWorld(flatnormal).y*0.5+0.5,0.1) + viewToWorld(normal).y, 0.25) * 1.35;
|
||||||
// Indirect_lighting = DoAmbientLighting(averageSkyCol_Clouds, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy, skylight);
|
// Indirect_lighting = DoAmbientLighting(averageSkyCol_Clouds, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy, skylight);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NETHER_SHADER
|
#ifdef NETHER_SHADER
|
||||||
@ -475,6 +477,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Indirect_lighting = DoAmbientLightColor(AmbientLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy);
|
Indirect_lighting = DoAmbientLightColor(AmbientLightColor, vec3(TORCH_R,TORCH_G,TORCH_B), lightmap.xy);
|
||||||
|
// Albedo = Albedo * exp2( (clamp(-dot(normal, normalize(viewPos)),0.0,1.0)) * -10.0);//pow(clamp(1.0 + dot(normal, normalize(viewPos)), 0.0, 1.0),5.0);
|
||||||
|
|
||||||
vec3 FinalColor = (Indirect_lighting + Direct_lighting) * Albedo;
|
vec3 FinalColor = (Indirect_lighting + Direct_lighting) * Albedo;
|
||||||
|
|
||||||
@ -496,7 +499,10 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
|||||||
|
|
||||||
float roughness = max(pow(1.0-SpecularTex.r,2.0),0.05);
|
float roughness = max(pow(1.0-SpecularTex.r,2.0),0.05);
|
||||||
float f0 = SpecularTex.g;
|
float f0 = SpecularTex.g;
|
||||||
|
|
||||||
|
roughness = 0.0;
|
||||||
|
// f0 = 0.9;
|
||||||
|
|
||||||
if (iswater > 0.0 && gl_FragData[0].a < 0.9999999){
|
if (iswater > 0.0 && gl_FragData[0].a < 0.9999999){
|
||||||
vec3 Reflections_Final = vec3(0.0);
|
vec3 Reflections_Final = vec3(0.0);
|
||||||
vec4 Reflections = vec4(0.0);
|
vec4 Reflections = vec4(0.0);
|
||||||
@ -509,8 +515,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
|||||||
|
|
||||||
float normalDotEye = dot(normal, normalize(viewPos));
|
float normalDotEye = dot(normal, normalize(viewPos));
|
||||||
float fresnel = pow(clamp(1.0 + dot(normal, normalize(viewPos)), 0.0, 1.0),5.0);
|
float fresnel = pow(clamp(1.0 + dot(normal, normalize(viewPos)), 0.0, 1.0),5.0);
|
||||||
|
|
||||||
// float fresnel = exp(clamp(0.0 - dot(normal, normalize(viewPos)), 0.0, 1.0) * -5);
|
|
||||||
|
|
||||||
// snells window looking thing
|
// snells window looking thing
|
||||||
if(isEyeInWater == 1 ) fresnel = pow(clamp(1.66 + normalDotEye,0.0,1.0), 25.0);
|
if(isEyeInWater == 1 ) fresnel = pow(clamp(1.66 + normalDotEye,0.0,1.0), 25.0);
|
||||||
|
@ -100,9 +100,9 @@ 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.)*BLOOM_QUALITY).rgb)/2./7.0;
|
||||||
|
|
||||||
vec3 bloom = texture2D(colortex3, texcoord/clampedRes*vec2(1920.,1080.)*BLOOM_QUALITY).rgb / 2.0 / 7.0;
|
// vec3 bloom = texture2D(colortex3, texcoord/clampedRes*vec2(1920.,1080.)*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;
|
||||||
|
|
||||||
|
@ -98,7 +98,8 @@ vec4 BilateralUpscale(sampler2D tex, sampler2D depth,vec2 coord,float frDepth){
|
|||||||
ivec2 posD = ivec2(coord*VL_RENDER_RESOLUTION)*scaling;
|
ivec2 posD = ivec2(coord*VL_RENDER_RESOLUTION)*scaling;
|
||||||
ivec2 posVl = ivec2(coord*VL_RENDER_RESOLUTION);
|
ivec2 posVl = ivec2(coord*VL_RENDER_RESOLUTION);
|
||||||
float dz = zMults.x;
|
float dz = zMults.x;
|
||||||
ivec2 pos = (ivec2(gl_FragCoord.xy+frameCounter) % 2 )*2;
|
ivec2 pos = (ivec2(gl_FragCoord.xy) % 2 )*2;
|
||||||
|
//pos = ivec2(1,-1);
|
||||||
|
|
||||||
ivec2 tcDepth = posD + ivec2(-2,-2) * scaling + pos * scaling;
|
ivec2 tcDepth = posD + ivec2(-2,-2) * scaling + pos * scaling;
|
||||||
float dsample = ld(texelFetch2D(depth,tcDepth,0).r);
|
float dsample = ld(texelFetch2D(depth,tcDepth,0).r);
|
||||||
@ -194,12 +195,12 @@ void main() {
|
|||||||
// vec4 vl = texture2D(colortex0,texcoord * 0.5);
|
// vec4 vl = texture2D(colortex0,texcoord * 0.5);
|
||||||
|
|
||||||
////// --------------- UNPACK OPAQUE GBUFFERS --------------- //////
|
////// --------------- UNPACK OPAQUE GBUFFERS --------------- //////
|
||||||
vec4 data_opaque = texture2D(colortex1,texcoord);
|
// vec4 data_opaque = texture2D(colortex1,texcoord);
|
||||||
vec4 dataUnpacked1 = vec4(decodeVec2(data_opaque.z),decodeVec2(data_opaque.w)); // normals, lightmaps
|
// vec4 dataUnpacked1 = vec4(decodeVec2(data_opaque.z),decodeVec2(data_opaque.w)); // normals, lightmaps
|
||||||
// vec4 dataUnpacked2 = vec4(decodeVec2(data.z),decodeVec2(data.w));
|
// vec4 dataUnpacked2 = vec4(decodeVec2(data.z),decodeVec2(data.w));
|
||||||
|
|
||||||
bool hand = abs(dataUnpacked1.w-0.75) < 0.01;
|
// bool hand = abs(dataUnpacked1.w-0.75) < 0.01;
|
||||||
vec2 lightmap = dataUnpacked1.yz;
|
// vec2 lightmap = dataUnpacked1.yz;
|
||||||
|
|
||||||
////// --------------- UNPACK TRANSLUCENT GBUFFERS --------------- //////
|
////// --------------- UNPACK TRANSLUCENT GBUFFERS --------------- //////
|
||||||
|
|
||||||
@ -306,7 +307,7 @@ void main() {
|
|||||||
fogfade *= 1.0 - clamp( length(fragpos) / far,0.0,1.0);
|
fogfade *= 1.0 - clamp( length(fragpos) / far,0.0,1.0);
|
||||||
|
|
||||||
color.rgb *= fogfade ;
|
color.rgb *= fogfade ;
|
||||||
bloomyFogMult *= 0.0;
|
bloomyFogMult *= 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply VL fog to the scene
|
// apply VL fog to the scene
|
||||||
|
@ -1,18 +1,13 @@
|
|||||||
uniform sampler2D depthtex1;
|
#include "/lib/settings.glsl"
|
||||||
|
#include "/lib/res_params.glsl"
|
||||||
|
|
||||||
|
uniform sampler2D depthtex0;
|
||||||
uniform sampler2D colortex1;
|
uniform sampler2D colortex1;
|
||||||
uniform sampler2D colortex5;
|
uniform sampler2D colortex5;
|
||||||
uniform vec2 texelSize;
|
uniform vec2 texelSize;
|
||||||
uniform float viewWidth;
|
uniform float viewWidth;
|
||||||
uniform float viewHeight;
|
uniform float viewHeight;
|
||||||
|
|
||||||
vec3 decode (vec2 encn){
|
|
||||||
vec3 n = vec3(0.0);
|
|
||||||
encn = encn * 2.0 - 1.0;
|
|
||||||
n.xy = abs(encn);
|
|
||||||
n.z = 1.0 - n.x - n.y;
|
|
||||||
n.xy = n.z <= 0.0 ? (1.0 - n.yx) * sign(encn) : encn;
|
|
||||||
return clamp(normalize(n.xyz),-1.0,1.0);
|
|
||||||
}
|
|
||||||
vec2 decodeVec2(float a){
|
vec2 decodeVec2(float a){
|
||||||
const vec2 constant1 = 65535. / vec2( 256., 65536.);
|
const vec2 constant1 = 65535. / vec2( 256., 65536.);
|
||||||
const float constant2 = 256. / 255.;
|
const float constant2 = 256. / 255.;
|
||||||
@ -30,12 +25,11 @@ void main() {
|
|||||||
/* DRAWBUFFERS:3 */
|
/* DRAWBUFFERS:3 */
|
||||||
|
|
||||||
vec2 resScale = max(vec2(viewWidth,viewHeight),vec2(1920.0,1080.))/vec2(1920.,1080.);
|
vec2 resScale = max(vec2(viewWidth,viewHeight),vec2(1920.0,1080.))/vec2(1920.,1080.);
|
||||||
vec2 quarterResTC = gl_FragCoord.xy*2.*resScale*texelSize;
|
vec2 quarterResTC = gl_FragCoord.xy*2.0*resScale*texelSize;
|
||||||
|
|
||||||
vec4 data = texture2D(colortex1,quarterResTC);
|
vec2 texcoord = (gl_FragCoord.xy*2.0*texelSize) * RENDER_SCALE;
|
||||||
vec4 dataUnpacked1 = vec4(decodeVec2(data.z),decodeVec2(data.w));
|
|
||||||
float depth = texture2D(depthtex1,quarterResTC).x;
|
bool hand = abs(decodeVec2(texture2D(colortex1,texcoord).w).y-0.75) < 0.01 && texture2D(depthtex0,texcoord).x < 1.0;
|
||||||
bool hand = abs(dataUnpacked1.w-0.75) < 0.01 && depth < 1.0;
|
|
||||||
|
|
||||||
//0.5
|
//0.5
|
||||||
gl_FragData[0] = texture2D(colortex5,quarterResTC-1.0*vec2(texelSize.x,texelSize.y))/4.*0.5;
|
gl_FragData[0] = texture2D(colortex5,quarterResTC-1.0*vec2(texelSize.x,texelSize.y))/4.*0.5;
|
||||||
@ -61,5 +55,4 @@ bool hand = abs(dataUnpacked1.w-0.75) < 0.01 && depth < 1.0;
|
|||||||
gl_FragData[0].rgb = clamp(gl_FragData[0].rgb,0.0,65000.);
|
gl_FragData[0].rgb = clamp(gl_FragData[0].rgb,0.0,65000.);
|
||||||
if (hand || quarterResTC.x > 1.0 - 3.5*texelSize.x || quarterResTC.y > 1.0 -3.5*texelSize.y || quarterResTC.x < 3.5*texelSize.x || quarterResTC.y < 3.5*texelSize.y) gl_FragData[0].rgb = vec3(0.0);
|
if (hand || quarterResTC.x > 1.0 - 3.5*texelSize.x || quarterResTC.y > 1.0 -3.5*texelSize.y || quarterResTC.x < 3.5*texelSize.x || quarterResTC.y < 3.5*texelSize.y) gl_FragData[0].rgb = vec3(0.0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#undef TAA_UPSCALING
|
#undef TAA_UPSCALING
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef TAA_UPSCALING
|
#ifdef TAA_UPSCALING
|
||||||
#define SCALE_FACTOR 0.75 // render resolution multiplier. below 0.5 not recommended [0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95]
|
#define SCALE_FACTOR 0.75 // render resolution multiplier. below 0.5 not recommended [0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95]
|
||||||
|
|
||||||
|
@ -209,6 +209,7 @@ void DoSpecularReflections(
|
|||||||
vec3 L = Basis * Ln;
|
vec3 L = Basis * Ln;
|
||||||
|
|
||||||
float Fresnel = pow(clamp(1.0 + dot(-Ln, SamplePoints),0.0,1.0), 5.0); // Schlick's approximation
|
float Fresnel = pow(clamp(1.0 + dot(-Ln, SamplePoints),0.0,1.0), 5.0); // Schlick's approximation
|
||||||
|
|
||||||
float RayContribution = lerp(F0, 1.0, Fresnel); // ensure that when the angle is 0 that the correct F0 is used.
|
float RayContribution = lerp(F0, 1.0, Fresnel); // ensure that when the angle is 0 that the correct F0 is used.
|
||||||
|
|
||||||
#ifdef Rough_reflections
|
#ifdef Rough_reflections
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
float getWaterHeightmap(vec2 posxz, float waveM, float waveZ, float iswater) { // water waves
|
float getWaterHeightmap(vec2 posxz, float waveM, float waveZ, float iswater) { // water waves
|
||||||
vec2 movement = vec2(frameTimeCounter*0.05);
|
vec2 movement = vec2(frameTimeCounter*0.05);// *0;
|
||||||
vec2 pos = posxz ;
|
vec2 pos = posxz ;
|
||||||
float caustic = 1.0;
|
float caustic = 1.0;
|
||||||
float weightSum = 0.0;
|
float weightSum = 0.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user