History

Drafting ways to rescale in forward

Sam Gateau committed 7 years ago

Commit 52883141 parent 64858099 files · +166 −56Browse files

Showing the changes to interface/src/scripting/RenderScriptingInterface.cpp (1 of 9 files). Show all

Unified · Split

interface/src/scripting/RenderScriptingInterface.cpp+48−4
@@ -37,7 +37,7 @@ void RenderScriptingInterface::loadSettings() { · 36 unmodified lines
37 forceAntialiasingEnabled(_antialiasingEnabled);37 forceAntialiasingEnabled(_antialiasingEnabled);
38}38}
39 39
40RenderScriptingInterface::RenderMethod RenderScriptingInterface::getRenderMethod() {40RenderScriptingInterface::RenderMethod RenderScriptingInterface::getRenderMethod() const {
41 return (RenderMethod) _renderMethod;41 return (RenderMethod) _renderMethod;
42}42}
43 43
@@ -64,7 +64,7 @@ QStringList RenderScriptingInterface::getRenderMethodNames() const { · 20 unmodified lines
64 return refrenderMethodNames;64 return refrenderMethodNames;
65}65}
66 66
67bool RenderScriptingInterface::getShadowsEnabled() {67bool RenderScriptingInterface::getShadowsEnabled() const {
68 return _shadowsEnabled;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
91bool RenderScriptingInterface::getAmbientOcclusionEnabled() {91bool RenderScriptingInterface::getAmbientOcclusionEnabled() const {
92 return _ambientOcclusionEnabled;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
115bool RenderScriptingInterface::getAntialiasingEnabled() {115bool RenderScriptingInterface::getAntialiasingEnabled() const {
116 return _antialiasingEnabled;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
148float RenderScriptingInterface::getViewportResolutionScale() const {
149 return _viewportResolutionScale;
150}
151
152void RenderScriptingInterface::setViewportResolutionScale(float scale) {
153 if (_viewportResolutionScale != scale) {
154 forceViewportResolutionScale(scale);
155 emit settingsChanged();
156 }
157}
158
159void 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}