Add BACKGROUND_INTENSITY to other simpletex shaders

This commit is contained in:
Tim McCabe 2023-09-22 10:49:22 -04:00
parent 607c0979bb
commit 129604300d
16 changed files with 64 additions and 16 deletions

View file

@ -40,6 +40,9 @@
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
- 0.0: Colours are normal
- 2.0: Colours are too dark...
> BACKGROUND_INTENSITY: Adjusts how prominent the paper background texture is
- 0.0: No background texture
- 1.0: Background texture is clearly visible
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -59,6 +62,7 @@
#pragma parameter GRID_BIAS "Grid Bias" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_GRID "Darken Grid" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_COLOUR "Darken Colours" 0.0 0.0 2.0 0.05
#pragma parameter BACKGROUND_INTENSITY "Background Intensity" 1.0 0.0 1.0 0.05
layout(push_constant) uniform Push
{
@ -67,6 +71,7 @@ layout(push_constant) uniform Push
float GRID_BIAS;
float DARKEN_GRID;
float DARKEN_COLOUR;
float BACKGROUND_INTENSITY;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
@ -203,7 +208,7 @@ void main()
// Note: Have to calculate luminosity a second time... tiresome, but
// it's not a particulary expensive operation...
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma * registers.BACKGROUND_INTENSITY);
FragColor = vec4(colour.rgb, 1.0);
}

View file

@ -40,6 +40,9 @@
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
- 0.0: Colours are normal
- 2.0: Colours are too dark...
> BACKGROUND_INTENSITY: Adjusts how prominent the paper background texture is
- 0.0: No background texture
- 1.0: Background texture is clearly visible
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -59,6 +62,7 @@
#pragma parameter GRID_BIAS "Grid Bias" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_GRID "Darken Grid" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_COLOUR "Darken Colours" 0.0 0.0 2.0 0.05
#pragma parameter BACKGROUND_INTENSITY "Background Intensity" 1.0 0.0 1.0 0.05
layout(push_constant) uniform Push
{
@ -67,6 +71,7 @@ layout(push_constant) uniform Push
float GRID_BIAS;
float DARKEN_GRID;
float DARKEN_COLOUR;
float BACKGROUND_INTENSITY;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
@ -203,7 +208,7 @@ void main()
// Note: Have to calculate luminosity a second time... tiresome, but
// it's not a particulary expensive operation...
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma * registers.BACKGROUND_INTENSITY);
FragColor = vec4(colour.rgb, 1.0);
}

View file

@ -40,6 +40,9 @@
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
- 0.0: Colours are normal
- 2.0: Colours are too dark...
> BACKGROUND_INTENSITY: Adjusts how prominent the paper background texture is
- 0.0: No background texture
- 1.0: Background texture is clearly visible
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -59,6 +62,7 @@
#pragma parameter GRID_BIAS "Grid Bias" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_GRID "Darken Grid" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_COLOUR "Darken Colours" 0.0 0.0 2.0 0.05
#pragma parameter BACKGROUND_INTENSITY "Background Intensity" 1.0 0.0 1.0 0.05
layout(push_constant) uniform Push
{
@ -67,6 +71,7 @@ layout(push_constant) uniform Push
float GRID_BIAS;
float DARKEN_GRID;
float DARKEN_COLOUR;
float BACKGROUND_INTENSITY;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
@ -203,7 +208,7 @@ void main()
// Note: Have to calculate luminosity a second time... tiresome, but
// it's not a particulary expensive operation...
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma * registers.BACKGROUND_INTENSITY);
FragColor = vec4(colour.rgb, 1.0);
}

View file

@ -36,6 +36,9 @@
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
- 0.0: Colours are normal
- 2.0: Colours are too dark...
> BACKGROUND_INTENSITY: Adjusts how prominent the paper background texture is
- 0.0: No background texture
- 1.0: Background texture is clearly visible
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -55,6 +58,7 @@
#pragma parameter GRID_BIAS "Grid Bias" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_GRID "Darken Grid" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_COLOUR "Darken Colours" 0.0 0.0 2.0 0.05
#pragma parameter BACKGROUND_INTENSITY "Background Intensity" 1.0 0.0 1.0 0.05
layout(push_constant) uniform Push
{
@ -63,6 +67,7 @@ layout(push_constant) uniform Push
float GRID_BIAS;
float DARKEN_GRID;
float DARKEN_COLOUR;
float BACKGROUND_INTENSITY;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
@ -181,7 +186,7 @@ void main()
// Note: Have to calculate luminosity a second time... tiresome, but
// it's not a particulary expensive operation...
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma * registers.BACKGROUND_INTENSITY);
FragColor = vec4(colour.rgb, 1.0);
}

View file

@ -36,6 +36,9 @@
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
- 0.0: Colours are normal
- 2.0: Colours are too dark...
> BACKGROUND_INTENSITY: Adjusts how prominent the paper background texture is
- 0.0: No background texture
- 1.0: Background texture is clearly visible
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -55,6 +58,7 @@
#pragma parameter GRID_BIAS "Grid Bias" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_GRID "Darken Grid" 0.0 0.0 1.0 0.05
#pragma parameter DARKEN_COLOUR "Darken Colours" 0.0 0.0 2.0 0.05
#pragma parameter BACKGROUND_INTENSITY "Background Intensity" 1.0 0.0 1.0 0.05
layout(push_constant) uniform Push
{
@ -63,6 +67,7 @@ layout(push_constant) uniform Push
float GRID_BIAS;
float DARKEN_GRID;
float DARKEN_COLOUR;
float BACKGROUND_INTENSITY;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
@ -181,7 +186,7 @@ void main()
// Note: Have to calculate luminosity a second time... tiresome, but
// it's not a particulary expensive operation...
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma * registers.BACKGROUND_INTENSITY);
FragColor = vec4(colour.rgb, 1.0);
}

View file

@ -41,6 +41,9 @@
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
- 0.0: Colours are normal
- 2.0: Colours are too dark...
> BACKGROUND_INTENSITY: Adjusts how prominent the paper background texture is
- 0.0: No background texture
- 1.0: Background texture is clearly visible
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -60,6 +63,7 @@
#pragma parameter GRID_BIAS "Grid Bias" 0.5 0.0 1.0 0.01
#pragma parameter DARKEN_GRID "Darken Grid" 0.0 0.0 1.0 0.01
#pragma parameter DARKEN_COLOUR "Darken Colours" 0.0 0.0 2.0 0.01
#pragma parameter BACKGROUND_INTENSITY "Background Intensity" 1.0 0.0 1.0 0.05
layout(push_constant) uniform Push
{
@ -68,6 +72,7 @@ layout(push_constant) uniform Push
float GRID_BIAS;
float DARKEN_GRID;
float DARKEN_COLOUR;
float BACKGROUND_INTENSITY;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
@ -195,7 +200,7 @@ void main()
// Note: Have to calculate luminosity a second time... tiresome, but
// it's not a particulary expensive operation...
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma * registers.BACKGROUND_INTENSITY);
FragColor = vec4(colour.rgb, 1.0);
}

View file

@ -41,6 +41,9 @@
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
- 0.0: Colours are normal
- 2.0: Colours are too dark...
> BACKGROUND_INTENSITY: Adjusts how prominent the paper background texture is
- 0.0: No background texture
- 1.0: Background texture is clearly visible
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -60,6 +63,7 @@
#pragma parameter GRID_BIAS "Grid Bias" 0.5 0.0 1.0 0.01
#pragma parameter DARKEN_GRID "Darken Grid" 0.0 0.0 1.0 0.01
#pragma parameter DARKEN_COLOUR "Darken Colours" 0.0 0.0 2.0 0.01
#pragma parameter BACKGROUND_INTENSITY "Background Intensity" 1.0 0.0 1.0 0.05
layout(push_constant) uniform Push
{
@ -68,6 +72,7 @@ layout(push_constant) uniform Push
float GRID_BIAS;
float DARKEN_GRID;
float DARKEN_COLOUR;
float BACKGROUND_INTENSITY;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
@ -195,7 +200,7 @@ void main()
// Note: Have to calculate luminosity a second time... tiresome, but
// it's not a particulary expensive operation...
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma * registers.BACKGROUND_INTENSITY);
FragColor = vec4(colour.rgb, 1.0);
}

View file

@ -38,6 +38,9 @@
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
- 0.0: Colours are normal
- 2.0: Colours are too dark...
> BACKGROUND_INTENSITY: Adjusts how prominent the paper background texture is
- 0.0: No background texture
- 1.0: Background texture is clearly visible
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@ -57,6 +60,7 @@
#pragma parameter GRID_BIAS "Grid Bias" 0.5 0.0 1.0 0.01
#pragma parameter DARKEN_GRID "Darken Grid" 0.0 0.0 1.0 0.01
#pragma parameter DARKEN_COLOUR "Darken Colours" 0.0 0.0 2.0 0.01
#pragma parameter BACKGROUND_INTENSITY "Background Intensity" 1.0 0.0 1.0 0.05
layout(push_constant) uniform Push
{
@ -65,6 +69,7 @@ layout(push_constant) uniform Push
float GRID_BIAS;
float DARKEN_GRID;
float DARKEN_COLOUR;
float BACKGROUND_INTENSITY;
vec4 OutputSize;
vec4 OriginalSize;
vec4 SourceSize;
@ -174,7 +179,7 @@ void main()
// Note: Have to calculate luminosity a second time... tiresome, but
// it's not a particulary expensive operation...
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma);
colour.rgb = mix(colour.rgb, bgTexture.rgb, luma * registers.BACKGROUND_INTENSITY);
FragColor = vec4(colour.rgb, 1.0);
}

View file

@ -14,9 +14,10 @@ textures = "BACKGROUND"
BACKGROUND = "shaders/simpletex_lcd/png/4k/textured_paper.png"
BACKGROUND_linear = false
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR"
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR;BACKGROUND_INTENSITY"
GRID_INTENSITY = "0.65"
GRID_WIDTH = "0.65"
GRID_BIAS = "0.6"
DARKEN_GRID = "0.0"
DARKEN_COLOUR = "0.05"
BACKGROUND_INTENSITY = "1.0"

View file

@ -14,9 +14,10 @@ textures = "BACKGROUND"
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
BACKGROUND_linear = false
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR"
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR;BACKGROUND_INTENSITY"
GRID_INTENSITY = "0.65"
GRID_WIDTH = "0.65"
GRID_BIAS = "0.6"
DARKEN_GRID = "0.0"
DARKEN_COLOUR = "0.05"
BACKGROUND_INTENSITY = "1.0"

View file

@ -14,9 +14,10 @@ textures = "BACKGROUND"
BACKGROUND = "shaders/simpletex_lcd/png/4k/textured_paper.png"
BACKGROUND_linear = false
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR"
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR;BACKGROUND_INTENSITY"
GRID_INTENSITY = "0.65"
GRID_WIDTH = "0.65"
GRID_BIAS = "0.6"
DARKEN_GRID = "0.0"
DARKEN_COLOUR = "0.05"
BACKGROUND_INTENSITY = "1.0"

View file

@ -14,9 +14,10 @@ textures = "BACKGROUND"
BACKGROUND = "shaders/simpletex_lcd/png/4k/textured_paper.png"
BACKGROUND_linear = false
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR"
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR;BACKGROUND_INTENSITY"
GRID_INTENSITY = "0.65"
GRID_WIDTH = "0.65"
GRID_BIAS = "0.6"
DARKEN_GRID = "0.0"
DARKEN_COLOUR = "0.05"
BACKGROUND_INTENSITY = "1.0"

View file

@ -14,9 +14,10 @@ textures = "BACKGROUND"
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
BACKGROUND_linear = false
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR"
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR;BACKGROUND_INTENSITY"
GRID_INTENSITY = "0.65"
GRID_WIDTH = "0.65"
GRID_BIAS = "0.6"
DARKEN_GRID = "0.0"
DARKEN_COLOUR = "0.05"
BACKGROUND_INTENSITY = "1.0"

View file

@ -14,9 +14,10 @@ textures = "BACKGROUND"
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
BACKGROUND_linear = false
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR"
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR;BACKGROUND_INTENSITY"
GRID_INTENSITY = "0.72"
GRID_WIDTH = "0.94"
GRID_BIAS = "0.80"
DARKEN_GRID = "0.0"
DARKEN_COLOUR = "0.10"
BACKGROUND_INTENSITY = "1.0"

View file

@ -14,9 +14,10 @@ textures = "BACKGROUND"
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
BACKGROUND_linear = false
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR"
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR;BACKGROUND_INTENSITY"
GRID_INTENSITY = "0.72"
GRID_WIDTH = "0.94"
GRID_BIAS = "0.80"
DARKEN_GRID = "0.0"
DARKEN_COLOUR = "0.10"
BACKGROUND_INTENSITY = "1.0"

View file

@ -14,9 +14,10 @@ textures = "BACKGROUND"
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
BACKGROUND_linear = false
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR"
parameters = "GRID_INTENSITY;GRID_WIDTH;GRID_BIAS;DARKEN_GRID;DARKEN_COLOUR;BACKGROUND_INTENSITY"
GRID_INTENSITY = "0.72"
GRID_WIDTH = "0.94"
GRID_BIAS = "0.80"
DARKEN_GRID = "0.0"
DARKEN_COLOUR = "0.10"
BACKGROUND_INTENSITY = "1.0"