mirror of
https://github.com/overte-org/overte.git
synced 2025-04-07 12:53:44 +02:00
getting rid of the resolution Scale on the display plugin
This commit is contained in:
parent
69bb9ac0b6
commit
a856fdb3ca
4 changed files with 4 additions and 19 deletions
|
@ -3743,11 +3743,6 @@ void Application::resizeGL() {
|
|||
DependencyManager::get<FramebufferCache>()->setFrameBufferSize(fromGlm(renderSize));
|
||||
}
|
||||
|
||||
auto renderResolutionScale = getRenderResolutionScale();
|
||||
if (displayPlugin->getRenderResolutionScale() != renderResolutionScale) {
|
||||
displayPlugin->setRenderResolutionScale(renderResolutionScale);
|
||||
}
|
||||
|
||||
// FIXME the aspect ratio for stereo displays is incorrect based on this.
|
||||
float aspectRatio = displayPlugin->getRecommendedAspectRatio();
|
||||
_myCamera.setProjection(glm::perspective(glm::radians(_fieldOfView.get()), aspectRatio,
|
||||
|
@ -8541,7 +8536,7 @@ void Application::shareSnapshot(const QString& path, const QUrl& href) {
|
|||
}
|
||||
|
||||
float Application::getRenderResolutionScale() const {
|
||||
return 1.0f;
|
||||
return RenderScriptingInterface::getInstance()->getViewportResolutionScale();
|
||||
}
|
||||
|
||||
void Application::notifyPacketVersionMismatch() {
|
||||
|
|
|
@ -112,8 +112,8 @@ void setupPreferences() {
|
|||
RenderScriptingInterface::getInstance()->setViewportResolutionScale(value);
|
||||
};
|
||||
|
||||
auto scaleSlider = new SpinnerSliderPreference(GRAPHICS_QUALITY, "Viewport Resolution Scale", getter, setter);
|
||||
scaleSlider->setMin(0.5f);
|
||||
auto scaleSlider = new SliderPreference(GRAPHICS_QUALITY, "Viewport Resolution Scale", getter, setter);
|
||||
scaleSlider->setMin(0.25f);
|
||||
scaleSlider->setMax(1.0f);
|
||||
scaleSlider->setStep(0.02f);
|
||||
preferences->addPreference(scaleSlider);
|
||||
|
|
|
@ -377,7 +377,7 @@ void Stats::updateStats(bool force) {
|
|||
auto displayPlugin = qApp->getActiveDisplayPlugin();
|
||||
if (displayPlugin) {
|
||||
QVector2D dims(displayPlugin->getRecommendedRenderSize().x, displayPlugin->getRecommendedRenderSize().y);
|
||||
dims *= displayPlugin->getRenderResolutionScale();
|
||||
dims *= qApp->getRenderResolutionScale();
|
||||
STAT_UPDATE(gpuFrameSize, dims);
|
||||
STAT_UPDATE(gpuFrameTimePerPixel, (float)(gpuContext->getFrameTimerGPUAverage()*1000000.0 / double(dims.x()*dims.y())));
|
||||
}
|
||||
|
|
|
@ -147,14 +147,6 @@ public:
|
|||
virtual void submitFrame(const gpu::FramePointer& newFrame) = 0;
|
||||
virtual void captureFrame(const std::string& outputName) const { }
|
||||
|
||||
virtual float getRenderResolutionScale() const {
|
||||
return _renderResolutionScale;
|
||||
}
|
||||
|
||||
void setRenderResolutionScale(float renderResolutionScale) {
|
||||
_renderResolutionScale = renderResolutionScale;
|
||||
}
|
||||
|
||||
// The size of the rendering target (may be larger than the device size due to distortion)
|
||||
virtual glm::uvec2 getRecommendedRenderSize() const = 0;
|
||||
|
||||
|
@ -235,8 +227,6 @@ protected:
|
|||
|
||||
MovingAverage<float, 10> _movingAveragePresent;
|
||||
|
||||
float _renderResolutionScale { 1.0f };
|
||||
|
||||
private:
|
||||
QMutex _presentMutex;
|
||||
QWaitCondition _presentCondition;
|
||||
|
|
Loading…
Reference in a new issue