Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.Camera Class Reference

Camera. More...

Inheritance diagram for Dragengine.Scenery.Camera:

Public Member Functions

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

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.

Referenced by removeAllIgnoreComponents().

◆ addIgnoreComponent()

void Dragengine.Scenery.Camera.addIgnoreComponent ( Component component)

Add component to ignore during rendering.

Version
1.32

Does nothing if component is present.

References getMatrix().

Referenced by removeAllIgnoreComponents().

◆ 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.

References getBloomBlend().

Referenced by getIgnoreComponentAt(), and hasIgnoreComponent().

◆ getAdaptionTime()

float Dragengine.Scenery.Camera.getAdaptionTime ( )

Adaption time in seconds.

References setEnableHDRR().

Referenced by getWhiteIntensity().

◆ getBloomBlend()

float Dragengine.Scenery.Camera.getBloomBlend ( )

Bloom blend as multiplier of intensity beyond bloom intensity.

Version
1.21

References getWhiteIntensity().

Referenced by backProject().

◆ getBloomIntensity()

float Dragengine.Scenery.Camera.getBloomIntensity ( )

Bloom intensity multiplier.

Version
1.21

References resetAdaptedIntensity().

Referenced by getBloomSize().

◆ getBloomSize()

float Dragengine.Scenery.Camera.getBloomSize ( )

Bloom size as percentage of screen width.

Version
1.21

References getBloomIntensity().

Referenced by getMatrix().

◆ getBloomStrength()

float Dragengine.Scenery.Camera.getBloomStrength ( )

Bloom strength as multiplier of intensity beyond bloom intensity.

Version
1.21

References setEnableGI().

Referenced by setToneMapCurve().

◆ getEffectAt()

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

Effect at index.

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

References getToneMapCurve().

Referenced by removeAllIgnoreComponents().

◆ getEffectCount()

int Dragengine.Scenery.Camera.getEffectCount ( )

Number of effects.

Referenced by removeAllIgnoreComponents().

◆ getEnableGI()

bool Dragengine.Scenery.Camera.getEnableGI ( )

Enable global illumination (GI) if supported.

Version
1.5

References getHighestIntensity(), and setLowestIntensity().

Referenced by setBloomIntensity().

◆ getEnableHDRR()

bool Dragengine.Scenery.Camera.getEnableHDRR ( )

Enable high definition range rendering (HDRR) if supported.

Version
1.5

References getViewDistance(), and setImageDistance().

Referenced by setLowestIntensity().

◆ getExposure()

float Dragengine.Scenery.Camera.getExposure ( )

Exposure.

References setViewDistance().

Referenced by setAdaptionTime().

◆ getFov()

float Dragengine.Scenery.Camera.getFov ( )

Field of view in degrees.

Referenced by getFovRatio().

◆ getFovRatio()

float Dragengine.Scenery.Camera.getFovRatio ( )

Field of view aspect ratio.

References getFov().

Referenced by setImageDistance().

◆ getHighestIntensity()

float Dragengine.Scenery.Camera.getHighestIntensity ( )

Highest adaption intensity.

Referenced by getEnableGI().

◆ getIgnoreComponentAt()

Component Dragengine.Scenery.Camera.getIgnoreComponentAt ( int index)

Component to ignore during rendering at index.

Version
1.32
Exceptions
EOutOfBoundaryindex is less than 0 or larger than or equal to getIgnoreComponentCount().

References backProject().

Referenced by removeAllIgnoreComponents().

◆ getIgnoreComponentCount()

int Dragengine.Scenery.Camera.getIgnoreComponentCount ( )

Number of components to ignore during rendering.

Version
1.32

References project(), and setLayerMask().

Referenced by removeAllIgnoreComponents().

◆ getImageDistance()

float Dragengine.Scenery.Camera.getImageDistance ( )

Distance to image plane in meters.

References setFov().

Referenced by setViewDistance().

◆ getInverseMatrix()

DMatrix Dragengine.Scenery.Camera.getInverseMatrix ( )

Inverse world matrix of camera.

Version
1.26

References setBloomSize().

Referenced by removeAllIgnoreComponents().

◆ getLayerMask()

LayerMask Dragengine.Scenery.Camera.getLayerMask ( )

Layer mask for visibility masking.

Referenced by removeAllEffects().

◆ getLowestIntensity()

float Dragengine.Scenery.Camera.getLowestIntensity ( )

Lowest adaption intensity.

Referenced by resetAdaptedIntensity().

◆ getMatrix()

DMatrix Dragengine.Scenery.Camera.getMatrix ( )

World matrix of camera.

Version
1.7

References getBloomSize().

Referenced by addIgnoreComponent().

◆ getOrientation()

Quaternion Dragengine.Scenery.Camera.getOrientation ( )

Orientation.

References setPosition().

Referenced by setOrientation().

◆ getParentWorld()

World Dragengine.Scenery.Camera.getParentWorld ( )

Parent world or null if not added to a world.

References setBloomBlend().

Referenced by hasIgnoreComponent().

◆ getPosition()

DVector Dragengine.Scenery.Camera.getPosition ( )

Position.

References getPosition().

Referenced by getPosition().

◆ getToneMapCurve()

CurveBezier Dragengine.Scenery.Camera.getToneMapCurve ( )

Custom tone mapping curve or empty curve to disable.

Version
1.21

References setBloomIntensity().

Referenced by getEffectAt().

◆ getViewDistance()

float Dragengine.Scenery.Camera.getViewDistance ( )

View distance in meters.

Referenced by getEnableHDRR().

◆ getWhiteIntensity()

float Dragengine.Scenery.Camera.getWhiteIntensity ( )

White intensity multiplier.

Version
1.21

References getAdaptionTime(), and setAdaptionTime().

Referenced by getBloomBlend().

◆ hasIgnoreComponent()

bool Dragengine.Scenery.Camera.hasIgnoreComponent ( Component component)

Component to ignore during rendering is present.

Version
1.32

References backProject(), and getParentWorld().

Referenced by removeAllIgnoreComponents().

◆ new()

Camera Dragengine.Scenery.Camera.new ( )

Create camera.

References new().

Referenced by new().

◆ project()

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

Project point from 3d world.

Referenced by getIgnoreComponentCount().

◆ removeAllEffects()

void Dragengine.Scenery.Camera.removeAllEffects ( )

Remove all effects.

References getLayerMask(), and setToneMapCurve().

Referenced by removeAllIgnoreComponents().

◆ removeAllIgnoreComponents()

void Dragengine.Scenery.Camera.removeAllIgnoreComponents ( )

◆ removeEffect()

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

Remove effect.

Referenced by removeAllIgnoreComponents().

◆ removeIgnoreComponent()

void Dragengine.Scenery.Camera.removeIgnoreComponent ( Component component)

Remove component to ignore during rendering.

Version
1.32

Does nothing if component is absent.

Referenced by removeAllIgnoreComponents().

◆ resetAdaptedIntensity()

void Dragengine.Scenery.Camera.resetAdaptedIntensity ( )

Request graphic module to reset adapted intensity to optimal value.

Version
1.4

References getLowestIntensity(), and setExposure().

Referenced by getBloomIntensity().

◆ setAdaptionTime()

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

Set adaption time in seconds.

References getExposure().

Referenced by getWhiteIntensity().

◆ setBloomBlend()

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

Set bloom blend as multiplier of intensity beyond bloom intensity.

Version
1.21

References setWhiteIntensity().

Referenced by getParentWorld().

◆ setBloomIntensity()

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

Set bloom intensity multiplier.

Version
1.21

References getEnableGI().

Referenced by getToneMapCurve().

◆ setBloomSize()

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

Bloom size as percentage of screen width.

Version
1.21

Referenced by getInverseMatrix().

◆ setBloomStrength()

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

Set bloom strength as multiplier of intensity beyond bloom intensity.

Version
1.21

Referenced by setLayerMask().

◆ setEnableGI()

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

Set to enable global illumination (GI) if supported.

Version
1.5

References setHighestIntensity().

Referenced by getBloomStrength().

◆ setEnableHDRR()

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

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

Version
1.5

Referenced by getAdaptionTime().

◆ setExposure()

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

Set expsoure.

Referenced by resetAdaptedIntensity().

◆ setFov()

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

Set field of view in degrees.

References setOrientation().

Referenced by getImageDistance().

◆ setFovRatio()

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

Set field of view aspect ratio.

Referenced by setViewDistance().

◆ setHighestIntensity()

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

Set highest adaption intensity.

Referenced by setEnableGI().

◆ setImageDistance()

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

Set distance to image plane in meters.

References getFovRatio().

Referenced by getEnableHDRR().

◆ setLayerMask()

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

Set layer mask for visibility masking.

References setBloomStrength().

Referenced by getIgnoreComponentCount().

◆ setLowestIntensity()

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

Set lowest adaption intensity.

References getEnableHDRR().

Referenced by getEnableGI().

◆ setOrientation()

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

Set orientation.

References getOrientation().

Referenced by setFov().

◆ setPosition()

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

Set position.

Referenced by getOrientation().

◆ 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.

References getBloomStrength().

Referenced by removeAllEffects().

◆ setViewDistance()

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

Set view distance in meters.

References getImageDistance(), and setFovRatio().

Referenced by getExposure().

◆ setWhiteIntensity()

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

Set white intensity multiplier.

Version
1.21

Referenced by setBloomBlend().


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