top of page
shader Donut(
float s = 0
[[
int lockgeom = 0,
string widget = "null",
]],
float t = 0
[[
int lockgeom = 0,
string widget = "null",
]],
float out_radius = 0.5,
float in_radius = 0.2,
float s_point = 0.5,
float t_point = 0.5,
color A_color = color(1,1,1),
color B_color = color(0,0,1),
output color resultRGB = 0)
{
float ss = fmod(s,1);
float tt = fmod(t,1);
float A = ss - s_point;
float B = tt - t_point;
if((A*A + B*B) >= in_radius*in_radius && (A*A + B*B) <= out_radius*out_radius)
resultRGB = A_color;
else
resultRGB = B_color;
}
bottom of page