small fix to noise for SSR in the end and nether

This commit is contained in:
Xonk 2023-07-29 21:49:33 -04:00
parent 6d73d842cf
commit b3864fa85c
2 changed files with 26 additions and 12 deletions

View File

@ -101,12 +101,19 @@ float triangularize(float dither)
dither = center*inversesqrt(abs(center)); dither = center*inversesqrt(abs(center));
return clamp(dither-fsign(center),0.0,1.0); return clamp(dither-fsign(center),0.0,1.0);
} }
float interleaved_gradientNoise(float temp){ // float interleaved_gradientNoise(float temp){
return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y)+temp); // return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y)+temp);
} // }
// float interleaved_gradientNoise(){
// vec2 coord = gl_FragCoord.xy;
// float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y));
// return noise;
// }
float interleaved_gradientNoise(){ float interleaved_gradientNoise(){
vec2 coord = gl_FragCoord.xy; vec2 coord = gl_FragCoord.xy + (frameCounter%40000);
float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y)); // vec2 coord = gl_FragCoord.xy + frameTimeCounter;
// vec2 coord = gl_FragCoord.xy;
float noise = fract( 52.9829189 * fract( (coord.x * 0.06711056) + (coord.y * 0.00583715)) );
return noise ; return noise ;
} }
vec3 fp10Dither(vec3 color,float dither){ vec3 fp10Dither(vec3 color,float dither){

View File

@ -102,12 +102,19 @@ float triangularize(float dither)
dither = center*inversesqrt(abs(center)); dither = center*inversesqrt(abs(center));
return clamp(dither-fsign(center),0.0,1.0); return clamp(dither-fsign(center),0.0,1.0);
} }
float interleaved_gradientNoise(float temp){ // float interleaved_gradientNoise(float temp){
return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y)+temp); // return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y)+temp);
} // }
// float interleaved_gradientNoise(){
// vec2 coord = gl_FragCoord.xy;
// float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y));
// return noise;
// }
float interleaved_gradientNoise(){ float interleaved_gradientNoise(){
vec2 coord = gl_FragCoord.xy; vec2 coord = gl_FragCoord.xy + (frameCounter%40000);
float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y)); // vec2 coord = gl_FragCoord.xy + frameTimeCounter;
// vec2 coord = gl_FragCoord.xy;
float noise = fract( 52.9829189 * fract( (coord.x * 0.06711056) + (coord.y * 0.00583715)) );
return noise ; return noise ;
} }
vec3 fp10Dither(vec3 color,float dither){ vec3 fp10Dither(vec3 color,float dither){