mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-26 14:58:51 -06:00
Merge branch 'master' into feature/loadingscreen-refactor
# Conflicts: # modules/base/rendering/renderabletrailorbit.h # modules/digitaluniverse/rendering/renderablebillboardscloud.cpp # modules/digitaluniverse/rendering/renderableplanescloud.cpp # modules/digitaluniverse/rendering/renderablepoints.cpp # modules/galaxy/rendering/renderablegalaxy.cpp # modules/galaxy/rendering/renderablegalaxy.h # modules/kameleonvolume/rendering/renderablekameleonvolume.cpp # modules/kameleonvolume/rendering/renderablekameleonvolume.h # modules/spacecraftinstruments/rendering/renderablefov.h # modules/spacecraftinstruments/rendering/renderableplaneprojection.h # modules/toyvolume/rendering/renderabletoyvolume.cpp # modules/toyvolume/rendering/renderabletoyvolume.h # modules/volume/rendering/renderabletimevaryingvolume.cpp # modules/volume/rendering/renderabletimevaryingvolume.h
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
#include <openspace/util/updatestructures.h>
|
||||
|
||||
namespace ghoul {
|
||||
|
||||
|
||||
namespace filesystem { class File; }
|
||||
|
||||
namespace opengl {
|
||||
@@ -57,7 +57,7 @@ namespace openspace {
|
||||
class RenderableVolume;
|
||||
class Camera;
|
||||
class Scene;
|
||||
|
||||
|
||||
class ABufferRenderer : public Renderer, public RaycasterListener {
|
||||
public:
|
||||
ABufferRenderer();
|
||||
@@ -71,7 +71,9 @@ public:
|
||||
void setResolution(glm::ivec2 res) override;
|
||||
void setNAaSamples(int nAaSamples) override;
|
||||
|
||||
using Renderer::preRaycast;
|
||||
void preRaycast(const RaycasterTask& raycasterTask);
|
||||
using Renderer::postRaycast;
|
||||
void postRaycast(const RaycasterTask& raycasterTask);
|
||||
|
||||
void update() override;
|
||||
@@ -85,12 +87,11 @@ public:
|
||||
virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) override;
|
||||
|
||||
private:
|
||||
|
||||
void clear();
|
||||
void updateResolution();
|
||||
void updateRaycastData();
|
||||
void updateResolveDictionary();
|
||||
|
||||
|
||||
Camera* _camera;
|
||||
Scene* _scene;
|
||||
glm::ivec2 _resolution;
|
||||
@@ -99,9 +100,9 @@ private:
|
||||
bool _dirtyRendererData;
|
||||
bool _dirtyRaycastData;
|
||||
bool _dirtyResolveDictionary;
|
||||
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _resolveProgram;
|
||||
|
||||
|
||||
/**
|
||||
* When a volume is attached or detached from the scene graph,
|
||||
* the resolve program needs to be recompiled.
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace openspace {
|
||||
|
||||
class Camera;
|
||||
class Scene;
|
||||
|
||||
|
||||
class FramebufferRenderer : public Renderer, public RaycasterListener {
|
||||
public:
|
||||
FramebufferRenderer();
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
|
||||
void updateResolution();
|
||||
void updateRaycastData();
|
||||
|
||||
|
||||
void setCamera(Camera* camera) override;
|
||||
void setScene(Scene* scene) override;
|
||||
void setResolution(glm::ivec2 res) override;
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
|
||||
void update() override;
|
||||
void render(float blackoutFactor, bool doPerformanceMeasurements) override;
|
||||
|
||||
|
||||
/**
|
||||
* Update render data
|
||||
* Responsible for calling renderEngine::setRenderData
|
||||
|
||||
@@ -85,10 +85,10 @@ public:
|
||||
bool matchesRenderBinMask(int binMask);
|
||||
|
||||
bool isVisible() const;
|
||||
|
||||
|
||||
bool hasTimeInterval();
|
||||
bool getInterval(double& start, double& end);
|
||||
|
||||
|
||||
void onEnabledChange(std::function<void(bool)> callback);
|
||||
|
||||
static void setPscUniforms(ghoul::opengl::ProgramObject& program, const Camera& camera, const PowerScaledCoordinate& position);
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
|
||||
protected:
|
||||
properties::BoolProperty _enabled;
|
||||
|
||||
|
||||
private:
|
||||
RenderBin _renderBin;
|
||||
float _boundingSphere;
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
RenderEngine();
|
||||
~RenderEngine();
|
||||
|
||||
|
||||
void initialize();
|
||||
void initializeGL();
|
||||
void deinitialize();
|
||||
@@ -85,8 +85,6 @@ public:
|
||||
RendererImplementation rendererImplementation() const;
|
||||
RaycasterManager& raycasterManager();
|
||||
|
||||
// sgct wrapped functions
|
||||
|
||||
|
||||
void updateShaderPrograms();
|
||||
void updateFade();
|
||||
@@ -154,13 +152,13 @@ public:
|
||||
* as a 'rendererData' variable in the dictionary.
|
||||
*/
|
||||
void setRendererData(const ghoul::Dictionary& rendererData);
|
||||
|
||||
|
||||
/**
|
||||
* Lets the renderer update the data to be brought into the post rendererer programs
|
||||
* as a 'resolveData' variable in the dictionary.
|
||||
*/
|
||||
void setResolveData(const ghoul::Dictionary& resolveData);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the Lua library that contains all Lua functions available to affect the
|
||||
* rendering.
|
||||
@@ -174,7 +172,7 @@ public:
|
||||
glm::ivec2 fontResolution() const;
|
||||
|
||||
std::vector<Syncable*> getSyncables();
|
||||
|
||||
|
||||
private:
|
||||
void setRenderer(std::unique_ptr<Renderer> renderer);
|
||||
RendererImplementation rendererFromString(const std::string& method) const;
|
||||
@@ -203,7 +201,7 @@ private:
|
||||
properties::BoolProperty _showLog;
|
||||
properties::BoolProperty _showVersionInfo;
|
||||
properties::BoolProperty _showCameraInfo;
|
||||
|
||||
|
||||
properties::TriggerProperty _takeScreenshot;
|
||||
bool _shouldTakeScreenshot;
|
||||
properties::BoolProperty _applyWarping;
|
||||
@@ -220,7 +218,7 @@ private:
|
||||
|
||||
std::vector<ghoul::opengl::ProgramObject*> _programs;
|
||||
std::vector<std::shared_ptr<ScreenSpaceRenderable>> _screenSpaceRenderables;
|
||||
|
||||
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontBig = nullptr;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontInfo = nullptr;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontDate = nullptr;
|
||||
|
||||
@@ -44,14 +44,14 @@ namespace openspace {
|
||||
class RenderableVolume;
|
||||
class Camera;
|
||||
class Scene;
|
||||
|
||||
|
||||
class Renderer {
|
||||
public:
|
||||
virtual ~Renderer() = default;
|
||||
|
||||
virtual void initialize() = 0;
|
||||
virtual void deinitialize() = 0;
|
||||
|
||||
|
||||
virtual void setCamera(Camera* camera) = 0;
|
||||
virtual void setScene(Scene* scene) = 0;
|
||||
virtual void setResolution(glm::ivec2 res) = 0;
|
||||
@@ -69,13 +69,13 @@ public:
|
||||
|
||||
|
||||
virtual void update() = 0;
|
||||
|
||||
virtual void render(float blackoutFactor, bool doPerformanceMeasurements) = 0;
|
||||
/**
|
||||
* Update render data
|
||||
* Responsible for calling renderEngine::setRenderData
|
||||
*/
|
||||
virtual void updateRendererData() = 0;
|
||||
|
||||
};
|
||||
|
||||
} // openspace
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
|
||||
#ifndef __OPENSPACE_CORE___SCREENSPACERENDERABLE___H__
|
||||
#define __OPENSPACE_CORE___SCREENSPACERENDERABLE___H__
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
virtual ~ScreenSpaceRenderable() = default;
|
||||
|
||||
virtual void render();
|
||||
|
||||
|
||||
virtual bool initialize();
|
||||
virtual bool initializeGL();
|
||||
virtual bool deinitialize();
|
||||
@@ -67,11 +67,11 @@ public:
|
||||
virtual void update() = 0;
|
||||
virtual bool isReady() const;
|
||||
bool isEnabled() const;
|
||||
|
||||
|
||||
glm::vec3 euclideanPosition() const;
|
||||
glm::vec3 sphericalPosition() const;
|
||||
float depth() const;
|
||||
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
* Render the volume's exit points (back face of the bounding geometry)
|
||||
*/
|
||||
//virtual void renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject* program) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Prepare the volume for the ABuffer's resolve step.
|
||||
* Make sure textures are up to date, bind them to texture units, set program uniforms etc.
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
* A #{namespace} variable (unique per helper file)
|
||||
*/
|
||||
//virtual std::string getBoundsFsPath() = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Return a path to a file with all the uniforms, functions etc
|
||||
* required to perform ray casting through this volume.
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
* Render the volume's exit points (back face of the bounding geometry)
|
||||
*/
|
||||
virtual void renderExitPoints(const RenderData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Prepare the volume for the ABuffer's resolve step.
|
||||
* Make sure textures are up to date, bind them to texture units, set program uniforms etc.
|
||||
@@ -73,6 +73,7 @@ public:
|
||||
* Also set localPosition to the camera position in the volume's local coordainte system.
|
||||
*/
|
||||
virtual bool cameraIsInside(const RenderData& /*data*/, glm::vec3& /*localPosition*/) { return false; };
|
||||
|
||||
/**
|
||||
* Return a path the file to use as vertex shader
|
||||
*
|
||||
@@ -92,7 +93,7 @@ public:
|
||||
* A #{namespace} variable (unique per helper file)
|
||||
*/
|
||||
virtual std::string getBoundsFsPath() const = 0 ;
|
||||
|
||||
|
||||
/**
|
||||
* Return a path to a file with all the uniforms, functions etc
|
||||
* required to perform ray casting through this volume.
|
||||
|
||||
Reference in New Issue
Block a user