| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/opengl/cartoonshadinggl.h>

Public Member Functions | |
| CartoonShadingGL (bool useSpecular=true, bool useShapeMaterial=false, float ambientRange=0.4f, float diffuseRange=0.93f, const Color &globalAmbient=Color(0.7, 0.7, 0.7)) | |
| bool | useSpecular () const |
| void | useSpecular (bool) |
| bool | useShapeMaterial () const |
| void | useShapeMaterial (bool) |
| float | getAmbientRange () const |
| float | getDiffuseRange () const |
| void | setColorRange (float ambient, float diffuse) |
| const Color & | getGlobalAmbient () const |
| void | setGlobalAmbient (const Color &globalAmbient) |
| VRS_TYPEINFO (CartoonShadingGL, EdgeEnhancementGL) | |
| VRS_SERIALIZABLE (CartoonShadingGL) | |
| VRS::CartoonShadingGL::CartoonShadingGL | ( | bool | useSpecular = true, |
|
| bool | useShapeMaterial = false, |
|||
| float | ambientRange = 0.4f, |
|||
| float | diffuseRange = 0.93f, |
|||
| const Color & | globalAmbient = Color(0.7,0.7,0.7) | |||
| ) | [inline] |
| bool VRS::CartoonShadingGL::useSpecular | ( | ) | const [inline] |
Cartoon shading calculates diffuce color values for the shadowed and for the illuminated surface patch of an object. The portion of each diffuse value is calculated using the material properties of the objects, ambient and diffuse coefficients of the light source and the global ambient coefficient. The illuminated diffuse is calculated by: Ci = a_g*a_m + a_l*a_m + d_l*d_m; and the shadowed diffuse by: Cs = a_g*a_m + a_l*a_m; where a_g is an global ambient coefficient, a_l, d_l refere to the coefficients of the light source and a_m, d_m are given by the material. Toon shading uses an additional specular highlights if preferred. The shadowed and illuminated and the specular surface patches are distinguished due to the surface normal and the light direction. If no material is given for an object, a default shapematerial is used. Alternativly, one can use an the current color attribute instead. This is obvious, if no material for individual objects is supplied by the scene graph.
| void VRS::CartoonShadingGL::useSpecular | ( | bool | s | ) | [inline] |
Use specular highlight.
| bool VRS::CartoonShadingGL::useShapeMaterial | ( | ) | const [inline] |
| void VRS::CartoonShadingGL::useShapeMaterial | ( | bool | s | ) | [inline] |
Use shape material. Otherwise, color attributes is used for shading.
| float VRS::CartoonShadingGL::getAmbientRange | ( | ) | const [inline] |
| float VRS::CartoonShadingGL::getDiffuseRange | ( | ) | const [inline] |
| void VRS::CartoonShadingGL::setColorRange | ( | float | ambient, | |
| float | diffuse | |||
| ) | [inline] |
Different color regions result from fall off between normal and lightdirection. A color can be assigned by setting the range explicitly.
| const Color & VRS::CartoonShadingGL::getGlobalAmbient | ( | ) | const [inline] |
| void VRS::CartoonShadingGL::setGlobalAmbient | ( | const Color & | globalAmbient | ) | [inline] |
Global ambient color for cartoon shading.
| VRS::CartoonShadingGL::VRS_TYPEINFO | ( | CartoonShadingGL | , | |
| EdgeEnhancementGL | ||||
| ) |
| VRS::CartoonShadingGL::VRS_SERIALIZABLE | ( | CartoonShadingGL | ) |