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
371 shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, MenuOption::SimpleShadows, 0, false));371 shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, MenuOption::SimpleShadows, 0, false));
372 shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, MenuOption::CascadedShadows, 0, false));372 shadowGroup->addAction(addCheckableActionToQMenuAndActionHash(shadowMenu, MenuOption::CascadedShadows, 0, false));
373 373
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
375 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Stars, Qt::Key_Asterisk, true);383 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Stars, Qt::Key_Asterisk, true);
376 addCheckableActionToQMenuAndActionHash(renderOptionsMenu,384 addCheckableActionToQMenuAndActionHash(renderOptionsMenu,
377 MenuOption::Voxels,385 MenuOption::Voxels,
@@ -380,11 +388,7 @@ Menu::Menu() : · 2 unmodified lines
380 appInstance,388 appInstance,
381 SLOT(setRenderVoxels(bool)));389 SLOT(setRenderVoxels(bool)));
382 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::EnableGlowEffect, 0, true);390 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::EnableGlowEffect, 0, true);
383 addActionToQMenuAndActionHash(renderOptionsMenu,391
384 MenuOption::GlowMode,
385 0,
386 appInstance->getGlowEffect(),
387 SLOT(cycleRenderMode()));
388 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Wireframe, Qt::ALT | Qt::Key_W, false);392 addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Wireframe, Qt::ALT | Qt::Key_W, false);
389 addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, Qt::SHIFT | Qt::Key_L, this, SLOT(lodTools()));393 addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, Qt::SHIFT | Qt::Key_L, this, SLOT(lodTools()));
390 394
@@ -1225,6 +1229,23 @@ void Menu::muteEnvironment() { · 834 unmodified lines
1225 free(packet);1229 free(packet);
1226}1230}
1227 1231
1232void 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
1228void Menu::displayNameLocationResponse(const QString& errorString) {1249void Menu::displayNameLocationResponse(const QString& errorString) {
1229 1250
1230 if (!errorString.isEmpty()) {1251 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