![x^2+y^2+z^2+sin(4*x)+sin(4*y)+sin(4*z)=1,vector(h,s,v)=vector(sin([38*r+2*pi*n]),0.5,1)](formula1.png)
The hue of the surface colors are computed by the following
fragment program. The conversion from hsv to rgb is done in a
separate pass.
!!ARBfp1.0
TEMP R0;
PARAM U0 = program.local[0];
PARAM C0 = {
38.000000000000000000000000000000,
0.500000000000000000000000000000,
1.000000000000000000000000000000,
0.000000000000000000000000000000
};
MUL R0.x, fragment.texcoord[0].x, fragment.texcoord[0].x;
MAD R0.y, fragment.texcoord[0].y, fragment.texcoord[0].y, R0.x;
MAD R0.x, fragment.texcoord[0].z, fragment.texcoord[0].z, R0.y;
RSQ R0.y, R0.x;
RCP R0.x, R0.y;
MUL R0.y, C0.x, R0.x;
ADD R0.x, R0.y, U0.x;
SIN R0.y, R0.x;
MOV_SAT R0.x, C0.z;
FRC result.color.x, R0.y;
MOV result.color.y, C0.y;
MUL result.color.z, C0.z, fragment.color.primary.z;
MOV result.color.w, C0.z;
END