Skip to content

Commit

Permalink
Renderer|Client: "Pixel Doubling" replaces the "Pixel Density" setting
Browse files Browse the repository at this point in the history
Should be more intuitive this way. Also moved the setting under the
"Camera Lens" group (which could now use some subheadings/splitting,
perhaps).
  • Loading branch information
skyjake committed Oct 25, 2014
1 parent 8b40886 commit 7e9791d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
5 changes: 3 additions & 2 deletions doomsday/client/src/render/fx/resize.cpp
Expand Up @@ -31,7 +31,7 @@ using namespace de;

namespace fx {

static ddouble const MIN_FACTOR = 1.0 / 16.0;
static Ranged const FACTOR_RANGE(1.0 / 16.0, 1.0);

DENG2_PIMPL(Resize)
{
Expand All @@ -58,7 +58,8 @@ DENG2_PIMPL(Resize)

float factor() const
{
return max(MIN_FACTOR, pixelDensity * resizeFactor);
double const rf = (resizeFactor > 0? 1.0 / resizeFactor : 1.0);
return FACTOR_RANGE.clamp(pixelDensity * rf);
}

/// Determines if the post-processing shader will be applied.
Expand Down
15 changes: 4 additions & 11 deletions doomsday/client/src/ui/editors/rendererappearanceeditor.cpp
Expand Up @@ -267,7 +267,6 @@ DENG2_OBSERVES(App, GameChange)
Group *spriteGroup;
Group *objectGroup;
Group *partGroup;
Group *fxGroup;

Instance(Public *i)
: Base(i),
Expand Down Expand Up @@ -399,6 +398,9 @@ DENG2_OBSERVES(App, GameChange)
// Camera lens settings.
lensGroup = new Group(this, "lens", tr("Camera Lens"));

lensGroup->addLabel(tr("Pixel Doubling:"));
lensGroup->addSlider(App::config("render.fx.resize.factor"), Ranged(1, 8), .1, 1);

lensGroup->addSpace();
lensGroup->addToggle("rend-bloom", tr("Bloom"));

Expand Down Expand Up @@ -586,14 +588,6 @@ DENG2_OBSERVES(App, GameChange)

partGroup->commit();

// Additional and miscellaneous effects.
fxGroup = new Group(this, "fx", tr("Other Effects"));

fxGroup->addLabel(tr("Pixel Density:"));
fxGroup->addSlider(App::config("render.fx.resize.factor"), Ranged(0, 1), .05, 2);

fxGroup->commit();

// Now we can define the first column width.
firstColumnWidth->setSource(maximumOfAllGroupFirstColumns());
}
Expand Down Expand Up @@ -752,8 +746,7 @@ RendererAppearanceEditor::RendererAppearanceEditor()
<< d->modelGroup->title() << *d->modelGroup
<< d->spriteGroup->title() << *d->spriteGroup
<< d->partGroup->title() << *d->partGroup
<< d->skyGroup->title() << *d->skyGroup
<< d->fxGroup->title() << *d->fxGroup;
<< d->skyGroup->title() << *d->skyGroup;

// Update container size.
d->container->setContentSize(OperatorRule::maximum(layout.width(),
Expand Down

0 comments on commit 7e9791d

Please sign in to comment.