Skip to content

Commit

Permalink
GITechDemo:
Browse files Browse the repository at this point in the history
*lighting parameter update
*tone mapping parameter update
*bloom parameter update
*film grain parameter update
*color correction parameter update
*default to borderless window mode
*window state caching initialization fix
  • Loading branch information
iftodebogdan committed May 9, 2017
1 parent 3bdbb90 commit 6771d8e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
10 changes: 6 additions & 4 deletions GITechDemo/Code/AppMain/GITechDemo/GITechDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace GITechDemoApp
extern const char* const ResourceTypeMap[RenderResource::RES_MAX];

bool FULLSCREEN_ENABLED = false;
bool BORDERLESS_ENABLED = false;
bool BORDERLESS_ENABLED = true;
int FULLSCREEN_RESOLUTION_X = 0;
int FULLSCREEN_RESOLUTION_Y = 0;
int FULLSCREEN_REFRESH_RATE = 0;
Expand Down Expand Up @@ -112,6 +112,8 @@ bool GITechDemo::Init(void* hWnd)
{
m_pHWND = hWnd;

Framework* const pFW = Framework::GetInstance();

// Renderer MUST be initialized on the SAME thread as the target window
Renderer::CreateInstance(API_DX9);
//Renderer::CreateInstance(API_NULL);
Expand Down Expand Up @@ -198,9 +200,9 @@ bool GITechDemo::Init(void* hWnd)
m_nLastFrameResY = -1;
m_vLastFrameViewport = Vec2i(-1, -1);
m_nLastFrameRefreshRate = -1;
m_bLastFrameFullscreen = FULLSCREEN_ENABLED;
m_bLastFrameBorderless = BORDERLESS_ENABLED;
m_bLastFrameVSync = VSYNC_ENABLED;
m_bLastFrameFullscreen = pFW->IsFullscreen();
m_bLastFrameBorderless = pFW->IsBorderlessWindow();
m_bLastFrameVSync = RenderContext->GetVSyncStatus();

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace GITechDemoApp;
namespace GITechDemoApp
{
bool HDR_TONE_MAPPING_ENABLED = true;
bool SRGB_COLOR_CORRECTION = false;
bool SRGB_COLOR_CORRECTION = true;
}

HDRToneMappingPass::HDRToneMappingPass(const char* const passName, RenderPass* const parentPass)
Expand Down
8 changes: 4 additions & 4 deletions GITechDemo/Code/AppMain/GITechDemo/Resources/AppResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ namespace GITechDemoApp
CREATE_SHADER_CONSTANT_OBJECT(fZFar, float, 5000.f );

/* Directional light parameters */
CREATE_SHADER_CONSTANT_OBJECT(fDiffuseFactor, float, 10.f );
CREATE_SHADER_CONSTANT_OBJECT(fDiffuseFactor, float, 7.5f );
CREATE_SHADER_CONSTANT_OBJECT(fSpecFactor, float, 15.f );
CREATE_SHADER_CONSTANT_OBJECT(fAmbientFactor, float, 0.15f );
CREATE_SHADER_CONSTANT_OBJECT(fIrradianceFactor, float, 1.f );
Expand Down Expand Up @@ -454,7 +454,7 @@ namespace GITechDemoApp

/* Post-processing parameters */
// Tone mapping
CREATE_SHADER_CONSTANT_OBJECT(fExposureBias, float, 0.2f );
CREATE_SHADER_CONSTANT_OBJECT(fExposureBias, float, 0.25f );
CREATE_SHADER_CONSTANT_OBJECT(f2AvgLumaClamp, Vec2f, Vec2f(0.0001f, 0.75f) );
CREATE_SHADER_CONSTANT_OBJECT(fShoulderStrength, float, 0.5f );
CREATE_SHADER_CONSTANT_OBJECT(fLinearStrength, float, 0.58f );
Expand All @@ -464,12 +464,12 @@ namespace GITechDemoApp
CREATE_SHADER_CONSTANT_OBJECT(fToeDenominator, float, 0.58f );
CREATE_SHADER_CONSTANT_OBJECT(fLinearWhite, float, 3.f );
CREATE_SHADER_CONSTANT_OBJECT(fLumaAdaptSpeed, float, 1.f );
CREATE_SHADER_CONSTANT_OBJECT(fFilmGrainAmount, float, 0.003f );
CREATE_SHADER_CONSTANT_OBJECT(fFilmGrainAmount, float, 0.001f );
CREATE_SHADER_CONSTANT_OBJECT(bApplyColorCorrection, bool, true );
// Bloom
CREATE_SHADER_CONSTANT_OBJECT(fBrightnessThreshold, float, 0.2f );
CREATE_SHADER_CONSTANT_OBJECT(fBloomPower, float, 1.f );
CREATE_SHADER_CONSTANT_OBJECT(fBloomStrength, float, 1.f );
CREATE_SHADER_CONSTANT_OBJECT(fBloomStrength, float, 0.75f );
// FXAA
CREATE_SHADER_CONSTANT_OBJECT(fFxaaSubpix, float, 0.75f );
CREATE_SHADER_CONSTANT_OBJECT(fFxaaEdgeThreshold, float, 0.166f );
Expand Down

0 comments on commit 6771d8e

Please sign in to comment.