DIE Engine
Loading...
Searching...
No Matches
Renderer Class Reference

#include <renderer.h>

Classes

struct  Node
 Renderer-side node (compact variant, fed by Map::pass). More...
struct  Wall
 Renderer-side wall (compact variant, fed by Map::pass). More...
struct  Texture
 Renderer-side texture strip (column of square tiles). More...
struct  Light
 Renderer-side light (compact variant, fed by Map::pass). More...

Public Member Functions

 Renderer ()
void init ()
 Allocate the object pools, frames and tables, load the config.
void terminate ()
 Release all the renderer resources.
void render (Viewpoint &vp)
 Render the scene to the internal frame (see getImage).
QImage * getImage () const
 Frame rendered by the last render() call.
void setFlags (RENDERER_FLAGS flags)
 Replace the whole RENDERER_FLAGS bitmask.
void checkFlag (RENDERER_FLAGS flag, bool checked)
 Set or clear a single renderer flag.
RENDERER_FLAGS getFlags () const
void setGlowmapSize (int size)
 Request a glowmap resize (applied at the start of the next render).
int getGlowmapSize () const
void setGlowmapArea (float area)
 Set the world area covered by the glowmap, in world units.
float getGlowmapArea () const
void setFramesReso (int width, int height)
 Request a frame resize (applied at the start of the next render).
int getFrameResoX () const
int getFrameResoY () const
void setFOVAngle (float angle)
 Set the horizontal field of view, in degrees.
void setFOVDistanceNear (float distance)
void setFOVDistanceFar (float distance)
void clickRegister (int x, int y)
 Register a frame position to pick a wall during the next render.
uint16_t clickGetWallID () const
 Wall picked by the last registered click (see clickRegister).

Public Attributes

uint32_t flags
 active RENDERER_FLAGS bitmask
float fovAngle
 horizontal FOV, in degrees
float fovDistanceNear
 near clip distance, in world units
float fovDistanceFar
 far clip distance, in world units
uint32_t sunAmbient
 packed RGB ambient color
uint32_t sunRayColor
 packed RGB direct ray color
QVector3D sunRayDirection
 normalised ray direction
float sunAmbientStrength
 ambient intensity (0.0 .. 1.0)
float sunRayStrength
 ray intensity (0.0 .. 1.0)
float fogDistanceNear
 fog start distance, in world units
float fogDistanceFar
 fog full-density distance, in world units
uint32_t fogFarColor
 packed RGB fog color
uint16_t fogFlags
 combination of FOG_FLAGS
float occlusionLength
 corner darkening reach, in world units
float occlusionDarken
 darkening strength (0.0 .. 1.0)
float motionBlurFactor
 previous frame blend, in percent (0 .. 100)
float vignetteInnerRadius
 darkening start, in percent of half the frame height
float vignetteOuterRadius
 full black, in percent of half the frame height
float gammaKRed
 red smoothstep tone gain (1.0 = full curve)
float gammaKGreen
 green smoothstep tone gain
float gammaKBlue
 blue smoothstep tone gain
Nodenodes
int nodesCount
int nodesAllocated
Wallwalls
int wallsCount
int wallsAllocated
Texturetextures
int texturesCount
int texturesAllocated
Lightlights
int lightsCount
int lightsAllocated
float lastFloor
float lastCeiling

Static Public Attributes

static constexpr int DefaultFrameResoX = 960
static constexpr int DefaultFrameResoY = 536
static constexpr int DefaultGlowmapReso = 256
static constexpr float DefaultGlowmapArea = 1024.0f
static constexpr int DefaultNodesMax = 2048
static constexpr int DefaultWallsMax = 1024
static constexpr int DefaultTexturesMax = 32
static constexpr int DefaultLightsMax = 64
static constexpr float GlowSampleDistance = 1.0f
static constexpr float GlowBleedFactor = 0.25f
static constexpr float LightFallOff = 32.0f
static constexpr float HeightMax = 16384.0f
static constexpr float HeightMin = -16384.0f
static constexpr uint16_t ClickNoWall = 0xFFFF
 Sentinel returned by clickGetWallID when no wall was picked.

Constructor & Destructor Documentation

◆ Renderer()

Renderer::Renderer ( )

Member Function Documentation

◆ checkFlag()

void Renderer::checkFlag ( RENDERER_FLAGS flag,
bool checked )

Set or clear a single renderer flag.

◆ clickGetWallID()

uint16_t Renderer::clickGetWallID ( ) const
inline

Wall picked by the last registered click (see clickRegister).

◆ clickRegister()

void Renderer::clickRegister ( int x,
int y )

Register a frame position to pick a wall during the next render.

◆ getFlags()

RENDERER_FLAGS Renderer::getFlags ( ) const
inline

◆ getFrameResoX()

int Renderer::getFrameResoX ( ) const
inline

◆ getFrameResoY()

int Renderer::getFrameResoY ( ) const
inline

◆ getGlowmapArea()

float Renderer::getGlowmapArea ( ) const
inline

◆ getGlowmapSize()

int Renderer::getGlowmapSize ( ) const
inline

◆ getImage()

QImage * Renderer::getImage ( ) const
inline

Frame rendered by the last render() call.

◆ init()

void Renderer::init ( )

Allocate the object pools, frames and tables, load the config.

◆ render()

void Renderer::render ( Viewpoint & vp)

Render the scene to the internal frame (see getImage).

◆ setFlags()

void Renderer::setFlags ( RENDERER_FLAGS flags)

Replace the whole RENDERER_FLAGS bitmask.

◆ setFOVAngle()

void Renderer::setFOVAngle ( float angle)

Set the horizontal field of view, in degrees.

◆ setFOVDistanceFar()

void Renderer::setFOVDistanceFar ( float distance)

◆ setFOVDistanceNear()

void Renderer::setFOVDistanceNear ( float distance)

◆ setFramesReso()

void Renderer::setFramesReso ( int width,
int height )

Request a frame resize (applied at the start of the next render).

◆ setGlowmapArea()

void Renderer::setGlowmapArea ( float area)

Set the world area covered by the glowmap, in world units.

◆ setGlowmapSize()

void Renderer::setGlowmapSize ( int size)

Request a glowmap resize (applied at the start of the next render).

◆ terminate()

void Renderer::terminate ( )

Release all the renderer resources.

Member Data Documentation

◆ ClickNoWall

uint16_t Renderer::ClickNoWall = 0xFFFF
staticconstexpr

Sentinel returned by clickGetWallID when no wall was picked.

◆ DefaultFrameResoX

int Renderer::DefaultFrameResoX = 960
staticconstexpr

◆ DefaultFrameResoY

int Renderer::DefaultFrameResoY = 536
staticconstexpr

◆ DefaultGlowmapArea

float Renderer::DefaultGlowmapArea = 1024.0f
staticconstexpr

◆ DefaultGlowmapReso

int Renderer::DefaultGlowmapReso = 256
staticconstexpr

◆ DefaultLightsMax

int Renderer::DefaultLightsMax = 64
staticconstexpr

◆ DefaultNodesMax

int Renderer::DefaultNodesMax = 2048
staticconstexpr

◆ DefaultTexturesMax

int Renderer::DefaultTexturesMax = 32
staticconstexpr

◆ DefaultWallsMax

int Renderer::DefaultWallsMax = 1024
staticconstexpr

◆ flags

uint32_t Renderer::flags

active RENDERER_FLAGS bitmask

◆ fogDistanceFar

float Renderer::fogDistanceFar

fog full-density distance, in world units

◆ fogDistanceNear

float Renderer::fogDistanceNear

fog start distance, in world units

◆ fogFarColor

uint32_t Renderer::fogFarColor

packed RGB fog color

◆ fogFlags

uint16_t Renderer::fogFlags

combination of FOG_FLAGS

◆ fovAngle

float Renderer::fovAngle

horizontal FOV, in degrees

◆ fovDistanceFar

float Renderer::fovDistanceFar

far clip distance, in world units

◆ fovDistanceNear

float Renderer::fovDistanceNear

near clip distance, in world units

◆ gammaKBlue

float Renderer::gammaKBlue

blue smoothstep tone gain

◆ gammaKGreen

float Renderer::gammaKGreen

green smoothstep tone gain

◆ gammaKRed

float Renderer::gammaKRed

red smoothstep tone gain (1.0 = full curve)

◆ GlowBleedFactor

float Renderer::GlowBleedFactor = 0.25f
staticconstexpr

◆ GlowSampleDistance

float Renderer::GlowSampleDistance = 1.0f
staticconstexpr

◆ HeightMax

float Renderer::HeightMax = 16384.0f
staticconstexpr

◆ HeightMin

float Renderer::HeightMin = -16384.0f
staticconstexpr

◆ lastCeiling

float Renderer::lastCeiling

◆ lastFloor

float Renderer::lastFloor

◆ LightFallOff

float Renderer::LightFallOff = 32.0f
staticconstexpr

◆ lights

Light* Renderer::lights

◆ lightsAllocated

int Renderer::lightsAllocated

◆ lightsCount

int Renderer::lightsCount

◆ motionBlurFactor

float Renderer::motionBlurFactor

previous frame blend, in percent (0 .. 100)

◆ nodes

Node* Renderer::nodes

◆ nodesAllocated

int Renderer::nodesAllocated

◆ nodesCount

int Renderer::nodesCount

◆ occlusionDarken

float Renderer::occlusionDarken

darkening strength (0.0 .. 1.0)

◆ occlusionLength

float Renderer::occlusionLength

corner darkening reach, in world units

◆ sunAmbient

uint32_t Renderer::sunAmbient

packed RGB ambient color

◆ sunAmbientStrength

float Renderer::sunAmbientStrength

ambient intensity (0.0 .. 1.0)

◆ sunRayColor

uint32_t Renderer::sunRayColor

packed RGB direct ray color

◆ sunRayDirection

QVector3D Renderer::sunRayDirection

normalised ray direction

◆ sunRayStrength

float Renderer::sunRayStrength

ray intensity (0.0 .. 1.0)

◆ textures

Texture* Renderer::textures

◆ texturesAllocated

int Renderer::texturesAllocated

◆ texturesCount

int Renderer::texturesCount

◆ vignetteInnerRadius

float Renderer::vignetteInnerRadius

darkening start, in percent of half the frame height

◆ vignetteOuterRadius

float Renderer::vignetteOuterRadius

full black, in percent of half the frame height

◆ walls

Wall* Renderer::walls

◆ wallsAllocated

int Renderer::wallsAllocated

◆ wallsCount

int Renderer::wallsCount

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