HTML5+CSS on Canvas 3D WebGL (TM) Library

specLight Library Method

Short Description: Set specular light factor and shininess

Signature: t.specLight (spec,shininess)
Group: Texture
Class: transition Class

Defines the amount of specular light reflected and the shininess for the current transition. spec is a non-negative value <1 giving the specular light factor. Specular lights have the color of the light source (white by default) multiplied by the specular light factor. The shininess must be an integer between 1 and 1024. The bigger the more shiny the material appears and smaller specular lights appear.

Note that, in the examples below, you can see the specular lights only at a certain rotation angle. The first example shows the default value. The second one disables specular lights by setting spec to 0. The following examples show various shininess values. The last example shows that specular lights are better visible, if ambient and diffuse lights are a bit reduced.

Examples"Layout").rotateMiddle(0,1,0).dur(7).start(); RUN"Layout").rotateMiddle(0,1,0).dur(7).specLight(0,1).start(); RUN"Layout").rotateMiddle(0,1,0).dur(7).specLight(0.5,16).start(); RUN"Layout").rotateMiddle(0,1,0).dur(7).specLight(0.5,128).start(); RUN"Layout").rotateMiddle(0,1,0).dur(7).specLight(0.5,512).start(); RUN"Layout").rotateMiddle(0,1,0).dur(7).

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:transition.shadowOnly - Control display of shadows on transition
Previous Page: transition.lightBgAmbDiff - Set background color, ambient and diffuse factors
Please Add a Comment or Question, click here!