Add a proper blackout to the ScreenSpaceRenderables and a property and codegen option to toggle that behavior (#2868)

This commit is contained in:
Alexander Bock
2023-08-31 18:19:37 +02:00
committed by GitHub
parent 559dd63bb4
commit 455ee9335a
12 changed files with 55 additions and 33 deletions
@@ -61,7 +61,7 @@ public:
ScreenSpaceRenderable(const ghoul::Dictionary& dictionary);
virtual ~ScreenSpaceRenderable() override;
virtual void render();
virtual void render(float blackoutFactor);
virtual bool initialize();
virtual bool initializeGL();
@@ -102,7 +102,7 @@ protected:
glm::vec3 raeToCartesian(const glm::vec3& rae) const;
glm::vec3 cartesianToRae(const glm::vec3& cartesian) const;
void draw(glm::mat4 modelTransform);
void draw(glm::mat4 modelTransform, float blackoutFactor);
virtual void bindTexture() = 0;
virtual void unbindTexture();
@@ -114,6 +114,7 @@ protected:
glm::vec3 sanitizeSphericalCoordinates(glm::vec3 spherical) const;
properties::BoolProperty _enabled;
properties::BoolProperty _renderDuringBlackout;
properties::BoolProperty _usePerspectiveProjection;
properties::BoolProperty _useRadiusAzimuthElevation;
properties::BoolProperty _faceCamera;
@@ -140,7 +141,7 @@ protected:
properties::TriggerProperty _delete;
glm::ivec2 _objectSize = glm::ivec2(0);
UniformCache(color, opacity, mvp, texture, backgroundColor, gamma,
UniformCache(color, opacity, blackoutFactor, mvp, texture, backgroundColor, gamma,
borderColor, borderWidth) _uniformCache;
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
};