mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-26 01:11:32 +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:
|
||||
|
||||
#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
|
||||
|
||||
#pragma parameter MASK_INTENSITY "Mask Brightness" 0.2 0.0 1.0 0.05
|
||||
|
@ -66,21 +66,38 @@ vec3 mask(vec2 pos, vec3 col)
|
|||
vec2 p = pos*global.OutputSize.xy;
|
||||
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)
|
||||
{
|
||||
x = fract(p.x/6.0);
|
||||
y = fract(p.y/4.0);
|
||||
if (x < 0.5){
|
||||
if (x<1.0/6.0 && y > 1.0/4.0) msk.b = 1.0;
|
||||
if (x<1.0/6.0 && y > 1.0/4.0) msk.b = 1.0;
|
||||
else if (x<2.0/6.0 && x>1.0/6.0 && y < 3.0/4.0 ) msk.g = 1.0;
|
||||
else if (x<3.0/6.0 && x>2.0/6.0 && y > 1.0/4.0 ) msk.r = 1.0;
|
||||
}
|
||||
|
||||
else if (x > 0.4999){
|
||||
if (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<6.0/6.0 && x>5.0/6.0 && y < 3.0/4.0 ) msk.r = 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 < 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 < 2.0/4.0 || x<6.0/6.0 && x>5.0/6.0 && y >= 3.0/4.0) msk.r = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,15 +106,15 @@ if (msk_scale == 5.0)
|
|||
x = fract(p.x/6.0);
|
||||
y = fract(p.y/5.0);
|
||||
if (x < 0.5){
|
||||
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;
|
||||
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 > 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 > 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;
|
||||
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;
|
||||
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<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