History

Rendering resolution can be different than the native window resolution

- Get rid of the different GlowModes since we found the correct one (DIFFUSE and ADD) Get rid of the ui to change the mode - INtroduce a "RenderResolutionScale" in the application that controls the ratio ofthe resolution between the framebuffers and the native window provided by Qt - In the paintGL, in the default rendering path: the rendering Framebuffers are resized to the window.size * renderResolutionScale. The viewport is assigned to the framebuffer size from GlowEffect.prepare() to GlowEffect.render() (and not the original GLCanvas size) at the end of GLowEffect render, the final step is to blit the colorbuffer from the rendering into the window's default framebuffer at the original resolution, and that requires one more glViewport - add the ui in developer/render/ menu "scale resolution" where you can select the scaling level. THis should show in the rendering with ugly aliasing when selecting a scale under 1/2.

samcake committed 12 years ago

Commit 700ec5c1 parent f5ee55b8 files · +80 −123Browse files

Showing the changes to interface/src/Menu.cpp (1 of 8 files). Show all

Unified · Split

interface/src/Menu.cpp+27−6
@@ -371,7 +371,15 @@ Menu::Menu() : · 370 unmodified lines
371371 shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, MenuOption::SimpleShadows, 0, false));
372372 shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, MenuOption::CascadedShadows, 0, false));
373373
374−
374+ QMenu* resolutionMenu = renderOptionsMenu->addMenu(MenuOption::RenderResolution);
375+ QActionGroup* resolutionGroup = new QActionGroup(resolutionMenu);
376+ resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionOne, 0, false));
377+ resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionTwoThird, 0, false));
378+ resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionHalf, 0, false));
379+ resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionThird, 0, true));
380+ resolutionGroup->addAction(addCheckableActionToQMenuAndActionHash(resolutionMenu, MenuOption::RenderResolutionQuarter, 0, false));
381+ connect(resolutionMenu, SIGNAL(triggered(QAction*)), this, SLOT(changeRenderResolution(QAction*)));
382+
375383 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Stars, Qt::Key_Asterisk, true);
376384 addCheckableActionToQMenuAndActionHash(renderOptionsMenu,
377385 MenuOption::Voxels,
@@ -380,11 +388,7 @@ Menu::Menu() : · 2 unmodified lines
380388 appInstance,
381389 SLOT(setRenderVoxels(bool)));
382390 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::EnableGlowEffect, 0, true);
383− addActionToQMenuAndActionHash(renderOptionsMenu,
384− MenuOption::GlowMode,
385− 0,
386− appInstance->getGlowEffect(),
387− SLOT(cycleRenderMode()));
391+
388392 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Wireframe, Qt::ALT | Qt::Key_W, false);
389393 addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, Qt::SHIFT | Qt::Key_L, this, SLOT(lodTools()));
390394
@@ -1225,6 +1229,23 @@ void Menu::muteEnvironment() { · 834 unmodified lines
12251229 free(packet);
12261230 }
12271231
1232+void Menu::changeRenderResolution(QAction* action) {
1233+ QString text = action->text();
1234+ if (text == MenuOption::RenderResolutionOne) {
1235+ Application::getInstance()->setRenderResolutionScale(1.f);
1236+ } else if (text == MenuOption::RenderResolutionTwoThird) {
1237+ Application::getInstance()->setRenderResolutionScale(0.666f);
1238+ } else if (text == MenuOption::RenderResolutionHalf) {
1239+ Application::getInstance()->setRenderResolutionScale(0.5f);
1240+ } else if (text == MenuOption::RenderResolutionThird) {
1241+ Application::getInstance()->setRenderResolutionScale(0.333f);
1242+ } else if (text == MenuOption::RenderResolutionQuarter) {
1243+ Application::getInstance()->setRenderResolutionScale(0.25f);
1244+ } else {
1245+ Application::getInstance()->setRenderResolutionScale(1.f);
1246+ }
1247+}
1248+
12281249 void Menu::displayNameLocationResponse(const QString& errorString) {
12291250
12301251 if (!errorString.isEmpty()) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t