Skip to content

Commit

Permalink
#86 Update bloom threshold param
Browse files Browse the repository at this point in the history
  • Loading branch information
ducphamhong committed Oct 7, 2020
1 parent b2c1694 commit cb4101a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Projects/Skylicht/Components/Source/GridPlane/CGridPlaneData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace Skylicht
{
clearBuffer();

SColor color(255, 50, 50, 50);
SColor color(255, 10, 10, 10);

core::vector3df start;
core::vector3df end;
Expand All @@ -56,9 +56,9 @@ namespace Skylicht
for (int i = 0; i <= NumGrid; i++)
{
if (i == NumGrid / 2)
color = SColor(255, 100, 100, 100);
color = SColor(255, 60, 60, 60);
else
color = SColor(255, 50, 50, 50);
color = SColor(255, 10, 10, 10);

addLineVertexBatch(start, end, color);

Expand All @@ -72,9 +72,9 @@ namespace Skylicht
for (int i = 0; i <= NumGrid; i++)
{
if (i == NumGrid / 2)
color = SColor(255, 100, 100, 100);
color = SColor(255, 60, 60, 60);
else
color = SColor(255, 50, 50, 50);
color = SColor(255, 10, 10, 10);

addLineVertexBatch(start, end, color);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ namespace Skylicht
m_blurUpFilter(NULL),
m_bloomFilter(NULL),
m_fxaaFilter(NULL),
m_numTarget(0)
m_numTarget(0),
m_bloomThreshold(0.9f)
{
m_luminance[0] = NULL;
m_luminance[1] = NULL;
Expand Down Expand Up @@ -167,7 +168,7 @@ namespace Skylicht
{
video::SVec4 curve;

float threshold = 0.9f;
float threshold = m_bloomThreshold;
float softKnee = 0.5f;
curve.W = threshold;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ namespace Skylicht
SMaterial m_adaptLumPass;
SMaterial m_effectPass;

float m_bloomThreshold;

bool m_autoExposure;
bool m_bloomEffect;
bool m_fxaa;
Expand Down Expand Up @@ -96,6 +98,11 @@ namespace Skylicht
m_fxaa = b;
}

inline void setBloomThreshold(float f)
{
m_bloomThreshold = f;
}

protected:

void renderEffect(int fromTarget, int toTarget, CMaterial *material);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ SampleParticlesMagicSkill::~SampleParticlesMagicSkill()
delete m_vortexSystem;
delete m_scene;

delete m_forwardRP;
delete m_postProcessorRP;

CImguiManager::releaseInstance();
}

Expand Down Expand Up @@ -114,6 +117,11 @@ void SampleParticlesMagicSkill::onInitApp()

m_forwardRP = new CForwardRP();
m_forwardRP->initRender(w, h);

m_postProcessorRP = new CPostProcessorRP();
m_postProcessorRP->setBloomThreshold(0.7f);
m_postProcessorRP->initRender(w, h);
m_forwardRP->setPostProcessor(m_postProcessorRP);
}

bool SampleParticlesMagicSkill::OnEvent(const SEvent& event)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class SampleParticlesMagicSkill :
CCamera *m_camera;

CForwardRP *m_forwardRP;
CPostProcessorRP *m_postProcessorRP;

CGlyphFont* m_font;

Expand Down

0 comments on commit cb4101a

Please sign in to comment.