API Documentation
Public Member Functions | List of all members
nkAstraeus::EnvironmentRenderer Class Referencefinal

Utility class helping with environment rendering such as cube maps or spherical maps. More...

Public Member Functions

 EnvironmentRenderer (System *system) noexcept
 
 ~EnvironmentRenderer ()
 
void renderCubemap (nkGraphics::Texture *output, nkGraphics::Shader *shader, unsigned int targetDimensions, nkGraphics::FORMAT targetFormat)
 
void cubemapToSphericalMap (nkGraphics::Texture *output, nkGraphics::Texture *input, unsigned int targetWidth, unsigned int targetHeight)
 

Detailed Description

Utility class helping with environment rendering such as cube maps or spherical maps.

Constructor & Destructor Documentation

◆ EnvironmentRenderer()

nkAstraeus::EnvironmentRenderer::EnvironmentRenderer ( System system)
noexcept

Constructor.

Parameters
systemThe system the instance should live in.

◆ ~EnvironmentRenderer()

nkAstraeus::EnvironmentRenderer::~EnvironmentRenderer ( )

Destructor.

Member Function Documentation

◆ renderCubemap()

void nkAstraeus::EnvironmentRenderer::renderCubemap ( nkGraphics::Texture output,
nkGraphics::Shader shader,
unsigned int  targetDimensions,
nkGraphics::FORMAT  targetFormat 
)

Renders the given shader, into a cube map. The shader will be used 6 times as a post processing pass with properly setup cameras to render each face. The resulting texture can then be used as an enviromnent map with other materials or effects.

Parameters
outputThe texture to render to, which will be setup and loaded automatically by the method.
shaderThe shader to use to render each face.
targetDimensionsThe target dimensions (width and height) the output texture will be setup with.
targetFormatThe target format the output texture will be setup with.

◆ cubemapToSphericalMap()

void nkAstraeus::EnvironmentRenderer::cubemapToSphericalMap ( nkGraphics::Texture output,
nkGraphics::Texture input,
unsigned int  targetWidth,
unsigned int  targetHeight 
)

Converts a cube map, into a single texture, spherical map.

Parameters
outputThe texture to render to, which will be setup and loaded automatically by the method.
inputThe input cube map to render.
targetWidthThe target width for the output texture.
targetHeightThe target height for the output texture.
Remarks
The output texture will take the format and gamma correction setting of the input texture.

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