mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-22 15:51:30 +11:00
update phase in main function
This commit is contained in:
parent
df9b480805
commit
a24fd351db
|
@ -37,18 +37,9 @@ layout(set = 0, binding = 2) uniform sampler2D Source;
|
|||
|
||||
#define PI 3.14159265
|
||||
float phase = (global.OriginalSize.x > 300.0) ? 2.0 : 3.0;
|
||||
float CHROMA_MOD_FREQ = (phase < 2.5) ? (4.0 * PI / 15.0) : (PI / 3.0);
|
||||
float ARTIFACTING = 1.0 - global.quality;
|
||||
float FRINGING = 1.0 - global.quality;
|
||||
float SATURATION = 1.0 - global.bw;
|
||||
// prevent some very slight clipping that happens at 1.0
|
||||
const float BRIGHTNESS = 0.95;
|
||||
|
||||
mat3 mix_mat = mat3(
|
||||
BRIGHTNESS, FRINGING, FRINGING,
|
||||
ARTIFACTING, 2.0 * SATURATION, 0.0,
|
||||
ARTIFACTING, 0.0, 2.0 * SATURATION
|
||||
);
|
||||
|
||||
#define mix_mat mat3(BRIGHTNESS, FRINGING, FRINGING, ARTIFACTING, 2.0 * SATURATION, 0.0, ARTIFACTING, 0.0, 2.0 * SATURATION)
|
||||
|
||||
const mat3 yiq2rgb_mat = mat3(
|
||||
1.0, 0.956, 0.6210,
|
||||
|
@ -73,6 +64,12 @@ vec3 rgb2yiq(vec3 col)
|
|||
|
||||
void main()
|
||||
{
|
||||
float CHROMA_MOD_FREQ = (phase < 2.5) ? (4.0 * PI / 15.0) : (PI / 3.0);
|
||||
float ARTIFACTING = 1.0 - global.quality;
|
||||
float FRINGING = 1.0 - global.quality;
|
||||
float SATURATION = 1.0 - global.bw;
|
||||
// prevent some very slight clipping that happens at 1.0
|
||||
const float BRIGHTNESS = 0.95;
|
||||
vec3 col = texture(Source, vTexCoord).rgb;
|
||||
vec3 yiq = rgb2yiq(col);
|
||||
|
||||
|
|
|
@ -33,8 +33,6 @@ layout(location = 0) in vec2 vTexCoord;
|
|||
layout(location = 0) out vec4 FragColor;
|
||||
layout(set = 0, binding = 2) uniform sampler2D Source;
|
||||
|
||||
float phase = (global.OriginalSize.x > 300.0) ? 2.0 : 3.0;
|
||||
|
||||
const mat3 yiq2rgb_mat = mat3(
|
||||
1.0, 0.956, 0.6210,
|
||||
1.0, -0.2720, -0.6474,
|
||||
|
@ -184,6 +182,7 @@ const float chroma_filter_3_phase[25] = float[25](
|
|||
|
||||
void main()
|
||||
{
|
||||
float phase = (global.OriginalSize.x > 300.0) ? 2.0 : 3.0;
|
||||
float one_x = global.SourceSize.z;
|
||||
vec3 signal = vec3(0.0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue