mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-23 00:01:31 +11:00
improvements in pattern
This commit is contained in:
parent
93dfa33afe
commit
0e1eefef9f
|
@ -16,7 +16,7 @@ layout(push_constant) uniform Push
|
||||||
|
|
||||||
// Parameter lines go here:
|
// Parameter lines go here:
|
||||||
|
|
||||||
#pragma parameter msk_scale "Mask Scale, to be equal to OSSC LINES" 4.0 4.0 5.0 1.0
|
#pragma parameter msk_scale "Mask Scale, to be equal to OSSC LINES" 4.0 3.0 5.0 1.0
|
||||||
#define msk_scale params.msk_scale
|
#define msk_scale params.msk_scale
|
||||||
|
|
||||||
#pragma parameter MASK_INTENSITY "Mask Brightness" 0.2 0.0 1.0 0.05
|
#pragma parameter MASK_INTENSITY "Mask Brightness" 0.2 0.0 1.0 0.05
|
||||||
|
@ -66,6 +66,23 @@ vec3 mask(vec2 pos, vec3 col)
|
||||||
vec2 p = pos*global.OutputSize.xy;
|
vec2 p = pos*global.OutputSize.xy;
|
||||||
p = (p/size);
|
p = (p/size);
|
||||||
|
|
||||||
|
if (msk_scale == 3.0)
|
||||||
|
{
|
||||||
|
x = fract(p.x/6.0);
|
||||||
|
y = fract(p.y/3.0);
|
||||||
|
if (x < 0.5){
|
||||||
|
if (x<1.0/6.0 && y > 1.0/3.0) msk.b = 1.0;
|
||||||
|
else if (x<2.0/6.0 && x>1.0/6.0 && y > 1.0/3.0 ) msk.g = 1.0;
|
||||||
|
else if (x<3.0/6.0 && x>2.0/6.0 && y > 1.0/3.0 ) msk.r = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (x > 0.4999){
|
||||||
|
if (x<4.0/6.0 && y < 2.0/3.0 || x<4.0/6.0 && y >= 3.0/3.0 ) msk.b = 1.0;
|
||||||
|
else if (x<5.0/6.0 && x>4.0/6.0 && y < 2.0/3.0 || x<5.0/6.0 && x>4.0/6.0 && y >= 3.0/3.0) msk.g = 1.0;
|
||||||
|
else if (x<6.0/6.0 && x>5.0/6.0 && y < 2.0/3.0 || x<6.0/6.0 && x>5.0/6.0 && y >= 3.0/3.0) msk.r = 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (msk_scale == 4.0)
|
if (msk_scale == 4.0)
|
||||||
{
|
{
|
||||||
|
@ -78,9 +95,9 @@ if (msk_scale == 4.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (x > 0.4999){
|
else if (x > 0.4999){
|
||||||
if (x<4.0/6.0 && y < 3.0/4.0) msk.b = 1.0;
|
if (x<4.0/6.0 && y < 2.0/4.0 || x<4.0/6.0 && y >= 3.0/4.0 ) msk.b = 1.0;
|
||||||
else if (x<5.0/6.0 && x>4.0/6.0 && y > 1.0/4.0 ) msk.g = 1.0;
|
else if (x<5.0/6.0 && x>4.0/6.0 && y < 2.0/4.0 || x<5.0/6.0 && x>4.0/6.0 && y >= 3.0/4.0) msk.g = 1.0;
|
||||||
else if (x<6.0/6.0 && x>5.0/6.0 && y < 3.0/4.0 ) msk.r = 1.0;
|
else if (x<6.0/6.0 && x>5.0/6.0 && y < 2.0/4.0 || x<6.0/6.0 && x>5.0/6.0 && y >= 3.0/4.0) msk.r = 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,14 +107,14 @@ if (msk_scale == 5.0)
|
||||||
y = fract(p.y/5.0);
|
y = fract(p.y/5.0);
|
||||||
if (x < 0.5){
|
if (x < 0.5){
|
||||||
if (x<1.0/6.0 && y > 1.0/5.0) msk.b = 1.0;
|
if (x<1.0/6.0 && y > 1.0/5.0) msk.b = 1.0;
|
||||||
else if (x<2.0/6.0 && x>1.0/6.0 && y < 4.0/5.0 ) msk.g = 1.0;
|
else if (x<2.0/6.0 && x>1.0/6.0 && y > 1.0/5.0 ) msk.g = 1.0;
|
||||||
else if (x<3.0/6.0 && x>2.0/6.0 && y > 1.0/5.0 ) msk.r = 1.0;
|
else if (x<3.0/6.0 && x>2.0/6.0 && y > 1.0/5.0 ) msk.r = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (x > 0.4999){
|
else if (x > 0.4999){
|
||||||
if (x<4.0/6.0 && y < 2.0/5.0 || x<4.0/6.0 && y >= 3.0/5.0) msk.b = 1.0;
|
if (x<4.0/6.0 && y < 3.0/5.0 || x<4.0/6.0 && y >= 4.0/5.0) msk.b = 1.0;
|
||||||
else if (x<5.0/6.0 && x>4.0/6.0 && y < 3.0/5.0 || x<5.0/6.0 && x>4.0/6.0 && y >= 4.0/5.0 ) msk.g = 1.0;
|
else if (x<5.0/6.0 && x>4.0/6.0 && y < 3.0/5.0 || x<5.0/6.0 && x>4.0/6.0 && y >= 4.0/5.0 ) msk.g = 1.0;
|
||||||
else if (x<6.0/6.0 && x>5.0/6.0 && y < 2.0/5.0 || x<6.0/6.0 && x>5.0/6.0 && y >= 3.0/5.0 ) msk.r = 1.0;
|
else if (x<6.0/6.0 && x>5.0/6.0 && y < 3.0/5.0 || x<6.0/6.0 && x>5.0/6.0 && y >= 4.0/5.0 ) msk.r = 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue