mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-29 10:51:30 +11:00
Merge pull request #487 from timmcca-be/simpletex_bg_intensity
Add "Background Intensity" parameter to simpletex shaders
This commit is contained in:
commit
d9cf8eaf45
|
@ -40,6 +40,9 @@
|
||||||
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
||||||
- 0.0: Colours are normal
|
- 0.0: Colours are normal
|
||||||
- 2.0: Colours are too dark...
|
- 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
|
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
|
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 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_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 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
|
layout(push_constant) uniform Push
|
||||||
{
|
{
|
||||||
|
@ -67,6 +71,7 @@ layout(push_constant) uniform Push
|
||||||
float GRID_BIAS;
|
float GRID_BIAS;
|
||||||
float DARKEN_GRID;
|
float DARKEN_GRID;
|
||||||
float DARKEN_COLOUR;
|
float DARKEN_COLOUR;
|
||||||
|
float BACKGROUND_INTENSITY;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
|
@ -203,7 +208,7 @@ void main()
|
||||||
// Note: Have to calculate luminosity a second time... tiresome, but
|
// Note: Have to calculate luminosity a second time... tiresome, but
|
||||||
// it's not a particulary expensive operation...
|
// it's not a particulary expensive operation...
|
||||||
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
|
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);
|
FragColor = vec4(colour.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,9 @@
|
||||||
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
||||||
- 0.0: Colours are normal
|
- 0.0: Colours are normal
|
||||||
- 2.0: Colours are too dark...
|
- 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
|
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
|
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 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_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 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
|
layout(push_constant) uniform Push
|
||||||
{
|
{
|
||||||
|
@ -67,6 +71,7 @@ layout(push_constant) uniform Push
|
||||||
float GRID_BIAS;
|
float GRID_BIAS;
|
||||||
float DARKEN_GRID;
|
float DARKEN_GRID;
|
||||||
float DARKEN_COLOUR;
|
float DARKEN_COLOUR;
|
||||||
|
float BACKGROUND_INTENSITY;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
|
@ -203,7 +208,7 @@ void main()
|
||||||
// Note: Have to calculate luminosity a second time... tiresome, but
|
// Note: Have to calculate luminosity a second time... tiresome, but
|
||||||
// it's not a particulary expensive operation...
|
// it's not a particulary expensive operation...
|
||||||
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
|
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);
|
FragColor = vec4(colour.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,9 @@
|
||||||
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
||||||
- 0.0: Colours are normal
|
- 0.0: Colours are normal
|
||||||
- 2.0: Colours are too dark...
|
- 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
|
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
|
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 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_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 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
|
layout(push_constant) uniform Push
|
||||||
{
|
{
|
||||||
|
@ -67,6 +71,7 @@ layout(push_constant) uniform Push
|
||||||
float GRID_BIAS;
|
float GRID_BIAS;
|
||||||
float DARKEN_GRID;
|
float DARKEN_GRID;
|
||||||
float DARKEN_COLOUR;
|
float DARKEN_COLOUR;
|
||||||
|
float BACKGROUND_INTENSITY;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
|
@ -203,7 +208,7 @@ void main()
|
||||||
// Note: Have to calculate luminosity a second time... tiresome, but
|
// Note: Have to calculate luminosity a second time... tiresome, but
|
||||||
// it's not a particulary expensive operation...
|
// it's not a particulary expensive operation...
|
||||||
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
|
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);
|
FragColor = vec4(colour.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,9 @@
|
||||||
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
||||||
- 0.0: Colours are normal
|
- 0.0: Colours are normal
|
||||||
- 2.0: Colours are too dark...
|
- 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
|
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
|
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 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_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 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
|
layout(push_constant) uniform Push
|
||||||
{
|
{
|
||||||
|
@ -67,6 +71,7 @@ layout(push_constant) uniform Push
|
||||||
float GRID_BIAS;
|
float GRID_BIAS;
|
||||||
float DARKEN_GRID;
|
float DARKEN_GRID;
|
||||||
float DARKEN_COLOUR;
|
float DARKEN_COLOUR;
|
||||||
|
float BACKGROUND_INTENSITY;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
|
@ -203,7 +208,7 @@ void main()
|
||||||
// Note: Have to calculate luminosity a second time... tiresome, but
|
// Note: Have to calculate luminosity a second time... tiresome, but
|
||||||
// it's not a particulary expensive operation...
|
// it's not a particulary expensive operation...
|
||||||
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
|
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);
|
FragColor = vec4(colour.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
||||||
- 0.0: Colours are normal
|
- 0.0: Colours are normal
|
||||||
- 2.0: Colours are too dark...
|
- 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
|
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
|
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 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_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 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
|
layout(push_constant) uniform Push
|
||||||
{
|
{
|
||||||
|
@ -63,6 +67,7 @@ layout(push_constant) uniform Push
|
||||||
float GRID_BIAS;
|
float GRID_BIAS;
|
||||||
float DARKEN_GRID;
|
float DARKEN_GRID;
|
||||||
float DARKEN_COLOUR;
|
float DARKEN_COLOUR;
|
||||||
|
float BACKGROUND_INTENSITY;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
|
@ -181,7 +186,7 @@ void main()
|
||||||
// Note: Have to calculate luminosity a second time... tiresome, but
|
// Note: Have to calculate luminosity a second time... tiresome, but
|
||||||
// it's not a particulary expensive operation...
|
// it's not a particulary expensive operation...
|
||||||
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
|
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);
|
FragColor = vec4(colour.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
||||||
- 0.0: Colours are normal
|
- 0.0: Colours are normal
|
||||||
- 2.0: Colours are too dark...
|
- 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
|
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
|
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 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_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 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
|
layout(push_constant) uniform Push
|
||||||
{
|
{
|
||||||
|
@ -63,6 +67,7 @@ layout(push_constant) uniform Push
|
||||||
float GRID_BIAS;
|
float GRID_BIAS;
|
||||||
float DARKEN_GRID;
|
float DARKEN_GRID;
|
||||||
float DARKEN_COLOUR;
|
float DARKEN_COLOUR;
|
||||||
|
float BACKGROUND_INTENSITY;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
|
@ -181,7 +186,7 @@ void main()
|
||||||
// Note: Have to calculate luminosity a second time... tiresome, but
|
// Note: Have to calculate luminosity a second time... tiresome, but
|
||||||
// it's not a particulary expensive operation...
|
// it's not a particulary expensive operation...
|
||||||
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
|
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);
|
FragColor = vec4(colour.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,9 @@
|
||||||
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
||||||
- 0.0: Colours are normal
|
- 0.0: Colours are normal
|
||||||
- 2.0: Colours are too dark...
|
- 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
|
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
|
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 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_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 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
|
layout(push_constant) uniform Push
|
||||||
{
|
{
|
||||||
|
@ -68,6 +72,7 @@ layout(push_constant) uniform Push
|
||||||
float GRID_BIAS;
|
float GRID_BIAS;
|
||||||
float DARKEN_GRID;
|
float DARKEN_GRID;
|
||||||
float DARKEN_COLOUR;
|
float DARKEN_COLOUR;
|
||||||
|
float BACKGROUND_INTENSITY;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
|
@ -195,7 +200,7 @@ void main()
|
||||||
// Note: Have to calculate luminosity a second time... tiresome, but
|
// Note: Have to calculate luminosity a second time... tiresome, but
|
||||||
// it's not a particulary expensive operation...
|
// it's not a particulary expensive operation...
|
||||||
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
|
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);
|
FragColor = vec4(colour.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,9 @@
|
||||||
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
||||||
- 0.0: Colours are normal
|
- 0.0: Colours are normal
|
||||||
- 2.0: Colours are too dark...
|
- 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
|
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
|
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 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_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 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
|
layout(push_constant) uniform Push
|
||||||
{
|
{
|
||||||
|
@ -68,6 +72,7 @@ layout(push_constant) uniform Push
|
||||||
float GRID_BIAS;
|
float GRID_BIAS;
|
||||||
float DARKEN_GRID;
|
float DARKEN_GRID;
|
||||||
float DARKEN_COLOUR;
|
float DARKEN_COLOUR;
|
||||||
|
float BACKGROUND_INTENSITY;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
|
@ -195,7 +200,7 @@ void main()
|
||||||
// Note: Have to calculate luminosity a second time... tiresome, but
|
// Note: Have to calculate luminosity a second time... tiresome, but
|
||||||
// it's not a particulary expensive operation...
|
// it's not a particulary expensive operation...
|
||||||
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
|
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);
|
FragColor = vec4(colour.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
> DARKEN_COLOUR: Simply darkens pixel colours (effectively lowers gamma level of pixels)
|
||||||
- 0.0: Colours are normal
|
- 0.0: Colours are normal
|
||||||
- 2.0: Colours are too dark...
|
- 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
|
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
|
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 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_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 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
|
layout(push_constant) uniform Push
|
||||||
{
|
{
|
||||||
|
@ -65,6 +69,7 @@ layout(push_constant) uniform Push
|
||||||
float GRID_BIAS;
|
float GRID_BIAS;
|
||||||
float DARKEN_GRID;
|
float DARKEN_GRID;
|
||||||
float DARKEN_COLOUR;
|
float DARKEN_COLOUR;
|
||||||
|
float BACKGROUND_INTENSITY;
|
||||||
vec4 OutputSize;
|
vec4 OutputSize;
|
||||||
vec4 OriginalSize;
|
vec4 OriginalSize;
|
||||||
vec4 SourceSize;
|
vec4 SourceSize;
|
||||||
|
@ -174,7 +179,7 @@ void main()
|
||||||
// Note: Have to calculate luminosity a second time... tiresome, but
|
// Note: Have to calculate luminosity a second time... tiresome, but
|
||||||
// it's not a particulary expensive operation...
|
// it's not a particulary expensive operation...
|
||||||
luma = (LUMA_R * colour.r) + (LUMA_G * colour.g) + (LUMA_B * colour.b);
|
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);
|
FragColor = vec4(colour.rgb, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,10 @@ textures = "BACKGROUND"
|
||||||
BACKGROUND = "shaders/simpletex_lcd/png/4k/textured_paper.png"
|
BACKGROUND = "shaders/simpletex_lcd/png/4k/textured_paper.png"
|
||||||
BACKGROUND_linear = false
|
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_INTENSITY = "0.65"
|
||||||
GRID_WIDTH = "0.65"
|
GRID_WIDTH = "0.65"
|
||||||
GRID_BIAS = "0.6"
|
GRID_BIAS = "0.6"
|
||||||
DARKEN_GRID = "0.0"
|
DARKEN_GRID = "0.0"
|
||||||
DARKEN_COLOUR = "0.05"
|
DARKEN_COLOUR = "0.05"
|
||||||
|
BACKGROUND_INTENSITY = "1.0"
|
||||||
|
|
|
@ -14,9 +14,10 @@ textures = "BACKGROUND"
|
||||||
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
||||||
BACKGROUND_linear = false
|
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_INTENSITY = "0.65"
|
||||||
GRID_WIDTH = "0.65"
|
GRID_WIDTH = "0.65"
|
||||||
GRID_BIAS = "0.6"
|
GRID_BIAS = "0.6"
|
||||||
DARKEN_GRID = "0.0"
|
DARKEN_GRID = "0.0"
|
||||||
DARKEN_COLOUR = "0.05"
|
DARKEN_COLOUR = "0.05"
|
||||||
|
BACKGROUND_INTENSITY = "1.0"
|
||||||
|
|
|
@ -14,9 +14,10 @@ textures = "BACKGROUND"
|
||||||
BACKGROUND = "shaders/simpletex_lcd/png/4k/textured_paper.png"
|
BACKGROUND = "shaders/simpletex_lcd/png/4k/textured_paper.png"
|
||||||
BACKGROUND_linear = false
|
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_INTENSITY = "0.65"
|
||||||
GRID_WIDTH = "0.65"
|
GRID_WIDTH = "0.65"
|
||||||
GRID_BIAS = "0.6"
|
GRID_BIAS = "0.6"
|
||||||
DARKEN_GRID = "0.0"
|
DARKEN_GRID = "0.0"
|
||||||
DARKEN_COLOUR = "0.05"
|
DARKEN_COLOUR = "0.05"
|
||||||
|
BACKGROUND_INTENSITY = "1.0"
|
||||||
|
|
|
@ -14,9 +14,10 @@ textures = "BACKGROUND"
|
||||||
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
||||||
BACKGROUND_linear = false
|
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_INTENSITY = "0.65"
|
||||||
GRID_WIDTH = "0.65"
|
GRID_WIDTH = "0.65"
|
||||||
GRID_BIAS = "0.6"
|
GRID_BIAS = "0.6"
|
||||||
DARKEN_GRID = "0.0"
|
DARKEN_GRID = "0.0"
|
||||||
DARKEN_COLOUR = "0.05"
|
DARKEN_COLOUR = "0.05"
|
||||||
|
BACKGROUND_INTENSITY = "1.0"
|
||||||
|
|
|
@ -14,9 +14,10 @@ textures = "BACKGROUND"
|
||||||
BACKGROUND = "shaders/simpletex_lcd/png/4k/textured_paper.png"
|
BACKGROUND = "shaders/simpletex_lcd/png/4k/textured_paper.png"
|
||||||
BACKGROUND_linear = false
|
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_INTENSITY = "0.65"
|
||||||
GRID_WIDTH = "0.65"
|
GRID_WIDTH = "0.65"
|
||||||
GRID_BIAS = "0.6"
|
GRID_BIAS = "0.6"
|
||||||
DARKEN_GRID = "0.0"
|
DARKEN_GRID = "0.0"
|
||||||
DARKEN_COLOUR = "0.05"
|
DARKEN_COLOUR = "0.05"
|
||||||
|
BACKGROUND_INTENSITY = "1.0"
|
||||||
|
|
|
@ -14,9 +14,10 @@ textures = "BACKGROUND"
|
||||||
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
||||||
BACKGROUND_linear = false
|
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_INTENSITY = "0.65"
|
||||||
GRID_WIDTH = "0.65"
|
GRID_WIDTH = "0.65"
|
||||||
GRID_BIAS = "0.6"
|
GRID_BIAS = "0.6"
|
||||||
DARKEN_GRID = "0.0"
|
DARKEN_GRID = "0.0"
|
||||||
DARKEN_COLOUR = "0.05"
|
DARKEN_COLOUR = "0.05"
|
||||||
|
BACKGROUND_INTENSITY = "1.0"
|
||||||
|
|
|
@ -14,9 +14,10 @@ textures = "BACKGROUND"
|
||||||
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
||||||
BACKGROUND_linear = false
|
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_INTENSITY = "0.72"
|
||||||
GRID_WIDTH = "0.94"
|
GRID_WIDTH = "0.94"
|
||||||
GRID_BIAS = "0.80"
|
GRID_BIAS = "0.80"
|
||||||
DARKEN_GRID = "0.0"
|
DARKEN_GRID = "0.0"
|
||||||
DARKEN_COLOUR = "0.10"
|
DARKEN_COLOUR = "0.10"
|
||||||
|
BACKGROUND_INTENSITY = "1.0"
|
||||||
|
|
|
@ -14,9 +14,10 @@ textures = "BACKGROUND"
|
||||||
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
||||||
BACKGROUND_linear = false
|
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_INTENSITY = "0.72"
|
||||||
GRID_WIDTH = "0.94"
|
GRID_WIDTH = "0.94"
|
||||||
GRID_BIAS = "0.80"
|
GRID_BIAS = "0.80"
|
||||||
DARKEN_GRID = "0.0"
|
DARKEN_GRID = "0.0"
|
||||||
DARKEN_COLOUR = "0.10"
|
DARKEN_COLOUR = "0.10"
|
||||||
|
BACKGROUND_INTENSITY = "1.0"
|
||||||
|
|
|
@ -14,9 +14,10 @@ textures = "BACKGROUND"
|
||||||
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
BACKGROUND = "shaders/simpletex_lcd/png/2k/textured_paper.png"
|
||||||
BACKGROUND_linear = false
|
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_INTENSITY = "0.72"
|
||||||
GRID_WIDTH = "0.94"
|
GRID_WIDTH = "0.94"
|
||||||
GRID_BIAS = "0.80"
|
GRID_BIAS = "0.80"
|
||||||
DARKEN_GRID = "0.0"
|
DARKEN_GRID = "0.0"
|
||||||
DARKEN_COLOUR = "0.10"
|
DARKEN_COLOUR = "0.10"
|
||||||
|
BACKGROUND_INTENSITY = "1.0"
|
||||||
|
|
Loading…
Reference in a new issue