mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:17:43 +02:00
Add back deferred debugging and combine context init
This commit is contained in:
parent
c6a2f5b20d
commit
d8022aa5b0
5 changed files with 24 additions and 20 deletions
|
@ -3721,21 +3721,18 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se
|
||||||
{
|
{
|
||||||
PerformanceTimer perfTimer("EngineRun");
|
PerformanceTimer perfTimer("EngineRun");
|
||||||
|
|
||||||
|
auto renderInterface = DependencyManager::get<RenderScriptingInterface>();
|
||||||
|
auto renderContext = renderInterface->getRenderContext();
|
||||||
|
|
||||||
renderArgs->_shouldRender = LODManager::shouldRender;
|
renderArgs->_shouldRender = LODManager::shouldRender;
|
||||||
renderArgs->_viewFrustum = getDisplayViewFrustum();
|
renderArgs->_viewFrustum = getDisplayViewFrustum();
|
||||||
|
renderContext.setArgs(renderArgs);
|
||||||
auto renderInterface = DependencyManager::get<RenderScriptingInterface>();
|
|
||||||
auto renderItemsConfig = renderInterface->getItemsConfig();
|
|
||||||
auto renderToneConfig = renderInterface->getToneConfig();
|
|
||||||
int drawStatus = renderInterface->getDrawStatus();
|
|
||||||
bool drawHitEffect = renderInterface->getDrawHitEffect();
|
|
||||||
|
|
||||||
bool occlusionStatus = Menu::getInstance()->isOptionChecked(MenuOption::DebugAmbientOcclusion);
|
bool occlusionStatus = Menu::getInstance()->isOptionChecked(MenuOption::DebugAmbientOcclusion);
|
||||||
bool antialiasingStatus = Menu::getInstance()->isOptionChecked(MenuOption::Antialiasing);
|
bool antialiasingStatus = Menu::getInstance()->isOptionChecked(MenuOption::Antialiasing);
|
||||||
bool showOwnedStatus = Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowOwned);
|
bool showOwnedStatus = Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowOwned);
|
||||||
|
renderContext.setOptions(occlusionStatus, antialiasingStatus, showOwnedStatus);
|
||||||
|
|
||||||
render::RenderContext renderContext{renderArgs, renderItemsConfig, renderToneConfig};
|
|
||||||
renderContext.setOptions(drawStatus, drawHitEffect, occlusionStatus, antialiasingStatus, showOwnedStatus);
|
|
||||||
_renderEngine->setRenderContext(renderContext);
|
_renderEngine->setRenderContext(renderContext);
|
||||||
|
|
||||||
// Before the deferred pass, let's try to use the render engine
|
// Before the deferred pass, let's try to use the render engine
|
||||||
|
|
|
@ -40,6 +40,11 @@ QString RenderScripting::Tone::getCurve() const {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
render::RenderContext RenderScriptingInterface::getRenderContext() {
|
||||||
|
render::RenderContext::ItemsConfig items{ *_opaque, *_transparent, *_overlay3D };
|
||||||
|
return render::RenderContext{ items, *_tone, _drawStatus, _drawHitEffect, _deferredDebugSize, _deferredDebugMode };
|
||||||
|
}
|
||||||
|
|
||||||
void RenderScriptingInterface::setItemCounts(const render::RenderContext::ItemsConfig& items) {
|
void RenderScriptingInterface::setItemCounts(const render::RenderContext::ItemsConfig& items) {
|
||||||
_opaque->setCounts(items.opaque);
|
_opaque->setCounts(items.opaque);
|
||||||
_transparent->setCounts(items.transparent);
|
_transparent->setCounts(items.transparent);
|
||||||
|
|
|
@ -78,15 +78,13 @@ class RenderScriptingInterface : public QObject, public Dependency {
|
||||||
|
|
||||||
Q_PROPERTY(RenderScripting::Tone* tone READ getTone)
|
Q_PROPERTY(RenderScripting::Tone* tone READ getTone)
|
||||||
|
|
||||||
Q_PROPERTY(int deferredDebugMode MEMBER _deferredDebugMode)
|
|
||||||
Q_PROPERTY(glm::vec4 deferredDebugSize MEMBER _deferredDebugSize)
|
|
||||||
Q_PROPERTY(int displayItemStatus MEMBER _drawStatus)
|
Q_PROPERTY(int displayItemStatus MEMBER _drawStatus)
|
||||||
Q_PROPERTY(bool displayHitEffect MEMBER _drawHitEffect)
|
Q_PROPERTY(bool displayHitEffect MEMBER _drawHitEffect)
|
||||||
|
|
||||||
inline int getDrawStatus() { return _drawStatus; }
|
Q_PROPERTY(int deferredDebugMode MEMBER _deferredDebugMode)
|
||||||
inline bool getDrawHitEffect() { return _drawHitEffect; }
|
Q_PROPERTY(glm::vec4 deferredDebugSize MEMBER _deferredDebugSize)
|
||||||
inline const render::RenderContext::ItemsConfig getItemsConfig() { return std::move(render::RenderContext::ItemsConfig{ *_opaque, *_transparent, *_overlay3D }); }
|
|
||||||
inline const render::RenderContext::Tone& getToneConfig() { return *_tone; }
|
render::RenderContext getRenderContext();
|
||||||
void setItemCounts(const render::RenderContext::ItemsConfig& items);
|
void setItemCounts(const render::RenderContext::ItemsConfig& items);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -13,11 +13,14 @@
|
||||||
#include "DrawTask.h"
|
#include "DrawTask.h"
|
||||||
using namespace render;
|
using namespace render;
|
||||||
|
|
||||||
void RenderContext::setOptions(int drawStatus, bool drawHitEffect, bool occlusion, bool fxaa, bool showOwned) {
|
RenderContext::RenderContext(ItemsConfig items, Tone tone, int drawStatus, bool drawHitEffect, glm::vec4 deferredDebugSize, int deferredDebugMode)
|
||||||
_drawStatus = drawStatus;
|
: _args{ nullptr }, _items{ items }, _tone{ tone },
|
||||||
|
_drawStatus{ drawStatus }, _drawHitEffect{ drawHitEffect },
|
||||||
|
_deferredDebugSize{ deferredDebugSize }, _deferredDebugMode{ deferredDebugMode } {};
|
||||||
|
|
||||||
|
void RenderContext::setOptions(bool occlusion, bool fxaa, bool showOwned) {
|
||||||
_occlusionStatus = occlusion;
|
_occlusionStatus = occlusion;
|
||||||
_fxaaStatus = fxaa;
|
_fxaaStatus = fxaa;
|
||||||
_drawHitEffect = drawHitEffect;
|
|
||||||
|
|
||||||
if (showOwned) {
|
if (showOwned) {
|
||||||
_drawStatus |= render::showNetworkStatusFlag;
|
_drawStatus |= render::showNetworkStatusFlag;
|
||||||
|
|
|
@ -77,9 +77,10 @@ public:
|
||||||
float exposure = 0.0;
|
float exposure = 0.0;
|
||||||
};
|
};
|
||||||
|
|
||||||
RenderContext(RenderArgs* args, ItemsConfig items, Tone tone) : _args{args}, _items{items}, _tone{tone} {};
|
RenderContext(ItemsConfig items, Tone tone, int drawStatus, bool drawHitEffect, glm::vec4 deferredDebugSize, int deferredDebugMode);
|
||||||
RenderContext() : RenderContext(nullptr, {}, {}) {};
|
RenderContext() : RenderContext({}, {}, {}, {}, {}, {}) {};
|
||||||
|
|
||||||
|
void setArgs(RenderArgs* args) { _args = args; }
|
||||||
inline RenderArgs* getArgs() { return _args; }
|
inline RenderArgs* getArgs() { return _args; }
|
||||||
inline ItemsConfig& getItemsConfig() { return _items; }
|
inline ItemsConfig& getItemsConfig() { return _items; }
|
||||||
inline Tone& getTone() { return _tone; }
|
inline Tone& getTone() { return _tone; }
|
||||||
|
@ -87,7 +88,7 @@ public:
|
||||||
inline bool getDrawHitEffect() { return _drawHitEffect; }
|
inline bool getDrawHitEffect() { return _drawHitEffect; }
|
||||||
inline bool getOcclusionStatus() { return _occlusionStatus; }
|
inline bool getOcclusionStatus() { return _occlusionStatus; }
|
||||||
inline bool getFxaaStatus() { return _fxaaStatus; }
|
inline bool getFxaaStatus() { return _fxaaStatus; }
|
||||||
void setOptions(int drawStatus, bool drawHitEffect, bool occlusion, bool fxaa, bool showOwned);
|
void setOptions(bool occlusion, bool fxaa, bool showOwned);
|
||||||
|
|
||||||
// Debugging
|
// Debugging
|
||||||
int _deferredDebugMode = -1;
|
int _deferredDebugMode = -1;
|
||||||
|
|
Loading…
Reference in a new issue