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