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

This class manages and renders non linear fisheye projections. More...

#include <sgct/projection/fisheye.h>

Inheritance diagram for sgct::FisheyeProjection:
Collaboration diagram for sgct::FisheyeProjection:

Public Types

enum class  FisheyeMethod { FourFaceCube = 0 , FiveFaceCube , SixFaceCube }
Public Types inherited from sgct::NonLinearProjection
enum class  InterpolationMode : uint8_t { Linear , Cubic }

Public Member Functions

 FisheyeProjection (const config::FisheyeProjection &config, const Window &parent, User &user)
 ~FisheyeProjection () final
void update (const vec2 &size) const override
 Update projection when aspect ratio changes for the viewport.
void render (const BaseViewport &viewport, FrustumMode frustumMode) const override
 Render the non-linear projection to currently bounded FBO.
void renderCubemap (FrustumMode frustumMode) const override
 Render the enabled faces of the cubemap.
void setDomeDiameter (float diameter)
 Set the dome diameter used in the fisheye renderer (used for the viewplane distance calculations).
void setTilt (float angle)
 Set the fisheye/dome tilt angle used in the fisheye renderer.
void setFOV (float angle)
 Set the fisheye/dome field-of-view angle used in the fisheye renderer.
void setCropFactors (float left, float right, float bottom, float top)
 Set the fisheye crop values.
void setOffset (vec3 offset) const
 Set fisheye offset to render offaxis.
void setBaseOffset (vec3 offset)
 Set fisheye base offset to render offaxis.
void setIgnoreAspectRatio (bool state)
 Ignore the framebuffer aspect ratio to allow non-circular fisheye.
void setKeepAspectRatio (bool state)
Public Member Functions inherited from sgct::NonLinearProjection
 NonLinearProjection (const Window &parent)
virtual ~NonLinearProjection ()
virtual void initialize (unsigned int internalFormat, int nSamples)
 Initialize the non-linear projection.
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

Additional Inherited Members

Protected Member Functions inherited from sgct::NonLinearProjection
virtual void initTextures (unsigned int internalFormat)
virtual void initFBO (unsigned int internalFormat, int nSamples)
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 inherited from sgct::NonLinearProjection
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

This class manages and renders non linear fisheye projections.

Member Enumeration Documentation

◆ FisheyeMethod

Enumerator
FourFaceCube 
FiveFaceCube 
SixFaceCube 

Constructor & Destructor Documentation

◆ FisheyeProjection()

sgct::FisheyeProjection::FisheyeProjection ( const config::FisheyeProjection & config,
const Window & parent,
User & user )

◆ ~FisheyeProjection()

sgct::FisheyeProjection::~FisheyeProjection ( )
final

Member Function Documentation

◆ render()

void sgct::FisheyeProjection::render ( const BaseViewport & viewport,
FrustumMode frustumMode ) const
overridevirtual

Render the non-linear projection to currently bounded FBO.

Implements sgct::NonLinearProjection.

◆ renderCubemap()

void sgct::FisheyeProjection::renderCubemap ( FrustumMode frustumMode) const
overridevirtual

Render the enabled faces of the cubemap.

Implements sgct::NonLinearProjection.

◆ setBaseOffset()

void sgct::FisheyeProjection::setBaseOffset ( vec3 offset)

Set fisheye base offset to render offaxis.

Length of vector must be smaller then 1. Base of fisheye is the XY-plane. The base offset will be added to the offset specified by setFisheyeOffset. These values are set from the configuration.

◆ setCropFactors()

void sgct::FisheyeProjection::setCropFactors ( float left,
float right,
float bottom,
float top )

Set the fisheye crop values.

Theese values are used when rendering content for a single projector dome. The elumenati geodome has usually a 4:3 SXGA+ (1400x1050) projector and the fisheye is cropped 25% (350 pixels) at the top.

◆ setDomeDiameter()

void sgct::FisheyeProjection::setDomeDiameter ( float diameter)

Set the dome diameter used in the fisheye renderer (used for the viewplane distance calculations).

Parameters
diameterDiameter of the dome diameter in meters

◆ setFOV()

void sgct::FisheyeProjection::setFOV ( float angle)

Set the fisheye/dome field-of-view angle used in the fisheye renderer.

Parameters
angleThe FOV angle in degrees

◆ setIgnoreAspectRatio()

void sgct::FisheyeProjection::setIgnoreAspectRatio ( bool state)

Ignore the framebuffer aspect ratio to allow non-circular fisheye.

This is useful for spherical mirror projections.

◆ setKeepAspectRatio()

void sgct::FisheyeProjection::setKeepAspectRatio ( bool state)

◆ setOffset()

void sgct::FisheyeProjection::setOffset ( vec3 offset) const

Set fisheye offset to render offaxis.

Length of vector must be smaller then 1. Base of fisheye is the XY-plane. This function is normally used in fisheye stereo rendering.

◆ setTilt()

void sgct::FisheyeProjection::setTilt ( float angle)

Set the fisheye/dome tilt angle used in the fisheye renderer.

The tilt angle is from the horizontal.

Parameters
angleThe tilt angle in degrees

◆ update()

void sgct::FisheyeProjection::update ( const vec2 & size) const
overridevirtual

Update projection when aspect ratio changes for the viewport.

Implements sgct::NonLinearProjection.


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