Ocean
|
This class implements object lighting functions. More...
Public Types | |
enum | LightingModes { LM_UNLIT = 0 , LM_SHADING_LAMBERT = (1 << 0) , LM_SHADING_SPECULAR = (1 << 1) | LM_SHADING_LAMBERT , LM_TRANSPARENCY = (1 << 2) , LM_REFLECTION_SPECULAR = (1 << 3) , LM_REFRACTION_SPECULAR = (1 << 4) | LM_TRANSPARENCY , LM_SHADOWS = (1 << 5) , LM_SHADOWS_SUPERSAMPLE = (1 << 6) | LM_SHADOWS , LM_SHADOWS_TRANSLUCENT_LIGHT = (1 << 7) | LM_SHADOWS , LM_SHADING_FULL = LM_SHADING_LAMBERT | LM_SHADING_SPECULAR , LM_REFLECTION_REFRACTION_FULL = LM_REFLECTION_SPECULAR | LM_REFRACTION_SPECULAR , LM_SHADOWS_FULL = LM_SHADOWS | LM_SHADOWS_SUPERSAMPLE | LM_SHADOWS_TRANSLUCENT_LIGHT , LM_LIGHTING_FULL = LM_SHADING_FULL | LM_REFLECTION_REFRACTION_FULL | LM_SHADOWS_FULL } |
Definition of individual lighting modes. More... | |
Static Public Member Functions | |
static bool | dampedLight (const Vector3 &viewPosition, const Vector3 &viewObjectDirection, const Vector3 &objectPosition, const Vector3 &objectNormal, const Vector2 &textureCoordinate, const GIMaterial *material, const GITextures *textures, const LightSources &lightSources, const TracingObject &object, const TracingGroup &root, const unsigned int bounces, const LightingModes lightingModes, RGBAColor &color) |
Determines the light (the color) for a specified viewing ray, intersection point, appearance information and light sources, including damped light from translucent objects between the intersection object and all light sources. More... | |
static bool | directLight (const Vector3 &viewObjectDirection, const Vector3 &objectPosition, const Vector3 &objectNormal, const Vector3 &lightObjectDirection, const RGBAColor &materialLightDiffuse, const RGBAColor &materialLightSpecular, const Scalar materialSpecularExponent, const LightingModes lightingModes, RGBAColor &diffuse, RGBAColor &specular) |
Determines the direct lighting for a specific location and light source using the Lambert shading with optional additional specular shading. More... | |
static RGBAColor | lightDampingFactors (const Vector3 &lightPosition, const Vector3 &lightObjectDirection, const Scalar lightObjectDistance, const RGBAColor &lightColor, const TracingGroup &root, const LightingModes lightingModes) |
Determines the light damping factors for a specific position and light source. More... | |
Static Protected Member Functions | |
static Scalar | pointLightAttenuationFactor (const Vector3 &lightAttenuation, const Scalar lightObjectDistance, const Scalar intensity) |
Returns the attenuation factor for a given point light. More... | |
static Scalar | pointLightAttenuationFactorSqr (const Vector3 &lightAttenuation, const Scalar lightObjectDistanceSqr, const Scalar intensity) |
Returns the attenuation factor for a given point light. More... | |
static Scalar | spotLightAttenuationFactor (const Vector3 &lightAttenuation, const Scalar lightObjectDistance, const Scalar intensity, const Vector3 &lightDirection, const Vector3 &lightObjectDirection, const Scalar coneAngleCos, const Scalar spotExponent) |
Returns the attenuation factor for a given spot light. More... | |
This class implements object lighting functions.
Definition of individual lighting modes.
|
static |
Determines the light (the color) for a specified viewing ray, intersection point, appearance information and light sources, including damped light from translucent objects between the intersection object and all light sources.
viewPosition | The start position of the viewing ray |
viewObjectDirection | The direction of the viewing ray |
objectPosition | The intersction location of the viewing ray with any kind of object |
objectNormal | The normal at the intersection location of the object |
textureCoordinate | The texture coordinate at the location of the intersection |
material | The material information of the object which is intersected |
textures | The textures of the object |
lightSources | The light sources defining the entire amount of light in the scene |
object | The tracing object which is intersected |
root | The root of all tracing objects defining the entire scene |
bounces | The number of reflection bounces to be used, with range [0, infinity) |
lightingModes | The lighting modes defining lighting technique to be applied |
color | The resulting color/light for the defined viewing ray |
|
static |
Determines the direct lighting for a specific location and light source using the Lambert shading with optional additional specular shading.
The light as distributed from the light source is expected to be not attenuated by any obstacle between light and object.
However, the resulting color/light can be adjusted by any kind of adjustment factor e.g., to integrate any kind of attenuation.
viewObjectDirection | Direction starting at the viewing position (the center of projection) and pointing to the object intersection location, with unit length |
objectPosition | The location on the object where the viewing ray intersects the object |
objectNormal | The normal on the object where the viewing ray intersects the object |
lightObjectDirection | Direction starting at the light source and pointing to the object intersection location, with unit length |
materialLightDiffuse | Combination of diffuse light and material components |
materialLightSpecular | Combination of specular light and material components |
materialSpecularExponent | Specular material exponent |
lightingModes | The lighting modes defining lighting technique to be applied |
diffuse | Resulting diffuse color |
specular | Resulting specular color |
|
static |
Determines the light damping factors for a specific position and light source.
lightPosition | Position of the light source |
lightObjectDirection | Direction starting at the light source pointing to the object intersection position, with unit length |
lightObjectDistance | Distance between the object's intersection point and the light source |
lightColor | Color of the light source |
root | Root tracing object |
lightingModes | The lighting modes defining lighting technique to be applied |
|
inlinestaticprotected |
Returns the attenuation factor for a given point light.
lightAttenuation | Constant, linear and square light attenuation factors |
lightObjectDistance | Distance between the object's intersection point and the light source |
intensity | Intensity of the light source, with range [0, 1] |
|
inlinestaticprotected |
Returns the attenuation factor for a given point light.
lightAttenuation | Constant, linear and square light attenuation factors |
lightObjectDistanceSqr | Square distance between the object's intersection point and the light source, with range [0, infinity) |
intensity | Intensity of the light source, with range [0, 1] |
|
inlinestaticprotected |
Returns the attenuation factor for a given spot light.
lightAttenuation | Constant, linear and square light attenuation factors |
lightObjectDistance | Distance between the object's intersection point and the light source |
intensity | Intensity of the light source, with range [0, 1] |
lightDirection | Direction of the spotlight starting at the light source pointing into the scene, with unit length |
lightObjectDirection | Direction starting at the light source pointing to the object intersection position, with unit length |
coneAngleCos | Cosine of the spont light cone angle |
spotExponent | Lighting exponent of the spot light, with range [0, 128] |