Without lights you wouldn't be able to see anything. Luckily fluxus gives you one for free by default, a white diffuse point light attached to the camera. For more interesting lighting, you'll need these functions. Using the standard fixed function graphics pipeline, simplistically speaking, OpenGL multiplies these values with the surface material (set with local state commands like ambient and diffuse) and the texture colour value to give the final colour.
lightid-number
Makes a new light. The type can be one of: "point", "directional" or "spot". If the cameralocked string is not "free" then it will be attached to the camera, and move around when you move the camera.
(make-light "spot" "locked")
void
Sets the ambient contribution for the specified light.
(light-ambient mylight (vector 1 1 1)) ; a boring light
void
Sets the diffuse contribution for the specified light.
(light-diffuse mylight (vector 1 1 1))
void
Sets the specular contribution for the specified light.
(light-specular mylight (vector 1 1 1))
void
Sets the position of the specified light. In worldspace if free, in camera space is attached.
(light-position mylight (vector 0 100 0))
void
Sets the spotlight cone angle of the specified light. If it's not a spot light, this command has no effect.
(light-position mylight (vector 0 100 0))
void
Sets the spotlight exponent (fuzzyness of the cone) of the specified light. If it's not a spot light, this command has no effect.
(light-spot-exponent mylight 0.1)
void
Sets the light attenuation (fade off with distance) of the specified light. The type string can be one of: "constant", "linear" or "quadratic".
(light-spot-exponent mylight 0.1)
void
Sets the direction of a directional light. If it's not a directional light, this command has no effect.
(light-spot-exponent mylight 0.1)