Showing the changes to interface/src/scripting/RenderScriptingInterface.cpp (1 of 9 files). Show all
Unified · Split
| @@ -37,7 +37,7 @@ void RenderScriptingInterface::loadSettings() { · 36 unmodified lines | ||
| 37 | 37 | forceAntialiasingEnabled(_antialiasingEnabled); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | −RenderScriptingInterface::RenderMethod RenderScriptingInterface::getRenderMethod() { | |
| 40 | +RenderScriptingInterface::RenderMethod RenderScriptingInterface::getRenderMethod() const { | |
| 41 | 41 | return (RenderMethod) _renderMethod; |
| 42 | 42 | } |
| 43 | 43 | |
| @@ -64,7 +64,7 @@ QStringList RenderScriptingInterface::getRenderMethodNames() const { · 20 unmodified lines | ||
| 64 | 64 | return refrenderMethodNames; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | −bool RenderScriptingInterface::getShadowsEnabled() { | |
| 67 | +bool RenderScriptingInterface::getShadowsEnabled() const { | |
| 68 | 68 | return _shadowsEnabled; |
| 69 | 69 | } |
| 70 | 70 | |
| @@ -88,7 +88,7 @@ void RenderScriptingInterface::forceShadowsEnabled(bool enabled) { · 17 unmodified lines | ||
| 88 | 88 | }); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | −bool RenderScriptingInterface::getAmbientOcclusionEnabled() { | |
| 91 | +bool RenderScriptingInterface::getAmbientOcclusionEnabled() const { | |
| 92 | 92 | return _ambientOcclusionEnabled; |
| 93 | 93 | } |
| 94 | 94 | |
| @@ -112,7 +112,7 @@ void RenderScriptingInterface::forceAmbientOcclusionEnabled(bool enabled) { · 17 unmodified lines | ||
| 112 | 112 | }); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | −bool RenderScriptingInterface::getAntialiasingEnabled() { | |
| 115 | +bool RenderScriptingInterface::getAntialiasingEnabled() const { | |
| 116 | 116 | return _antialiasingEnabled; |
| 117 | 117 | } |
| 118 | 118 | |
| @@ -145,3 +145,47 @@ void RenderScriptingInterface::forceAntialiasingEnabled(bool enabled) { · 26 unmodified lines | ||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| 148 | +float RenderScriptingInterface::getViewportResolutionScale() const { | |
| 149 | + return _viewportResolutionScale; | |
| 150 | +} | |
| 151 | + | |
| 152 | +void RenderScriptingInterface::setViewportResolutionScale(float scale) { | |
| 153 | + if (_viewportResolutionScale != scale) { | |
| 154 | + forceViewportResolutionScale(scale); | |
| 155 | + emit settingsChanged(); | |
| 156 | + } | |
| 157 | +} | |
| 158 | + | |
| 159 | +void RenderScriptingInterface::forceViewportResolutionScale(float scale) { | |
| 160 | + _renderSettingLock.withWriteLock([&] { | |
| 161 | + _viewportResolutionScale = (scale); | |
| 162 | + // _antialiasingEnabledSetting.set(enabled); | |
| 163 | + | |
| 164 | + auto renderConfig = qApp->getRenderEngine()->getConfiguration(); | |
| 165 | + assert(renderConfig); | |
| 166 | + auto deferredView = renderConfig->getConfig("RenderMainView.RenderDeferredTask"); | |
| 167 | + // mainView can be null if we're rendering in forward mode | |
| 168 | + if (deferredView) { | |
| 169 | + deferredView->setProperty("resolutionScale", _viewportResolutionScale); | |
| 170 | + } | |
| 171 | + auto forwardView = renderConfig->getConfig("RenderMainView.RenderForwardTask"); | |
| 172 | + // mainView can be null if we're rendering in forward mode | |
| 173 | + if (forwardView) { | |
| 174 | + forwardView->setProperty("resolutionScale", _viewportResolutionScale); | |
| 175 | + } | |
| 176 | +/* | |
| 177 | + auto mainViewJitterCamConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<JitterSample>("RenderMainView.JitterCam"); | |
| 178 | + auto mainViewAntialiasingConfig = qApp->getRenderEngine()->getConfiguration()->getConfig<Antialiasing>("RenderMainView.Antialiasing"); | |
| 179 | + if (mainViewJitterCamConfig && mainViewAntialiasingConfig) { | |
| 180 | + Menu::getInstance()->setIsOptionChecked(MenuOption::AntiAliasing, enabled); | |
| 181 | + if (enabled) { | |
| 182 | + mainViewJitterCamConfig->play(); | |
| 183 | + mainViewAntialiasingConfig->setDebugFXAA(false); | |
| 184 | + } | |
| 185 | + else { | |
| 186 | + mainViewJitterCamConfig->none(); | |
| 187 | + mainViewAntialiasingConfig->setDebugFXAA(true); | |
| 188 | + } | |
| 189 | + }*/ | |
| 190 | + }); | |
| 191 | +} | |