SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
sphericalmirror.h
Go to the documentation of this file.
1/*****************************************************************************************
2 * SGCT *
3 * Simple Graphics Cluster Toolkit *
4 * *
5 * Copyright (c) 2012-2026 *
6 * For conditions of distribution and use, see copyright notice in LICENSE.md *
7 ****************************************************************************************/
8
9#ifndef __SGCT__SPHERICALMIRROR__H__
10#define __SGCT__SPHERICALMIRROR__H__
11
12#include <sgct/sgctexports.h>
14
15#include <sgct/correctionmesh.h>
16#include <sgct/shaderprogram.h>
17
18namespace sgct {
19
20namespace config { struct SphericalMirrorProjection; }
21class BaseViewport;
22class User;
23class Window;
24
28class SGCT_EXPORT SphericalMirrorProjection final : public NonLinearProjection {
29public:
31 const Window& parent, User& user);
33
34 void update(const vec2& size) const override;
35
39 void render(const BaseViewport& viewport, FrustumMode frustumMode) const override;
40
44 void renderCubemap(FrustumMode frustumMode) const override;
45
52 void setTilt(float angle);
53
54private:
55 void initTextures(unsigned int internalFormat) override;
56 void initVBO() override;
57 void initViewports() override;
58 void initShaders() override;
59
60 float _tilt;
61 float _diameter = 2.4f;
62
63 // mesh data
64 CorrectionMesh _meshBottom;
65 CorrectionMesh _meshLeft;
66 CorrectionMesh _meshRight;
67 CorrectionMesh _meshTop;
68 std::string _meshPathBottom;
69 std::string _meshPathLeft;
70 std::string _meshPathRight;
71 std::string _meshPathTop;
72
73 // shader locations
74 int _texLoc = -1;
75 int _matrixLoc = -1;
76 ShaderProgram _shader;
77 ShaderProgram _depthCorrectionShader;
78};
79
80} // namespace sgct
81
82#endif // __SGCT__SPHERICALMIRROR__H__
This class holds and manages viewportdata and calculates frustums.
Definition baseviewport.h:27
Helper class for reading and rendering a correction mesh.
Definition correctionmesh.h:26
NonLinearProjection(const Window &parent)
Class for handling compiling, linking and using shader programs.
Definition shaderprogram.h:24
void update(const vec2 &size) const override
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.
SphericalMirrorProjection(const config::SphericalMirrorProjection &config, const Window &parent, User &user)
void setTilt(float angle)
Set the dome tilt angle used in the spherical mirror renderer.
Helper class for setting user variables.
Definition user.h:24
Definition window.h:46
Definition clustermanager.h:22
Definition actions.h:16
FrustumMode
Definition definitions.h:23
Definition math.h:47