1 minute reading time
(135 words)
triangle.vfl
/* Name : triangle.vfl
* Modifed By : 정현준
* Shader 소개 : 삼각형 패턴 shader 입니다.
*/
#pragma label enlarge "Enlarge View"
#pragma label spread "Spread Intensity"
#pragma label trignleColor "Triangle Color"
#pragma label bgColor "Back Ground Color"
#pragma label shape "Triangle Shpae"
#pragma hint bgColor color
#pragma hint trignleColor color
#define segment 1.73205080757
surface hjcTriangle(
float enlarge = 1.0,
spread = 2.0;
vector trignleColor = 0,
bgColor = 1;
int shape = 2;
)
{
vector Pos = P * abs(enlarge);
float x = Pos.x / (segment/shape);
float y = (Pos.y - x/shape)%spread;
x = x % spread;
if( x > 1 - y )
{
Cf = bgColor;
}
else
{
Cf = trignleColor;
}
}
Comments