Drag[en]gine Game Engine
1.21
|
World camera. More...
#include <deCamera.h>
Public Types | |
typedef deTObjectReference< deCamera > | Ref |
Type holding strong reference. More... | |
Public Types inherited from deResource | |
typedef deTObjectReference< deResource > | Ref |
Type holding strong reference. More... | |
Public Types inherited from deObject | |
typedef deTObjectReference< deObject > | Ref |
Type holding strong reference. More... | |
Public Member Functions | |
Management | |
const decDVector & | GetPosition () const |
Position. More... | |
void | SetPosition (const decDVector &position) |
Set position. More... | |
const decQuaternion & | GetOrientation () const |
Orientation. More... | |
void | SetOrientation (const decQuaternion &orientation) |
Set orientation. More... | |
float | GetFov () const |
Vertical field of view in radians for the entire view. More... | |
void | SetFov (float fov) |
Set vertical field of view in radians of the entire view. More... | |
float | GetFovRatio () const |
Aspect ratio of the horizontal field of view to the vertical field of view. More... | |
void | SetFovRatio (float ratio) |
Set aspect ratio of the horizonral field of view to the vertical field of view. More... | |
float | GetImageDistance () const |
Distance to the image plane. More... | |
void | SetImageDistance (float distance) |
Set distance to the image plane. More... | |
float | GetViewDistance () const |
Viewing distance up to which world geometry is rendered. More... | |
void | SetViewDistance (float distance) |
Set view distance up to which world geometry is rendered. More... | |
bool | GetEnableHDRR () const |
Enable high definition range rendering (HDRR) if supported. More... | |
void | SetEnableHDRR (bool enable) |
Set to enable high definition range rendering (HDRR) if supported. More... | |
float | GetExposure () const |
Exposure. More... | |
void | SetExposure (float exposure) |
Set exposure. More... | |
float | GetLowestIntensity () const |
Lowest intensity the eye can adapt to. More... | |
void | SetLowestIntensity (float lowestIntensity) |
Set lowest intensity the eye can adapt to. More... | |
float | GetHighestIntensity () const |
Highest intensity the eye can adapt to. More... | |
void | SetHighestIntensity (float highestIntensity) |
Set highest intensity the eye can adapt to. More... | |
float | GetAdaptionTime () const |
Adaption time of the eye in seconds. More... | |
void | SetAdaptionTime (float adaptionTime) |
Set adaption time of the eye in seconds. More... | |
bool | GetEnableGI () const |
Enable global illumination (GI) if supported. More... | |
void | SetEnableGI (bool enable) |
Set to enable global illumination (GI) if supported. More... | |
decLayerMask & | GetLayerMask () |
Layer mask. Call NotifyLayerMaskChanged afterwards. More... | |
const decLayerMask & | GetLayerMask () const |
void | NotifyLayerMaskChanged () |
Notifies the peers that the layer mask changed. More... | |
void | ResetAdaptedIntensity () |
Request graphic module to reset adapted intensity to optimal value. More... | |
float | GetWhiteIntensity () const |
White intensity multiplier. More... | |
void | SetWhiteIntensity (float intensity) |
Set white intensity multiplier. More... | |
float | GetBloomIntensity () const |
Bloom intensity multiplier. More... | |
void | SetBloomIntensity (float intensity) |
Set bloom intensity multiplier. More... | |
float | GetBloomStrength () const |
Bloom strength as multiplier of intensity beyond bloom intensity. More... | |
void | SetBloomStrength (float strength) |
Set bloom strength as multiplier of intensity beyond bloom intensity. More... | |
float | GetBloomBlend () const |
Bloom blend as multiplier of intensity beyond bloom intensity. More... | |
void | SetBloomBlend (float blend) |
Set bloom blend as multiplier of intensity beyond bloom intensity. More... | |
float | GetBloomSize () const |
Bloom size as percentage of screen width. More... | |
void | SetBloomSize (float size) |
Bloom size as percentage of screen width. More... | |
const decCurveBezier & | GetToneMapCurve () const |
Custom tone mapping curve or empty curve to disable. More... | |
void | SetToneMapCurve (const decCurveBezier &curve) |
Set custom tone mapping curve or empty curve to disable. More... | |
Effects | |
int | GetEffectCount () const |
Count of effects. More... | |
deEffect * | GetEffectAt (int index) const |
Effect at the given index. More... | |
void | AddEffect (deEffect *effect) |
Adds an effect. More... | |
void | RemoveEffect (deEffect *effect) |
Removes an effect. More... | |
void | RemoveAllEffects () |
Removes all effects. More... | |
System Peers | |
deBaseGraphicCamera * | GetPeerGraphic () const |
Graphic system camera peer. More... | |
void | SetPeerGraphic (deBaseGraphicCamera *peer) |
Set graphic system camera peer. More... | |
Public Member Functions inherited from deResource | |
deResourceManager * | GetResourceManager () const |
Resource manager or NULL if resource is leaking. More... | |
deEngine * | GetEngine () const |
Game engine object from resource manager. More... | |
deResource * | GetLLManagerPrev () const |
Previous resource in the resource manager linked list. More... | |
void | SetLLManagerPrev (deResource *resource) |
Set next resource in the resource manager linked list. More... | |
deResource * | GetLLManagerNext () const |
Next resource in the resource manager linked list. More... | |
void | SetLLManagerNext (deResource *resource) |
Set next resource in the resource manager linked list. More... | |
void | MarkLeaking () |
Marks the resource leaking. More... | |
deResource (deResourceManager *resourceManager) | |
Create resource. More... | |
Public Member Functions inherited from deObject | |
int | GetRefCount () const |
Reference count. More... | |
void | AddReference () |
Add reference increasing reference count by 1. More... | |
void | FreeReference () |
Decrease reference count by one and delete object if count reaches 0. More... | |
deObject () | |
Create object with reference count of 1. More... | |
Constructors and Destructors | |
deCamera (deCameraManager *manager) | |
Create new camera object with the given resource manager. More... | |
virtual | ~deCamera () |
Clean up camera. More... | |
Linked List | |
deWorld * | GetParentWorld () const |
Parent world or NULL. More... | |
void | SetParentWorld (deWorld *world) |
Set parent world or NULL. More... | |
deCamera * | GetLLWorldPrev () const |
Previous camera in the parent world linked list. More... | |
void | SetLLWorldPrev (deCamera *camera) |
Set next camera in the parent world linked list. More... | |
deCamera * | GetLLWorldNext () const |
Next camera in the parent world linked list. More... | |
void | SetLLWorldNext (deCamera *camera) |
Set next camera in the parent world linked list. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from deResource | |
virtual | ~deResource () |
Clean up resource. More... | |
Protected Member Functions inherited from deObject | |
virtual | ~deObject () |
Clean up object. More... | |
World camera.
A world camera defines the camera parameters used for rendering a world. Cameras have various parameters useful to alter the way the world is rendered.
The lower and upper intensity parameter indicates the range of intensity the camera can automatically adapt to. The chosen intensity level for a camera is the "scene intensity" (or "average intensity"). This intensity is mapped to a reasonable middle gray value in the final image.
The exposure is used to increase or decrease the overall luminance of the rendered world. This alters the scene intensity mapping to the middle gray value. Use values lower than 1 to make the image darker and values higher than 1 to brighten up the image. Reducing the exposure usually decreases also the contrast which can make images more pleasant.
Using the "scene intensity" a "maximum intensity" is determined for the image. The maximum intensity maps to pure white in the final image. Using the white intensity parameter this intensity can be shifted to avoid bright parts of the image to wash out to white. This can happen when the camera is located inside a room while looking out into the sun light. The behavior of the white intensity parameter depends on the presence of custom tone mapping. If custom tone mapping curve is not used the white intensity parameter alters the tone mapping parameters used by the graphic module to reduce the washing out to white. If custom tone mapping curve is used the white intensity parameter indicates the upper bound of the input send through the curve. Pixel intensities above the white intensity are thus clamped to the white intensity. The default value is 2.
In games overbrighting is often used as a gameplay element to simulate very bright pixel for example an energy beam or entering a room with glaring light while coming out of night light conditions. Overbrighting can be done in two ways. For overbrighting affecting the entire screen like for example flashbangs using a post processing color matrix effect is the best choice. For overbrighting on a per pixel basis blooming is typically used. For this intensities of pixels are clamped against a "bloom intensity threshold". Intensites above this threshold are used to create halo light effects similar to oversatured rods in the eye. The effect is controlled by the bloom intensity, bloom strength, bloom blend and bloom size parameter.
The bloom intensity is a multiplier applied to the current "maximum intensity" of the camera. The default value is 1. To produce an overbright effect pixel requires an intensity 1 times as bright than the current camera maximum intensity.
The bloom strength is a multiplier applied to the overbright intensity beyond the bloom intensity threshold. For example if the threshold is 1 and the pixel intensity is 2 then the overbright intensity is 1 and is multiplied with the strength factor. This allows to modify the amount of intensity required to result in a strong glare. The default value is 0.25
The bloom blend is a multiplier applied to the overbright calculated for a pixel. This is typically used to blend between using bloom (1) and not using bloom (0).
Blooming usually spreads due to rods oversaturating which is a chemical process in the eye. The bloom size indicates the broadness of the blur as percentage of the screen width.
Optionally a custom tone mapping curve can be defined. The custom tone mapping curve is used if it has at least one curve point. The default custom tone mapping curve is empty.
typedef deTObjectReference<deCamera> deCamera::Ref |
Type holding strong reference.
deCamera::deCamera | ( | deCameraManager * | manager | ) |
Create new camera object with the given resource manager.
|
protectedvirtual |
Clean up camera.
void deCamera::AddEffect | ( | deEffect * | effect | ) |
Adds an effect.
|
inline |
Adaption time of the eye in seconds.
|
inline |
Bloom blend as multiplier of intensity beyond bloom intensity.
|
inline |
Bloom intensity multiplier.
|
inline |
Bloom size as percentage of screen width.
|
inline |
Bloom strength as multiplier of intensity beyond bloom intensity.
deEffect* deCamera::GetEffectAt | ( | int | index | ) | const |
Effect at the given index.
int deCamera::GetEffectCount | ( | ) | const |
Count of effects.
|
inline |
Enable global illumination (GI) if supported.
|
inline |
Enable high definition range rendering (HDRR) if supported.
|
inline |
Exposure.
|
inline |
Vertical field of view in radians for the entire view.
|
inline |
Aspect ratio of the horizontal field of view to the vertical field of view.
|
inline |
Highest intensity the eye can adapt to.
|
inline |
Distance to the image plane.
|
inline |
Layer mask. Call NotifyLayerMaskChanged afterwards.
|
inline |
|
inline |
Next camera in the parent world linked list.
|
inline |
Previous camera in the parent world linked list.
|
inline |
Lowest intensity the eye can adapt to.
|
inline |
Orientation.
|
inline |
Parent world or NULL.
|
inline |
Graphic system camera peer.
|
inline |
Position.
|
inline |
Custom tone mapping curve or empty curve to disable.
|
inline |
Viewing distance up to which world geometry is rendered.
|
inline |
White intensity multiplier.
void deCamera::NotifyLayerMaskChanged | ( | ) |
Notifies the peers that the layer mask changed.
void deCamera::RemoveAllEffects | ( | ) |
Removes all effects.
void deCamera::RemoveEffect | ( | deEffect * | effect | ) |
Removes an effect.
void deCamera::ResetAdaptedIntensity | ( | ) |
Request graphic module to reset adapted intensity to optimal value.
void deCamera::SetAdaptionTime | ( | float | adaptionTime | ) |
Set adaption time of the eye in seconds.
void deCamera::SetBloomBlend | ( | float | blend | ) |
Set bloom blend as multiplier of intensity beyond bloom intensity.
void deCamera::SetBloomIntensity | ( | float | intensity | ) |
Set bloom intensity multiplier.
void deCamera::SetBloomSize | ( | float | size | ) |
Bloom size as percentage of screen width.
void deCamera::SetBloomStrength | ( | float | strength | ) |
Set bloom strength as multiplier of intensity beyond bloom intensity.
void deCamera::SetEnableGI | ( | bool | enable | ) |
Set to enable global illumination (GI) if supported.
void deCamera::SetEnableHDRR | ( | bool | enable | ) |
Set to enable high definition range rendering (HDRR) if supported.
void deCamera::SetExposure | ( | float | exposure | ) |
Set exposure.
void deCamera::SetFov | ( | float | fov | ) |
Set vertical field of view in radians of the entire view.
void deCamera::SetFovRatio | ( | float | ratio | ) |
Set aspect ratio of the horizonral field of view to the vertical field of view.
void deCamera::SetHighestIntensity | ( | float | highestIntensity | ) |
Set highest intensity the eye can adapt to.
void deCamera::SetImageDistance | ( | float | distance | ) |
Set distance to the image plane.
void deCamera::SetLLWorldNext | ( | deCamera * | camera | ) |
Set next camera in the parent world linked list.
void deCamera::SetLLWorldPrev | ( | deCamera * | camera | ) |
Set next camera in the parent world linked list.
void deCamera::SetLowestIntensity | ( | float | lowestIntensity | ) |
Set lowest intensity the eye can adapt to.
void deCamera::SetOrientation | ( | const decQuaternion & | orientation | ) |
Set orientation.
void deCamera::SetParentWorld | ( | deWorld * | world | ) |
Set parent world or NULL.
void deCamera::SetPeerGraphic | ( | deBaseGraphicCamera * | peer | ) |
Set graphic system camera peer.
void deCamera::SetPosition | ( | const decDVector & | position | ) |
Set position.
void deCamera::SetToneMapCurve | ( | const decCurveBezier & | curve | ) |
Set custom tone mapping curve or empty curve to disable.
void deCamera::SetViewDistance | ( | float | distance | ) |
Set view distance up to which world geometry is rendered.
void deCamera::SetWhiteIntensity | ( | float | intensity | ) |
Set white intensity multiplier.