SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
sgct::NonLinearProjection Class Referenceabstract

Base class for non-linear projections. More...

#include <sgct/projection/nonlinearprojection.h>

Inheritance diagram for sgct::NonLinearProjection:
Collaboration diagram for sgct::NonLinearProjection:

Public Types

enum class  InterpolationMode : uint8_t { Linear , Cubic }

Public Member Functions

 NonLinearProjection (const Window &parent)
virtual ~NonLinearProjection ()
virtual void initialize (unsigned int internalFormat, int nSamples)
 Initialize the non-linear projection.
virtual void render (const BaseViewport &viewport, FrustumMode frustumMode) const =0
virtual void renderCubemap (FrustumMode frustumMode) const =0
virtual void update (const vec2 &size) const =0
virtual void updateFrustums (FrustumMode mode, float nearClip, float farClip)
void setCubemapResolution (int resolution)
 Set the resolution of the cubemap faces.
void setInterpolationMode (InterpolationMode im)
 Set the interpolation mode.
void setUseDepthTransformation (bool state)
 Set if depth should be re-calculated to match the non-linear projection.
void setStereo (bool state)
 Set if stereoscopic rendering will be enabled.
virtual void setUser (User &user)
ivec2 cubemapResolution () const

Protected Member Functions

virtual void initTextures (unsigned int internalFormat)
virtual void initFBO (unsigned int internalFormat, int nSamples)
virtual void initVBO ()=0
virtual void initViewports ()=0
virtual void initShaders ()=0
void setupViewport (const BaseViewport &vp) const
void generateMap (unsigned int &texture, unsigned int internalFormat)
void generateCubeMap (unsigned int &texture, unsigned int internalFormat)
void attachTextures (int face) const
void blitCubeFace (int face) const
void renderCubeFace (const BaseViewport &vp, int idx, FrustumMode mode) const

Protected Attributes

struct sgct::NonLinearProjection:: { ... }  _textures
struct sgct::NonLinearProjection:: { ... }  _subViewports
InterpolationMode _interpolationMode = InterpolationMode::Linear
FrustumMode _preferedMonoFrustumMode = FrustumMode::Mono
bool _useDepthTransformation = false
bool _isStereo = false
ivec2 _cubemapResolution = ivec2(512, 512)
vec4 _clearColor = vec4(0.3f, 0.3f, 0.3f, 1.f)
std::unique_ptr< OffScreenBuffer > _cubeMapFbo

Detailed Description

Base class for non-linear projections.

Member Enumeration Documentation

◆ InterpolationMode

enum class sgct::NonLinearProjection::InterpolationMode : uint8_t
strong
Enumerator
Linear 
Cubic 

Constructor & Destructor Documentation

◆ NonLinearProjection()

sgct::NonLinearProjection::NonLinearProjection ( const Window & parent)
explicit

◆ ~NonLinearProjection()

virtual sgct::NonLinearProjection::~NonLinearProjection ( )
virtual

Member Function Documentation

◆ attachTextures()

void sgct::NonLinearProjection::attachTextures ( int face) const
protected

◆ blitCubeFace()

void sgct::NonLinearProjection::blitCubeFace ( int face) const
protected

◆ cubemapResolution()

ivec2 sgct::NonLinearProjection::cubemapResolution ( ) const
Returns
The resolution of the cubemap

◆ generateCubeMap()

void sgct::NonLinearProjection::generateCubeMap ( unsigned int & texture,
unsigned int internalFormat )
protected

◆ generateMap()

void sgct::NonLinearProjection::generateMap ( unsigned int & texture,
unsigned int internalFormat )
protected

◆ initFBO()

virtual void sgct::NonLinearProjection::initFBO ( unsigned int internalFormat,
int nSamples )
protectedvirtual

◆ initialize()

virtual void sgct::NonLinearProjection::initialize ( unsigned int internalFormat,
int nSamples )
virtual

Initialize the non-linear projection.

The arguments should match the texture settings for the parent window's FBO target.

◆ initShaders()

virtual void sgct::NonLinearProjection::initShaders ( )
protectedpure virtual

◆ initTextures()

virtual void sgct::NonLinearProjection::initTextures ( unsigned int internalFormat)
protectedvirtual

◆ initVBO()

virtual void sgct::NonLinearProjection::initVBO ( )
protectedpure virtual

◆ initViewports()

virtual void sgct::NonLinearProjection::initViewports ( )
protectedpure virtual

◆ render()

virtual void sgct::NonLinearProjection::render ( const BaseViewport & viewport,
FrustumMode frustumMode ) const
pure virtual

◆ renderCubeFace()

void sgct::NonLinearProjection::renderCubeFace ( const BaseViewport & vp,
int idx,
FrustumMode mode ) const
protected

◆ renderCubemap()

virtual void sgct::NonLinearProjection::renderCubemap ( FrustumMode frustumMode) const
pure virtual

◆ setCubemapResolution()

void sgct::NonLinearProjection::setCubemapResolution ( int resolution)

Set the resolution of the cubemap faces.

Parameters
resolutionThe pixel resolution of each quad

◆ setInterpolationMode()

void sgct::NonLinearProjection::setInterpolationMode ( InterpolationMode im)

Set the interpolation mode.

Parameters
imThe selected mode

◆ setStereo()

void sgct::NonLinearProjection::setStereo ( bool state)

Set if stereoscopic rendering will be enabled.

◆ setupViewport()

void sgct::NonLinearProjection::setupViewport ( const BaseViewport & vp) const
protected

◆ setUseDepthTransformation()

void sgct::NonLinearProjection::setUseDepthTransformation ( bool state)

Set if depth should be re-calculated to match the non-linear projection.

◆ setUser()

virtual void sgct::NonLinearProjection::setUser ( User & user)
virtual

◆ update()

virtual void sgct::NonLinearProjection::update ( const vec2 & size) const
pure virtual

◆ updateFrustums()

virtual void sgct::NonLinearProjection::updateFrustums ( FrustumMode mode,
float nearClip,
float farClip )
virtual

Member Data Documentation

◆ _clearColor

vec4 sgct::NonLinearProjection::_clearColor = vec4(0.3f, 0.3f, 0.3f, 1.f)
protected

◆ _cubeMapFbo

std::unique_ptr<OffScreenBuffer> sgct::NonLinearProjection::_cubeMapFbo
protected

◆ _cubemapResolution

ivec2 sgct::NonLinearProjection::_cubemapResolution = ivec2(512, 512)
protected

◆ _interpolationMode

InterpolationMode sgct::NonLinearProjection::_interpolationMode = InterpolationMode::Linear
protected

◆ _isStereo

bool sgct::NonLinearProjection::_isStereo = false
protected

◆ _preferedMonoFrustumMode

FrustumMode sgct::NonLinearProjection::_preferedMonoFrustumMode = FrustumMode::Mono
protected

◆ _subViewports

struct { ... } sgct::NonLinearProjection::_subViewports

◆ _textures

struct { ... } sgct::NonLinearProjection::_textures

◆ _useDepthTransformation

bool sgct::NonLinearProjection::_useDepthTransformation = false
protected

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