mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-22 15:51:30 +11:00
Merge pull request #79 from Monroe88/lcd-shaders
sameboy-lcd: Add parameters
This commit is contained in:
commit
cf7c908776
|
@ -25,7 +25,7 @@ layout(push_constant) uniform Push
|
|||
float reflectionDistanceX;
|
||||
float reflectionDistanceY;
|
||||
float lightBrightness;
|
||||
} params;
|
||||
}params;
|
||||
|
||||
#pragma parameter reflectionBrightness "Reflection brightness" 0.07 0.0 1.0 0.01
|
||||
#pragma parameter reflectionDistanceX "Reflection Distance X" 0.0 -1.0 1.0 0.005
|
||||
|
|
|
@ -34,6 +34,21 @@ layout(std140, set = 0, binding = 0) uniform UBO
|
|||
mat4 MVP;
|
||||
} global;
|
||||
|
||||
layout(push_constant) uniform Push
|
||||
{
|
||||
float COLOR_LOW;
|
||||
float COLOR_HIGH;
|
||||
float SCANLINE_DEPTH;
|
||||
} params;
|
||||
|
||||
#pragma parameter COLOR_LOW "Color Low" 0.8 0.0 1.5 0.05
|
||||
#pragma parameter COLOR_HIGH "Color High" 1.0 0.0 1.5 0.05
|
||||
#pragma parameter SCANLINE_DEPTH "Scanline Depth" 0.1 0.0 2.0 0.05
|
||||
|
||||
#define COLOR_LOW params.COLOR_LOW
|
||||
#define COLOR_HIGH params.COLOR_HIGH
|
||||
#define SCANLINE_DEPTH params.SCANLINE_DEPTH
|
||||
|
||||
#pragma stage vertex
|
||||
layout(location = 0) in vec4 Position;
|
||||
layout(location = 1) in vec2 TexCoord;
|
||||
|
@ -50,10 +65,6 @@ layout(location = 0) in vec2 vTexCoord;
|
|||
layout(location = 0) out vec4 FragColor;
|
||||
layout(set = 0, binding = 2) uniform sampler2D Source;
|
||||
|
||||
#define COLOR_LOW 0.8
|
||||
#define COLOR_HIGH 1.0
|
||||
#define SCANLINE_DEPTH 0.1
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 pos = fract(vTexCoord * global.SourceSize.xy);
|
||||
|
|
Loading…
Reference in a new issue