Skip to content

Commit

Permalink
Some precomputations tweaks (average intensities calculated, etc.) an…
Browse files Browse the repository at this point in the history
…d fixed.
  • Loading branch information
csobaistvan committed May 30, 2017
1 parent 8728a59 commit 289bb3d
Show file tree
Hide file tree
Showing 11 changed files with 55,307 additions and 81 deletions.
2 changes: 2 additions & 0 deletions LensPlanner/src/GhostSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ bool GhostSerializer::deserialize()

// Make sure it was successfuly read.
if (xml.error())
{
return false;
}

// Save the results
*m_ghosts = result;
Expand Down
6 changes: 3 additions & 3 deletions LensPlanner/src/LensFlarePreviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ void LensFlarePreviewer::computeGhostParameters()
OLEF::RayTraceGhostAlgorithm::GhostAttribComputeParams computeParams;

computeParams.m_angle = glm::radians(angle);
computeParams.m_boundingPasses = 3;
computeParams.m_boundingRays = { 32, 32, 32 };
computeParams.m_rayPresets = { 5, 16, 32, 64, 128 };
computeParams.m_targetVariance = 0.025f;

// Compute the ghost attributes
OLEF::GhostList currentGhosts =
Expand Down Expand Up @@ -375,8 +375,8 @@ void LensFlarePreviewer::paintGL()
-lightSource.getIncidenceDirection(),
glm::vec3(0.0f, 0.0f, -1.0f))));

auto it = m_precomputedGhosts.lowerBound(angle);
if (it != m_precomputedGhosts.end())
auto it = m_precomputedGhosts.lowerBound(angle - 0.1f);
if (it != m_precomputedGhosts.end() && glm::abs(angle - it.key()) < 1.0f)
allGhosts = it.value();
}

Expand Down
2 changes: 1 addition & 1 deletion LensPlanner/src/LensFlarePreviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LensFlarePreviewer: public QOpenGLWidget, public TextureAccessor
float m_ghostRadiusClip = 1.0f;

/// Intensity clipping value.
float m_ghostIntensityClip = 1.0f;
float m_ghostIntensityClip = 0.05f;

/// The render mode used to render these ghosts.
OLEF::RayTraceGhostAlgorithm::RenderMode m_ghostRenderMode;
Expand Down
2 changes: 1 addition & 1 deletion LensPlanner/src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void MainWindow::loadGhostBounds()
m_lensFlarePreviewer->setPrecomputedGhosts(ghosts);

// Let the views know about the change.
m_lensFlarePreviewer->opticalSystemChanged();
m_lensFlarePreviewer->update();
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 2 additions & 0 deletions LensPlanner/src/OpticalSystemPreviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "Dependencies.h"

/// The optical system previewer widget.
///
/// TODO: display invalid elements with a special color
class OpticalSystemPreviewer: public QOpenGLWidget
{
Q_OBJECT;
Expand Down
Loading

0 comments on commit 289bb3d

Please sign in to comment.