A function that takes: (1) the point of the vertex, (2) the normal at the vertex, (3) the UV coordinate of the vertex, and (4) the projection from world coordinates to the eye, returning a color.
Creates a shader with a checkerboard pattern that alternates between two shaders.
Creates a shader with a checkerboard pattern that alternates between two shaders.
the first shader
the second shader
a checkboard shader
Creates a diffuse (Lambertian) shader with the specified surface map and the specified light.
Creates a diffuse (Lambertian) shader with the specified surface map and the specified light.
the surface map sampled for colors
the lights used as an illumination source
a Lambert shader
Creates a shiny (Phong) shader with the specified surface map and the specified light.
Creates a shiny (Phong) shader with the specified surface map and the specified light.
For best results, scale down the diffuse and specular maps so they add up to about 1.0; a ratio of 0.8 diffuse--0.2 specular is a good starting point.
the surface map sampled for diffuse colors
the surface map sampled for specular colors
the hardness of the specular reflection (the Phong cosine power)
the lights used as an illumination source
a Phong shader
A solid color shader.
A solid color shader.
the color
a shader
Creates a toon/cel shader, using Lambertian reflectance only, with the specified surface map and the specified light.
Creates a toon/cel shader, using Lambertian reflectance only, with the specified surface map and the specified light.
Note: this shader guesses edges by comparing the surface normal with the vector from the camera; this causes surfaces nearly perpendicular to the camera to appear completely black (as edges).
the surface map sampled for non-edge colors
the surface map sampled for edge colors
the number of levels of shading
a factor that is proportional to the edge contour thickness; 0.0 = no contour, 1.0 = thickest contour
a factor that controls how smooth the smoothness between the surface and contours; 0.0 = no smoothing, 1.0 = smoothed across entire surface
the lights used as an illumination source
a toon shader
Creates a toon/cel shader, using Lambertian reflectance only, with the specified surface map and the specified light.
Creates a toon/cel shader, using Lambertian reflectance only, with the specified surface map and the specified light.
Note: this shader guesses edges by comparing the surface normal with the vector from the camera; this causes surfaces nearly perpendicular to the camera to appear completely black (as edges).
the surface map sampled for non-edge colors
the surface map sampled for specular colors
the surface map sampled for edge colors
the size of the specular reflection (the Phong cosine power)
the number of levels of shading
a factor that is proportional to the edge contour thickness; 0.0 = no contour, 1.0 = thickest contour
a factor that controls how smooth the smoothness between the surface and contours or highlights; 0.0 = no smoothing, 1.0 = smoothed across entire surface
the lights used as an illumination source
a toon shader
A shader for testing UV coordinates.
A shader for testing UV coordinates. U = 0 is the least saturated; U = 1 is the most saturated (sky blue color). V = 0 is the darkest; V = 1 is the lightest.
a UV test shader
Contains pre-defined color shaders.