Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.Camera Class Reference

Camera. More...

Inheritance diagram for Dragengine.Scenery.Camera:

Public Member Functions

Constructors
Camera new ()
 Create camera. More...
 
Management
DVector getPosition ()
 Position. More...
 
void setPosition (DVector position)
 Set position. More...
 
Quaternion getOrientation ()
 Orientation. More...
 
void setOrientation (Quaternion orientation)
 Set orientation. More...
 
float getFov ()
 Field of view in degrees. More...
 
void setFov (float fov)
 Set field of view in degrees. More...
 
float getFovRatio ()
 Field of view aspect ratio. More...
 
void setFovRatio (float fovRatio)
 Set field of view aspect ratio. More...
 
float getImageDistance ()
 Distance to image plane in meters. More...
 
void setImageDistance (float distance)
 Set distance to image plane in meters. More...
 
float getViewDistance ()
 View distance in meters. More...
 
void setViewDistance (float distance)
 Set view distance in meters. More...
 
bool getEnableHDRR ()
 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 ()
 Exposure. More...
 
void setExposure (float exposure)
 Set expsoure. More...
 
float getLowestIntensity ()
 Lowest adaption intensity. More...
 
void setLowestIntensity (float lowestIntensity)
 Set lowest adaption intensity. More...
 
float getHighestIntensity ()
 Highest adaption intensity. More...
 
void setHighestIntensity (float highestIntensity)
 Set highest adaption intensity. More...
 
float getAdaptionTime ()
 Adaption time in seconds. More...
 
void setAdaptionTime (float adaptionTime)
 Set adaption time in seconds. More...
 
void resetAdaptedIntensity ()
 Request graphic module to reset adapted intensity to optimal value. More...
 
bool getEnableGI ()
 Enable global illumination (GI) if supported. More...
 
void setEnableGI (bool enable)
 Set to enable global illumination (GI) if supported. More...
 
float getWhiteIntensity ()
 White intensity multiplier. More...
 
void setWhiteIntensity (float intensity)
 Set white intensity multiplier. More...
 
float getBloomIntensity ()
 Bloom intensity multiplier. More...
 
void setBloomIntensity (float intensity)
 Set bloom intensity multiplier. More...
 
float getBloomStrength ()
 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 ()
 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 ()
 Bloom size as percentage of screen width. More...
 
void setBloomSize (float size)
 Bloom size as percentage of screen width. More...
 
CurveBezier getToneMapCurve ()
 Custom tone mapping curve or empty curve to disable. More...
 
void setToneMapCurve (CurveBezier curve)
 Set custom tone mapping curve or empty curve to disable. More...
 
LayerMask getLayerMask ()
 Layer mask for visibility masking. More...
 
void setLayerMask (LayerMask layerMask)
 Set layer mask for visibility masking. More...
 
Point project (Point viewportSize, DVector position)
 Project point from 3d world. More...
 
Vector backProject (Point viewportSize, Point position)
 Back project position into 3d world. More...
 
Vector backProject (int width, int height, int x, int y)
 Back project position into 3d world. More...
 
World getParentWorld ()
 Parent world or null if not added to a world. More...
 
DMatrix getMatrix ()
 World matrix of camera. More...
 
Effects
int getEffectCount ()
 Number of effects. More...
 
Effect getEffectAt (int index)
 Effect at index. More...
 
void addEffect (Effect effect)
 Add effect. More...
 
void removeEffect (Effect effect)
 Remove effect. More...
 
void removeAllEffects ()
 Remove all effects. More...
 

Detailed Description

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.

This is a native class.

Member Function Documentation

◆ addEffect()

void Dragengine.Scenery.Camera.addEffect ( Effect  effect)

Add effect.

◆ backProject() [1/2]

Vector Dragengine.Scenery.Camera.backProject ( int  width,
int  height,
int  x,
int  y 
)

Back project position into 3d world.

◆ backProject() [2/2]

Vector Dragengine.Scenery.Camera.backProject ( Point  viewportSize,
Point  position 
)

Back project position into 3d world.

◆ getAdaptionTime()

float Dragengine.Scenery.Camera.getAdaptionTime ( )

Adaption time in seconds.

◆ getBloomBlend()

float Dragengine.Scenery.Camera.getBloomBlend ( )

Bloom blend as multiplier of intensity beyond bloom intensity.

Version
1.21

◆ getBloomIntensity()

float Dragengine.Scenery.Camera.getBloomIntensity ( )

Bloom intensity multiplier.

Version
1.21

◆ getBloomSize()

float Dragengine.Scenery.Camera.getBloomSize ( )

Bloom size as percentage of screen width.

Version
1.21

◆ getBloomStrength()

float Dragengine.Scenery.Camera.getBloomStrength ( )

Bloom strength as multiplier of intensity beyond bloom intensity.

Version
1.21

◆ getEffectAt()

Effect Dragengine.Scenery.Camera.getEffectAt ( int  index)

Effect at index.

Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getEffectCount().

◆ getEffectCount()

int Dragengine.Scenery.Camera.getEffectCount ( )

Number of effects.

◆ getEnableGI()

bool Dragengine.Scenery.Camera.getEnableGI ( )

Enable global illumination (GI) if supported.

Version
1.5

◆ getEnableHDRR()

bool Dragengine.Scenery.Camera.getEnableHDRR ( )

Enable high definition range rendering (HDRR) if supported.

Version
1.5

◆ getExposure()

float Dragengine.Scenery.Camera.getExposure ( )

Exposure.

◆ getFov()

float Dragengine.Scenery.Camera.getFov ( )

Field of view in degrees.

◆ getFovRatio()

float Dragengine.Scenery.Camera.getFovRatio ( )

Field of view aspect ratio.

◆ getHighestIntensity()

float Dragengine.Scenery.Camera.getHighestIntensity ( )

Highest adaption intensity.

◆ getImageDistance()

float Dragengine.Scenery.Camera.getImageDistance ( )

Distance to image plane in meters.

◆ getLayerMask()

LayerMask Dragengine.Scenery.Camera.getLayerMask ( )

Layer mask for visibility masking.

◆ getLowestIntensity()

float Dragengine.Scenery.Camera.getLowestIntensity ( )

Lowest adaption intensity.

◆ getMatrix()

DMatrix Dragengine.Scenery.Camera.getMatrix ( )

World matrix of camera.

Version
1.7

◆ getOrientation()

Quaternion Dragengine.Scenery.Camera.getOrientation ( )

Orientation.

◆ getParentWorld()

World Dragengine.Scenery.Camera.getParentWorld ( )

Parent world or null if not added to a world.

◆ getPosition()

DVector Dragengine.Scenery.Camera.getPosition ( )

Position.

◆ getToneMapCurve()

CurveBezier Dragengine.Scenery.Camera.getToneMapCurve ( )

Custom tone mapping curve or empty curve to disable.

Version
1.21

◆ getViewDistance()

float Dragengine.Scenery.Camera.getViewDistance ( )

View distance in meters.

◆ getWhiteIntensity()

float Dragengine.Scenery.Camera.getWhiteIntensity ( )

White intensity multiplier.

Version
1.21

◆ new()

Camera Dragengine.Scenery.Camera.new ( )

Create camera.

◆ project()

Point Dragengine.Scenery.Camera.project ( Point  viewportSize,
DVector  position 
)

Project point from 3d world.

◆ removeAllEffects()

void Dragengine.Scenery.Camera.removeAllEffects ( )

Remove all effects.

◆ removeEffect()

void Dragengine.Scenery.Camera.removeEffect ( Effect  effect)

Remove effect.

◆ resetAdaptedIntensity()

void Dragengine.Scenery.Camera.resetAdaptedIntensity ( )

Request graphic module to reset adapted intensity to optimal value.

Version
1.4

◆ setAdaptionTime()

void Dragengine.Scenery.Camera.setAdaptionTime ( float  adaptionTime)

Set adaption time in seconds.

◆ setBloomBlend()

void Dragengine.Scenery.Camera.setBloomBlend ( float  blend)

Set bloom blend as multiplier of intensity beyond bloom intensity.

Version
1.21

◆ setBloomIntensity()

void Dragengine.Scenery.Camera.setBloomIntensity ( float  intensity)

Set bloom intensity multiplier.

Version
1.21

◆ setBloomSize()

void Dragengine.Scenery.Camera.setBloomSize ( float  size)

Bloom size as percentage of screen width.

Version
1.21

◆ setBloomStrength()

void Dragengine.Scenery.Camera.setBloomStrength ( float  strength)

Set bloom strength as multiplier of intensity beyond bloom intensity.

Version
1.21

◆ setEnableGI()

void Dragengine.Scenery.Camera.setEnableGI ( bool  enable)

Set to enable global illumination (GI) if supported.

Version
1.5

◆ setEnableHDRR()

void Dragengine.Scenery.Camera.setEnableHDRR ( bool  enable)

Set to enable high definition range rendering (HDRR) if supported.

Version
1.5

◆ setExposure()

void Dragengine.Scenery.Camera.setExposure ( float  exposure)

Set expsoure.

◆ setFov()

void Dragengine.Scenery.Camera.setFov ( float  fov)

Set field of view in degrees.

◆ setFovRatio()

void Dragengine.Scenery.Camera.setFovRatio ( float  fovRatio)

Set field of view aspect ratio.

◆ setHighestIntensity()

void Dragengine.Scenery.Camera.setHighestIntensity ( float  highestIntensity)

Set highest adaption intensity.

◆ setImageDistance()

void Dragengine.Scenery.Camera.setImageDistance ( float  distance)

Set distance to image plane in meters.

◆ setLayerMask()

void Dragengine.Scenery.Camera.setLayerMask ( LayerMask  layerMask)

Set layer mask for visibility masking.

◆ setLowestIntensity()

void Dragengine.Scenery.Camera.setLowestIntensity ( float  lowestIntensity)

Set lowest adaption intensity.

◆ setOrientation()

void Dragengine.Scenery.Camera.setOrientation ( Quaternion  orientation)

Set orientation.

◆ setPosition()

void Dragengine.Scenery.Camera.setPosition ( DVector  position)

Set position.

◆ setToneMapCurve()

void Dragengine.Scenery.Camera.setToneMapCurve ( CurveBezier  curve)

Set custom tone mapping curve or empty curve to disable.

Version
1.21
Note
If enabled make sure to match the curve range to the white intensity.

◆ setViewDistance()

void Dragengine.Scenery.Camera.setViewDistance ( float  distance)

Set view distance in meters.

◆ setWhiteIntensity()

void Dragengine.Scenery.Camera.setWhiteIntensity ( float  intensity)

Set white intensity multiplier.

Version
1.21

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