added a contrast setting. make beacon beams and enchantment glint work in the end and nether. tweak lighting in the end and nether.

This commit is contained in:
Xonk
2023-07-06 20:47:26 -04:00
parent 4ec1a86639
commit b62cb8aa4b
36 changed files with 262 additions and 616 deletions

View File

@ -19,6 +19,11 @@ uniform int isEyeInWater;
#include "/lib/color_dither.glsl"
#include "/lib/res_params.glsl"
/// thanks stackoverflow https://stackoverflow.com/questions/944713/help-with-pixel-shader-effect-for-brightness-and-contrast#3027595
void applyContrast(inout vec3 color, float contrast){
color = (color - 0.5) * contrast + 0.5;
}
vec4 SampleTextureCatmullRom(sampler2D tex, vec2 uv, vec2 texSize )
{
// We're going to sample a a 4x4 grid of texels surrounding the target UV coordinate. We'll do this by rounding
@ -69,6 +74,11 @@ vec4 SampleTextureCatmullRom(sampler2D tex, vec2 uv, vec2 texSize )
return result;
}
/// thanks stackoverflow https://stackoverflow.com/questions/944713/help-with-pixel-shader-effect-for-brightness-and-contrast#3027595
void applyContrast(inout vec3 color, float contrast){
color = (color - 0.5) * contrast + 0.5;
}
void main() {
#ifdef BICUBIC_UPSCALING
vec3 col = SampleTextureCatmullRom(colortex7,texcoord,1.0/texelSize).rgb;
@ -96,6 +106,9 @@ void main() {
vec3 diff = col-lum;
col = col + diff*(-lum*CROSSTALK + SATURATION);
//col = -vec3(-lum*CROSSFADING + SATURATION);
applyContrast(col, CONTRAST);
gl_FragColor.rgb = clamp(int8Dither(col,texcoord),0.0,1.0);
//gl_FragColor.rgb = vec3(contrast);
}