CamSim  0.0.0
A rasterization-based simulator for various types of cameras
List of all members
CamSim::Light Class Reference

The Light class. More...

Public Attributes

Type
LightType type
 Light source type. More...
 
float innerConeAngle
 For spot lights: inner cone angle in degrees. More...
 
float outerConeAngle
 For spot lights: outer cone angle in degrees. More...
 
Geometry
bool isRelativeToCamera
 Flag: does this light source move with the camera? More...
 
QVector3D position
 Position. More...
 
QVector3D direction
 Direction (for spot lights and directional lights) More...
 
QVector3D up
 "Up vector" (for shadow mapping and power factor maps). Must be perpendicular to direction. More...
 
Basic simulation parameters
QVector3D color
 Light color, for classic OpenGL cameras. More...
 
float power
 Power in Watt, for PMD cameras. More...
 
float attenuationConstant
 Constant attenuation coefficient. Should be 1 for physically plausible lights. More...
 
float attenuationLinear
 Linear attenuation coefficient. Should be 0 for physically plausible lights. More...
 
float attenuationQuadratic
 Quadratic attenuation coefficient. Should be 1 for physically plausible lights. More...
 
Shadows and reflective shadow maps
bool shadowMap
 Flag: does this light source create a shadow map? (Used if shadow maps are active in the simulator pipeline.) More...
 
unsigned int shadowMapSize
 Width and height of shadow map (only used if shadowMap is true) More...
 
float shadowMapDepthBias
 Bias for comparison with shadow map depths. Value should be greater than or equal to zero. More...
 
bool reflectiveShadowMap
 Flag: does this light source create reflective shadow maps? (Used if reflective shadow maps are active in the simulator pipeline.) More...
 
unsigned int reflectiveShadowMapSize
 Width and height of reflective shadow map (only used if reflectiveShadowMap is true) More...
 

Advanced simulation parameters

unsigned int powerFactorTex
 Texture containing power factor map (or 0 if unavailable). This will be created and updated automatically by the simulator; you only have to care about the parameters defined below. More...
 
int powerFactorMapWidth
 Width of the power factor map. More...
 
int powerFactorMapHeight
 Height of the power factor map. More...
 
float powerFactorMapAngleLeft
 Angle in degrees at left border of power distribution map (seen from light source) More...
 
float powerFactorMapAngleRight
 Angle in degrees at right border of power distribution map (seen from light source) More...
 
float powerFactorMapAngleBottom
 Angle in degrees at bottom border of power distribution map (seen from light source) More...
 
float powerFactorMapAngleTop
 Angle in degrees at top border of power distribution map (seen from light source) More...
 
QVector< float > powerFactors
 Vector containing power factor map values (or empty). More...
 
bool(* powerFactorMapCallback )(void *callbackData, long long timestamp, int *mapWidth, int *mapHeight, float *angleLeft, float *angleRight, float *angleBottom, float *angleTop, QVector< float > &factors)
 Callback function that allows dynamically changing power factor maps. More...
 
void * powerFactorMapCallbackData
 Pointer to user-defined data fed into the power factor map callback. More...
 
 Light ()
 Constructor. More...
 
void updatePowerFactorTex (unsigned int pbo, long long timestamp)
 Update a power factor texture from the values given. This function is used by the simulator; do not call it in your own code. More...
 

Detailed Description

The Light class.

This describes a light source for OpenGL-based rendering.

Constructor & Destructor Documentation

◆ Light()

CamSim::Light::Light ( )

Constructor.

Member Function Documentation

◆ updatePowerFactorTex()

void CamSim::Light::updatePowerFactorTex ( unsigned int  pbo,
long long  timestamp 
)

Update a power factor texture from the values given. This function is used by the simulator; do not call it in your own code.

Member Data Documentation

◆ attenuationConstant

float CamSim::Light::attenuationConstant

Constant attenuation coefficient. Should be 1 for physically plausible lights.

◆ attenuationLinear

float CamSim::Light::attenuationLinear

Linear attenuation coefficient. Should be 0 for physically plausible lights.

◆ attenuationQuadratic

float CamSim::Light::attenuationQuadratic

Quadratic attenuation coefficient. Should be 1 for physically plausible lights.

◆ color

QVector3D CamSim::Light::color

Light color, for classic OpenGL cameras.

◆ direction

QVector3D CamSim::Light::direction

Direction (for spot lights and directional lights)

◆ innerConeAngle

float CamSim::Light::innerConeAngle

For spot lights: inner cone angle in degrees.

◆ isRelativeToCamera

bool CamSim::Light::isRelativeToCamera

Flag: does this light source move with the camera?

◆ outerConeAngle

float CamSim::Light::outerConeAngle

For spot lights: outer cone angle in degrees.

◆ position

QVector3D CamSim::Light::position

Position.

◆ power

float CamSim::Light::power

Power in Watt, for PMD cameras.

◆ powerFactorMapAngleBottom

float CamSim::Light::powerFactorMapAngleBottom

Angle in degrees at bottom border of power distribution map (seen from light source)

◆ powerFactorMapAngleLeft

float CamSim::Light::powerFactorMapAngleLeft

Angle in degrees at left border of power distribution map (seen from light source)

◆ powerFactorMapAngleRight

float CamSim::Light::powerFactorMapAngleRight

Angle in degrees at right border of power distribution map (seen from light source)

◆ powerFactorMapAngleTop

float CamSim::Light::powerFactorMapAngleTop

Angle in degrees at top border of power distribution map (seen from light source)

◆ powerFactorMapCallback

bool(* CamSim::Light::powerFactorMapCallback) (void *callbackData, long long timestamp, int *mapWidth, int *mapHeight, float *angleLeft, float *angleRight, float *angleBottom, float *angleTop, QVector< float > &factors)

Callback function that allows dynamically changing power factor maps.

Parameters
callbackDataUser defined pointer, see powerFactorMapCallbackData
timestampTime stamp for which to generate the map
mapWidthWidth of the generated map
mapHeightHeight of the generated map
angleLeftHorizontal angle corresponding to left border of map
angleRightHorizontal angle corresponding to right border of map
angleBottomVertical angle corresponding to bottom border of map
angleTopVertical angle corresponding to top border of map
factorsThe map; this vector should be resized and filled with values
Returns
Whether any of the values changed compared to the last version

◆ powerFactorMapCallbackData

void* CamSim::Light::powerFactorMapCallbackData

Pointer to user-defined data fed into the power factor map callback.

◆ powerFactorMapHeight

int CamSim::Light::powerFactorMapHeight

Height of the power factor map.

◆ powerFactorMapWidth

int CamSim::Light::powerFactorMapWidth

Width of the power factor map.

◆ powerFactors

QVector<float> CamSim::Light::powerFactors

Vector containing power factor map values (or empty).

◆ powerFactorTex

unsigned int CamSim::Light::powerFactorTex

Texture containing power factor map (or 0 if unavailable). This will be created and updated automatically by the simulator; you only have to care about the parameters defined below.

Each texel corresponds to an outgoing angle (horizontally and vertically) and contains a floating point value in [0,1] that is multiplied with the light source power value ('color' for classic OpenGL cameras; 'power' for PMD cameras).

◆ reflectiveShadowMap

bool CamSim::Light::reflectiveShadowMap

Flag: does this light source create reflective shadow maps? (Used if reflective shadow maps are active in the simulator pipeline.)

◆ reflectiveShadowMapSize

unsigned int CamSim::Light::reflectiveShadowMapSize

Width and height of reflective shadow map (only used if reflectiveShadowMap is true)

◆ shadowMap

bool CamSim::Light::shadowMap

Flag: does this light source create a shadow map? (Used if shadow maps are active in the simulator pipeline.)

◆ shadowMapDepthBias

float CamSim::Light::shadowMapDepthBias

Bias for comparison with shadow map depths. Value should be greater than or equal to zero.

◆ shadowMapSize

unsigned int CamSim::Light::shadowMapSize

Width and height of shadow map (only used if shadowMap is true)

◆ type

LightType CamSim::Light::type

Light source type.

◆ up

QVector3D CamSim::Light::up

"Up vector" (for shadow mapping and power factor maps). Must be perpendicular to direction.


The documentation for this class was generated from the following file: