Skip to content

Commit 8816bc1

Browse files
committed
*Fixed bloom artifacts caused by very bright specular highlights
*Recalibrated bloom parameters *Reduced the autofocus time *Fixed fLumaAdaptSpeed parameter usage *Fixed build script
1 parent cf02759 commit 8816bc1

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

GITechDemo/Build/build_win.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# 'profile' to build on the Profile configuration
1010

1111
PROJECT_NAME = "GITechDemo"
12-
DEFAULT_VSCOMNTOOLS = "VS140COMNTOOLS"
12+
DEFAULT_VSCOMNTOOLS = "VS100COMNTOOLS"
1313
FORCE_REBUILD = False
1414
BUILD_CONFIGURATION = "Release"
1515

@@ -55,15 +55,15 @@ def copytree(src, dst, symlinks = False, ignore = None):
5555
else:
5656
shutil.copy2(s, d)
5757

58-
def buildsln(pathToTools, platform, buildConfig):
59-
cmd = "\"" + pathToTools + "VsDevCmd.bat\" && "
60-
cmd += "MSBuild.exe /maxcpucount /p:Configuration=" + buildConfig + " /p:Platform=" + platform
58+
def buildsln(pathToTools, envSetupBat, platform, buildConfig):
59+
os.environ["PATH"] += os.pathsep + pathToTools
60+
cmd =envSetupBat + " && MSBuild.exe /maxcpucount /p:Configuration=" + buildConfig + " /p:Platform=" + platform
6161
if(FORCE_REBUILD):
6262
cmd += " /t:rebuild "
6363
else:
6464
cmd += " "
65-
cmd += os.getcwd() + "/../Code/Solutions/"
66-
cmd += PROJECT_NAME + ".sln"
65+
cmd += "\"" + os.getcwd() + "/../Code/Solutions/"
66+
cmd += PROJECT_NAME + ".sln\""
6767
#print(cmd)
6868
os.system(cmd)
6969

@@ -79,8 +79,16 @@ def buildsln(pathToTools, platform, buildConfig):
7979

8080
print("\nStarting build process...\n")
8181

82+
envSetupBat = "VsDevCmd.bat"
83+
8284
if(os.getenv(DEFAULT_VSCOMNTOOLS)):
8385
pathToTools = os.getenv(DEFAULT_VSCOMNTOOLS)
86+
if(
87+
DEFAULT_VSCOMNTOOLS == "VS100COMNTOOLS" or
88+
DEFAULT_VSCOMNTOOLS == "VS90COMNTOOLS" or
89+
DEFAULT_VSCOMNTOOLS == "VS80COMNTOOLS"
90+
):
91+
envSetupBat = "vsvars32.bat"
8492
elif(os.getenv("VS140COMNTOOLS")): # Visual Studio 2015
8593
pathToTools = os.getenv("VS140COMNTOOLS")
8694
elif(os.getenv("VS120COMNTOOLS")): # Visual Studio 2013
@@ -89,16 +97,19 @@ def buildsln(pathToTools, platform, buildConfig):
8997
pathToTools = os.getenv("VS110COMNTOOLS")
9098
elif(os.getenv("VS100COMNTOOLS")): # Visual Studio 2010
9199
pathToTools = os.getenv("VS100COMNTOOLS")
100+
envSetupBat = "vsvars32.bat"
92101
#elif(os.getenv("VS90COMNTOOLS")): # Visual Studio 2008
93102
# pathToTools = os.getenv("VS90COMNTOOLS")
103+
# envSetupBat = "vsvars32.bat"
94104
#elif(os.getenv("VS80COMNTOOLS")): # Visual Studio 2005
95105
# pathToTools = os.getenv("VS80COMNTOOLS")
106+
# envSetupBat = "vsvars32.bat"
96107
else:
97108
print("No compatible version of Visual Studio found!\n")
98109

99110
if(pathToTools):
100-
buildsln(pathToTools, "x86", BUILD_CONFIGURATION)
101-
buildsln(pathToTools, "x64", BUILD_CONFIGURATION)
111+
buildsln(pathToTools, envSetupBat, "x86", BUILD_CONFIGURATION)
112+
buildsln(pathToTools, envSetupBat, "x64", BUILD_CONFIGURATION)
102113

103114
print("\nConfiguring build...\n")
104115

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/DepthOfFieldPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace GITechDemoApp
1717
{
1818
bool DOF_ENABLED = true;
1919
bool DOF_USE_QUARTER_RESOLUTION_BUFFER = false;
20-
float DOF_AUTOFOCUS_TIME = 1.f;
20+
float DOF_AUTOFOCUS_TIME = 0.25f;
2121
}
2222

2323
DepthOfFieldPass::DepthOfFieldPass(const char* const passName, RenderPass* const parentPass)

GITechDemo/Code/AppMain/GITechDemo/Resources/RenderResources.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ namespace GITechDemoApp
211211
IMPLEMENT_ARTIST_SHADER_CONSTANT(fLinearWhite, float, 11.2f );
212212
IMPLEMENT_ARTIST_SHADER_CONSTANT(fLumaAdaptSpeed, float, 1.f );
213213
// Bloom
214-
IMPLEMENT_ARTIST_SHADER_CONSTANT(fBrightnessThreshold, float, 1.f );
214+
IMPLEMENT_ARTIST_SHADER_CONSTANT(fBrightnessThreshold, float, 0.5f );
215215
IMPLEMENT_ARTIST_SHADER_CONSTANT(fBloomPower, float, 1.f );
216-
IMPLEMENT_ARTIST_SHADER_CONSTANT(fBloomStrength, float, 0.3f );
216+
IMPLEMENT_ARTIST_SHADER_CONSTANT(fBloomStrength, float, 0.25f );
217217
// FXAA
218218
IMPLEMENT_ARTIST_SHADER_CONSTANT(fFxaaSubpix, float, 0.75f );
219219
IMPLEMENT_ARTIST_SHADER_CONSTANT(fFxaaEdgeThreshold, float, 0.166f );

GITechDemo/Data/shaders/Downsample.hlsl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ void psmain(VSOut input, out float4 f4Color : SV_TARGET)
3838
f4Color = tex2D(texSource, input.f2TexCoord);
3939

4040
if (bApplyBrightnessFilter)
41-
f4Color.rgb = max(0.f, f4Color.rgb - fBrightnessThreshold);
41+
{
42+
const float fBrightness = dot(f4Color.rgb, LUMINANCE_VECTOR);
43+
f4Color.rgb *= step(fBrightnessThreshold, fBrightness);
44+
f4Color.rgb /= fBrightness;
45+
}
4246
}
4347
////////////////////////////////////////////////////////////////////

GITechDemo/Data/shaders/LumaCalc.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void psmain(VSOut input, out float4 f4Color : SV_TARGET)
9393
{
9494
const float fCurrLuma = tex2D(texLumaCalcInput, float2(0.5f, 0.5f)).r;
9595
const float fTargetLuma = tex2D(texLumaTarget, float2(0.5f, 0.5f)).r;
96-
const float fNewLuma = fCurrLuma + (fTargetLuma - fCurrLuma) * (fLumaAdaptSpeed * fFrameTime);
96+
const float fNewLuma = fCurrLuma + (fTargetLuma - fCurrLuma) * (rcp(fLumaAdaptSpeed) * fFrameTime);
9797
f4Color = float4(fNewLuma, fNewLuma, fNewLuma, 1.f);
9898
}
9999
}

0 commit comments

Comments
 (0)