Functions | |
void | EnableLight (counter Light, counter DoEnable) |
Enables or disables a light. | |
void | EnableLightFixed (counter Light, counter DoEnable) |
Enables or disables a light fixed. | |
void | ResetLight () |
Resets all lighting settings to the default ones. | |
void | SetAmbientLight (color Col) |
Sets the global ambient color. | |
void | SetLightAmbientCol (color Col) |
Sets the ambient color of a light. | |
void | SetLightAttenuation (counter Light, scalar C, scalar L, scalar Q) |
Sets the attenuation of the light with distance from its source. | |
void | SetLightDiffuseCol (color Col) |
Sets the diffuse color of a light. | |
void | SetLightPos (counter Light, scalar X, scalar Y, scalar Z, scalar W) |
Sets the position of a light. | |
void | SetLightPos (counter Light, multivector P) |
Sets the position of a light. | |
void | SetLightSpecularCol (color Col) |
Sets the specular color of a light. | |
void | SetLightSpotCutOff (counter Light, scalar Angle) |
Sets the opening angle of a spot light. | |
void | SetLightSpotDir (counter Light, scalar X, scalar Y, scalar Z) |
Sets the direction in which a light shines. | |
void | SetLightSpotDir (counter Light, multivector D) |
Sets the direction in which a light shines. | |
void | SetLightSpotExp (counter Light, scalar Exp) |
Sets the fuzzyness of the spot border. |
One important aspects of lighting is that each light has three main light components:
DefVarsE3(); :E3_DRAW_VEC_AS_POINT; :Blue; :A = -3*e1; Dir = e1; fSpotCutOff = 15; EnableLight(0, 0); EnableLight(1, 1); EnableLightFixed(1,0); SetAmbientLight(DWhite); SetLightPos(1, A); SetLightAmbientCol(1, Black); SetLightDiffuseCol(1, MMagenta); SetLightSpecularCol(1, MGray); SetLightSpotDir(1, Dir); SetLightSpotCutOff(1, fSpotCutOff); SetLightSpotExp(1, 2); SetLightAttenuation(1, 0.1, 0, 0); :N3_SOLID; :MWhite; :SphereN3(0,0,0, 1); DrawCone(A-0.05*Dir, Dir, tan(fSpotCutOff*RadPerDeg));
This generates the following visualization.
The example script LightTest2.clu
gives a nice example of an animated lighting effect. Here is a screenshot.
|
Enables or disables a light.
|
|
Enables or disables a light fixed.
|
|
Resets all lighting settings to the default ones.
|
|
Sets the global ambient color.
|
|
Sets the ambient color of a light.
|
|
Sets the attenuation of the light with distance from its source.
|
|
Sets the diffuse color of a light.
|
|
Sets the position of a light.
|
|
Sets the position of a light.
|
|
Sets the specular color of a light.
|
|
Sets the opening angle of a spot light.
|
|
Sets the direction in which a light shines.
|
|
Sets the direction in which a light shines.
|
|
Sets the fuzzyness of the spot border.
|