|  |  |  |  |  |  |  |  |  | 
|  | ||||||||
|  |  |  |  | |||||
|  |  |  |  |  |  | |||
Category
Function
Specifies the shading attributes of an object.
Syntax
output = Shade(input, shade, how, specular, shininess, diffuse,
               ambient);
Inputs
| Name | Type | Default | Description | 
|---|---|---|---|
| input | object | none | object to be shaded | 
| shade | flag | 1 | 0: object not shaded 1: object shaded | 
| how | string | none | ("smooth" or "faceted") | 
| specular | scalar | none | specular coefficient (standard = 0.5) | 
| shininess | integer | none | shininess exponent (standard = 10) | 
| diffuse | scalar | none | diffuse coefficient (standard = 0.7) | 
| ambient | scalar | none | ambient coefficient (standard = 1.0) | 
Outputs
| Name | Type | Description | 
|---|---|---|
| output | field | shaded object | 
Functional Details
This module is applicable only to surface objects (i.e., objects with connections of type "triangle" or "quad").
| input | specifies the object whose shading attributes are to be modified. | 
| shade | turns shading on or off. By default, the module turns shading on. | 
| how | specifies whether the shading is to be smooth or faceted. If this parameter is not set, and: 
 An explicit specification of "smooth" or "faceted" shading will apply to all objects. However, if a "normals" component of the requested type ("dep" "positions" or "dep" "connections") is already present, the normals are not recomputed. | 
The next four parameters specify the particular shading attributes of the object. If any of these parameters are not explicitly set, the corresponding attributes remain unchanged.
| specular | specifies the amount of light reflected by the object (as from a very smooth, highly reflective surface). The specified value must be between 0 and 1. The default is 0.5. | 
| shininess | specifies how sharp the specular highlight is. The specified value must be an integer. Larger numbers result in a smaller, sharper, specular highlight. The default is 10. | 
| diffuse | specifies how much light is diffused by the object (as from a rough non-reflective surface). The specified value must be between 0 and 1. The default is 1 (one). | 
| ambient | specifies how much light is reflected equally in all directions. The specified value must be between 0 and 1. | 
Notes:
Components
May add or modify the "normals" component. All other components are unchanged.
Example Visual Programs
AlternateVisualizations.net Imide_potential.net UsingShade.net
See Also
[ OpenDX Home at IBM | OpenDX.org ]