Skip to content

Commit 4b6a060

Browse files
committed
*Added the possibility to cycle through parameter categories on the HUD by holding the right shift button while pressing the up or down arrow keys
*Moved sky box pass after SSAO so as to avoid halo artifacts *SSAO shader will now clip pixels that are at max depth
1 parent 5796078 commit 4b6a060

13 files changed

+217
-121
lines changed

GITechDemo/Code/AppMain/GITechDemo/GITechDemo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ void GITechDemo::Update(const float fDeltaTime)
583583
{
584584
HUD_PASS.PrintLn("");
585585
HUD_PASS.PrintLn("Directional arrows up/down: cycle configurable parameters");
586+
HUD_PASS.PrintLn("RShift + Directional arrows up/down: cycle parameter categories");
586587
HUD_PASS.PrintLn("Directional arrows left/right: modify currently selected parameter");
587588
}
588589
}

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/LensFlarePass.cpp

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using namespace GITechDemoApp;
1515
namespace GITechDemoApp
1616
{
1717
bool LENS_FLARE_ENABLED = true;
18-
float LENS_FLARE_BRIGHTNESS_THRESHOLD = 4.f;
18+
float LENS_FLARE_BRIGHTNESS_THRESHOLD = 3.5f;
1919

2020
const unsigned int LENS_FLARE_BLUR_KERNEL_COUNT = 3;
2121
const unsigned int LENS_FLARE_BLUR_KERNEL[LENS_FLARE_BLUR_KERNEL_COUNT] = { 0, 1, 2 };
@@ -86,6 +86,11 @@ void LensFlarePass::Update(const float fDeltaTime)
8686
0.f, 0.f, 1.f);
8787

8888
f33LensFlareStarBurstMat = scaleBias2 * rotMat * scaleBias1;
89+
90+
if (bAnamorphic)
91+
CurrentLensFlareBuffer = AnamorphicLensFlareBuffer;
92+
else
93+
CurrentLensFlareBuffer = SphericalLensFlareBuffer;
8994
}
9095

9196
void LensFlarePass::Draw()
@@ -107,7 +112,7 @@ void LensFlarePass::ApplyBrightnessFilter()
107112

108113
PUSH_PROFILE_MARKER("Brightness filter");
109114

110-
LensFlareBuffer[0]->Enable();
115+
CurrentLensFlareBuffer[0]->Enable();
111116

112117
// Not necesarry
113118
//RenderContext->Clear(Vec4f(0.f, 0.f, 0.f, 0.f), 1.f, 0);
@@ -131,7 +136,7 @@ void LensFlarePass::ApplyBrightnessFilter()
131136

132137
fBrightnessThreshold = bkp;
133138

134-
LensFlareBuffer[0]->Disable();
139+
CurrentLensFlareBuffer[0]->Disable();
135140

136141
POP_PROFILE_MARKER();
137142
}
@@ -149,33 +154,33 @@ void LensFlarePass::GenerateFeatures()
149154
PUSH_PROFILE_MARKER("Feature generation");
150155

151156
ResourceMgr->GetTexture(
152-
LensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer(0)
153-
)->SetAddressingMode(SAM_WRAP);
157+
CurrentLensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer(0)
158+
)->SetAddressingMode(SAM_CLAMP);
154159

155160
ResourceMgr->GetTexture(
156-
LensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer(0)
161+
CurrentLensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer(0)
157162
)->SetFilter(SF_MIN_MAG_LINEAR_MIP_NONE);
158163

159-
LensFlareBuffer[1]->Enable();
164+
CurrentLensFlareBuffer[1]->Enable();
160165

161166
// Not necesarry
162167
//RenderContext->Clear(Vec4f(0.f, 0.f, 0.f, 0.f), 1.f, 0);
163168

164169
f2HalfTexelOffset = Vec2f(
165-
0.5f / LensFlareBuffer[0]->GetRenderTarget()->GetWidth(),
166-
0.5f / LensFlareBuffer[0]->GetRenderTarget()->GetHeight()
170+
0.5f / CurrentLensFlareBuffer[0]->GetRenderTarget()->GetWidth(),
171+
0.5f / CurrentLensFlareBuffer[0]->GetRenderTarget()->GetHeight()
167172
);
168173
f2TexelSize = Vec2f(
169-
1.f / LensFlareBuffer[0]->GetRenderTarget()->GetWidth(),
170-
1.f / LensFlareBuffer[0]->GetRenderTarget()->GetHeight()
174+
1.f / CurrentLensFlareBuffer[0]->GetRenderTarget()->GetWidth(),
175+
1.f / CurrentLensFlareBuffer[0]->GetRenderTarget()->GetHeight()
171176
);
172-
texSource = LensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer();
177+
texSource = CurrentLensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer();
173178

174179
LensFlareFeaturesShader.Enable();
175180
RenderContext->DrawVertexBuffer(FullScreenTri);
176181
LensFlareFeaturesShader.Disable();
177182

178-
LensFlareBuffer[1]->Disable();
183+
CurrentLensFlareBuffer[1]->Disable();
179184

180185
POP_PROFILE_MARKER();
181186
}
@@ -193,17 +198,17 @@ void LensFlarePass::Blur()
193198
PUSH_PROFILE_MARKER("Blur");
194199

195200
ResourceMgr->GetTexture(
196-
LensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer(0)
201+
CurrentLensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer(0)
197202
)->SetAddressingMode(SAM_CLAMP);
198203
ResourceMgr->GetTexture(
199-
LensFlareBuffer[1]->GetRenderTarget()->GetColorBuffer(0)
204+
CurrentLensFlareBuffer[1]->GetRenderTarget()->GetColorBuffer(0)
200205
)->SetAddressingMode(SAM_CLAMP);
201206

202207
ResourceMgr->GetTexture(
203-
LensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer(0)
208+
CurrentLensFlareBuffer[0]->GetRenderTarget()->GetColorBuffer(0)
204209
)->SetFilter(SF_MIN_MAG_POINT_MIP_NONE);
205210
ResourceMgr->GetTexture(
206-
LensFlareBuffer[1]->GetRenderTarget()->GetColorBuffer(0)
211+
CurrentLensFlareBuffer[1]->GetRenderTarget()->GetColorBuffer(0)
207212
)->SetFilter(SF_MIN_MAG_POINT_MIP_NONE);
208213

209214
for (unsigned int i = 0; i < LENS_FLARE_BLUR_KERNEL_COUNT; i++)
@@ -214,31 +219,28 @@ void LensFlarePass::Blur()
214219
#endif
215220
PUSH_PROFILE_MARKER(label);
216221

217-
LensFlareBuffer[i % 2]->Enable();
222+
CurrentLensFlareBuffer[i % 2]->Enable();
218223

219224
// Not necesarry
220225
//RenderContext->Clear(Vec4f(0.f, 0.f, 0.f, 0.f), 1.f, 0);
221226

222227
f2HalfTexelOffset = Vec2f(
223-
0.5f / LensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetWidth(),
224-
0.5f / LensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetHeight()
228+
0.5f / CurrentLensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetWidth(),
229+
0.5f / CurrentLensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetHeight()
225230
);
226-
ResourceMgr->GetTexture(
227-
LensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetColorBuffer(0)
228-
)->SetFilter(SF_MIN_MAG_POINT_MIP_NONE);
229-
texSource = LensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetColorBuffer(0);
230231
f2TexelSize = Vec2f(
231-
1.f / LensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetWidth(),
232-
1.f / LensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetHeight()
232+
1.f / CurrentLensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetWidth(),
233+
1.f / CurrentLensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetHeight()
233234
);
235+
texSource = CurrentLensFlareBuffer[(i + 1) % 2]->GetRenderTarget()->GetColorBuffer(0);
234236
nKernel = LENS_FLARE_BLUR_KERNEL[i];
235237

236238
// Reuse bloom shader for Kawase blur
237239
BloomShader.Enable();
238240
RenderContext->DrawVertexBuffer(FullScreenTri);
239241
BloomShader.Disable();
240242

241-
LensFlareBuffer[i % 2]->Disable();
243+
CurrentLensFlareBuffer[i % 2]->Disable();
242244

243245
POP_PROFILE_MARKER();
244246
}
@@ -272,11 +274,11 @@ void LensFlarePass::UpscaleAndBlend()
272274
RenderContext->GetRenderStateManager()->SetZWriteEnabled(false);
273275
RenderContext->GetRenderStateManager()->SetZFunc(CMP_ALWAYS);
274276

275-
f2HalfTexelOffset = Vec2f(0.5f / LensFlareBuffer[(LENS_FLARE_BLUR_KERNEL_COUNT + 1) % 2]->GetRenderTarget()->GetWidth(), 0.5f / LensFlareBuffer[(LENS_FLARE_BLUR_KERNEL_COUNT + 1) % 2]->GetRenderTarget()->GetHeight());
277+
f2HalfTexelOffset = Vec2f(0.5f / CurrentLensFlareBuffer[(LENS_FLARE_BLUR_KERNEL_COUNT + 1) % 2]->GetRenderTarget()->GetWidth(), 0.5f / CurrentLensFlareBuffer[(LENS_FLARE_BLUR_KERNEL_COUNT + 1) % 2]->GetRenderTarget()->GetHeight());
276278
ResourceMgr->GetTexture(
277-
LensFlareBuffer[(LENS_FLARE_BLUR_KERNEL_COUNT + 1) % 2]->GetRenderTarget()->GetColorBuffer(0)
279+
CurrentLensFlareBuffer[(LENS_FLARE_BLUR_KERNEL_COUNT + 1) % 2]->GetRenderTarget()->GetColorBuffer(0)
278280
)->SetFilter(SF_MIN_MAG_LINEAR_MIP_NONE);
279-
texLensFlareFeatures = LensFlareBuffer[(LENS_FLARE_BLUR_KERNEL_COUNT + 1) % 2]->GetRenderTarget()->GetColorBuffer();
281+
texLensFlareFeatures = CurrentLensFlareBuffer[(LENS_FLARE_BLUR_KERNEL_COUNT + 1) % 2]->GetRenderTarget()->GetColorBuffer();
280282

281283
LensFlareApplyShader.Enable();
282284
RenderContext->DrawVertexBuffer(FullScreenTri);

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/LensFlarePass.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
namespace GITechDemoApp
77
{
8+
class RenderTarget;
9+
810
class LensFlarePass : public RenderPass
911
{
1012
IMPLEMENT_RENDER_PASS(LensFlarePass)
@@ -14,6 +16,8 @@ namespace GITechDemoApp
1416
void GenerateFeatures();
1517
void Blur();
1618
void UpscaleAndBlend();
19+
20+
RenderTarget** CurrentLensFlareBuffer;
1721
};
1822
}
1923

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ CREATE_ROOT_PASS()
3535
#include "LightingPass.h"
3636
ADD_RENDER_PASS(LIGHTING_PASS, LightingPass, "Lighting Pass", ROOT_PASS)
3737

38-
// Render the sky box
39-
#include "SkyPass.h"
40-
ADD_RENDER_PASS(SKY_PASS, SkyPass, "Sky Pass", LIGHTING_PASS)
41-
4238
// Compute direct light contribution from the directional light
4339
#include "DirectionalLightPass.h"
4440
ADD_RENDER_PASS(DIRECTIONAL_LIGHT_PASS, DirectionalLightPass, "Directional Light Pass", LIGHTING_PASS)
4541

4642
// Screen space ambient occlusion (done here so as no to affect indirect and volumetric lights)
4743
#include "SSAOPass.h"
4844
ADD_RENDER_PASS(SSAO_PASS, SSAOPass, "SSAO Pass", LIGHTING_PASS)
45+
46+
// Render the sky box (moved after SSAO so as to avoid halo artifacts on the sky)
47+
#include "SkyPass.h"
48+
ADD_RENDER_PASS(SKY_PASS, SkyPass, "Sky Pass", LIGHTING_PASS)
4949

5050
// Compute indirect (1 unoccluded bounce) light contribution from the directional light
5151
#include "DirectionalIndirectLightPass.h"

GITechDemo/Code/AppMain/GITechDemo/Resources/ArtistParameter.cpp

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,49 @@ void ArtistParameterManager::Update()
5959

6060
// Handle input
6161
if(cmd & APM_CMD_NEXT)
62-
m_nCurrParam < (int)ms_arrParams.size() - 1 ? m_nCurrParam++ : m_nCurrParam = -1;
63-
else if(cmd & APM_CMD_PREV)
64-
m_nCurrParam > -1 ? m_nCurrParam-- : m_nCurrParam = (int)ms_arrParams.size() - 1;
62+
if (cmd & APM_CMD_MAX_STEP)
63+
{
64+
string szCategory = m_nCurrParam != -1 ? ms_arrParams[m_nCurrParam]->szCategory : "";
65+
for (unsigned int i = 0; i < ms_arrParams.size() + 1; i++)
66+
{
67+
m_nCurrParam < (int)ms_arrParams.size() - 1 ? m_nCurrParam++ : m_nCurrParam = -1;
68+
if (m_nCurrParam == -1 || ms_arrParams[m_nCurrParam]->szCategory != szCategory)
69+
break;
70+
}
71+
}
72+
else
73+
m_nCurrParam < (int)ms_arrParams.size() - 1 ? m_nCurrParam++ : m_nCurrParam = -1;
74+
else
75+
if(cmd & APM_CMD_PREV)
76+
if (cmd & APM_CMD_MAX_STEP)
77+
{
78+
string szCategory = m_nCurrParam != -1 ? ms_arrParams[m_nCurrParam]->szCategory : "";
79+
string szCategory2;
80+
for (unsigned int i = 0; i < ms_arrParams.size(); i++)
81+
{
82+
m_nCurrParam > -1 ? m_nCurrParam-- : m_nCurrParam = (int)ms_arrParams.size() - 1;
83+
if (m_nCurrParam == -1 && szCategory2.empty())
84+
break;
85+
else
86+
if (m_nCurrParam == -1 || ms_arrParams[m_nCurrParam]->szCategory != szCategory)
87+
{
88+
if (szCategory2.empty() && m_nCurrParam != -1)
89+
{
90+
szCategory2 = ms_arrParams[m_nCurrParam]->szCategory;
91+
continue;
92+
}
93+
94+
if (m_nCurrParam == -1 || ms_arrParams[m_nCurrParam]->szCategory != szCategory2)
95+
{
96+
m_nCurrParam < (int)ms_arrParams.size() - 1 ? m_nCurrParam++ : m_nCurrParam = -1;
97+
break;
98+
}
99+
}
100+
101+
}
102+
}
103+
else
104+
m_nCurrParam > -1 ? m_nCurrParam-- : m_nCurrParam = (int)ms_arrParams.size() - 1;
65105

66106
ArtistParameter* const pCurrAP = m_nCurrParam != -1 ? ms_arrParams[m_nCurrParam] : nullptr;
67107

@@ -131,7 +171,7 @@ void ArtistParameterManager::Update()
131171
if (pCurrAP->nTypeHash != typeid(bool).hash_code())
132172
{
133173
HUD_PASS.PrintLn("");
134-
HUD_PASS.PrintLn("Hold RCtrl or RShift to scale step value.");
174+
HUD_PASS.PrintLn("Hold RCtrl (x0.1) or RShift (x10) to scale step value.");
135175
}
136176
}
137177
}

GITechDemo/Code/AppMain/GITechDemo/Resources/ArtistParametersDef.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ namespace GITechDemoApp
217217

218218
// Lens flare
219219
IMPLEMENT_ARTIST_PARAMETER("Lens flare enable", "Toggle the rendering of the lens flare effect", "Lens flare", LENS_FLARE_ENABLED, 1.f);
220+
IMPLEMENT_ARTIST_PARAMETER("Anamorphic lens flare", "Choose between anamorphic and spherical lens flare", "Lens flare", bAnamorphic.GetCurrentValue(), 1.f);
221+
IMPLEMENT_ARTIST_PARAMETER("Anamorphic intensity", "Adjust the intensity of the anamophic lens flares", "Lens flare", fAnamorphicIntensity.GetCurrentValue(), 1.f);
220222
IMPLEMENT_ARTIST_PARAMETER("Brigthness threshold", "Brightness threshold for lens flare feature generation", "Lens flare", LENS_FLARE_BRIGHTNESS_THRESHOLD, 0.1f);
221223
IMPLEMENT_ARTIST_PARAMETER("Ghost sample count", "Number of samples for \"ghost\" features", "Lens flare", nGhostSamples.GetCurrentValue(), 1.f);
222224
IMPLEMENT_ARTIST_PARAMETER("Ghost dispersion factor", "Dispersion factor (distance) for \"ghost\" features", "Lens flare", fGhostDispersal.GetCurrentValue(), 0.1f);

GITechDemo/Code/AppMain/GITechDemo/Resources/RenderResourcesDef.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,17 @@ namespace GITechDemoApp
137137
// Depth of field render targets
138138
IMPLEMENT_DYNAMIC_RENDER_TARGET(DepthOfFieldFullBuffer, 1, PF_A16B16G16R16F, PF_NONE, PF_NONE, PF_NONE, 1.f, 1.f, PF_NONE);
139139
IMPLEMENT_DYNAMIC_RENDER_TARGET(DepthOfFieldQuarterBuffer, 1, PF_A16B16G16R16F, PF_NONE, PF_NONE, PF_NONE, 0.5f, 0.5f, PF_NONE);
140-
IMPLEMENT_RENDER_TARGET(AutofocusBuffer0, 1, PF_R32F, PF_NONE, PF_NONE, PF_NONE, 1u, 1u, PF_NONE);
141-
IMPLEMENT_RENDER_TARGET(AutofocusBuffer1, 1, PF_R32F, PF_NONE, PF_NONE, PF_NONE, 1u, 1u, PF_NONE);
140+
IMPLEMENT_RENDER_TARGET(AutofocusBuffer0, 1, PF_R16F, PF_NONE, PF_NONE, PF_NONE, 1u, 1u, PF_NONE);
141+
IMPLEMENT_RENDER_TARGET(AutofocusBuffer1, 1, PF_R16F, PF_NONE, PF_NONE, PF_NONE, 1u, 1u, PF_NONE);
142142

143143
// Motion blur render target
144144
IMPLEMENT_DYNAMIC_RENDER_TARGET(MotionBlurBuffer, 1, PF_A16B16G16R16F, PF_NONE, PF_NONE, PF_NONE, 1.f, 1.f, PF_NONE);
145145

146146
// Lens flare render targets
147-
IMPLEMENT_DYNAMIC_RENDER_TARGET(LensFlareBuffer0, 1, PF_A16B16G16R16F, PF_NONE, PF_NONE, PF_NONE, 0.5f, 0.5f, PF_NONE);
148-
IMPLEMENT_DYNAMIC_RENDER_TARGET(LensFlareBuffer1, 1, PF_A16B16G16R16F, PF_NONE, PF_NONE, PF_NONE, 0.5f, 0.5f, PF_NONE);
147+
IMPLEMENT_DYNAMIC_RENDER_TARGET(SphericalLensFlareBuffer0, 1, PF_A16B16G16R16F, PF_NONE, PF_NONE, PF_NONE, 0.5f, 0.5f, PF_NONE);
148+
IMPLEMENT_DYNAMIC_RENDER_TARGET(SphericalLensFlareBuffer1, 1, PF_A16B16G16R16F, PF_NONE, PF_NONE, PF_NONE, 0.5f, 0.5f, PF_NONE);
149+
IMPLEMENT_DYNAMIC_RENDER_TARGET(AnamorphicLensFlareBuffer0, 1, PF_A16B16G16R16F, PF_NONE, PF_NONE, PF_NONE, 0.03125f, 1.f, PF_NONE);
150+
IMPLEMENT_DYNAMIC_RENDER_TARGET(AnamorphicLensFlareBuffer1, 1, PF_A16B16G16R16F, PF_NONE, PF_NONE, PF_NONE, 0.03125f, 1.f, PF_NONE);
149151

150152
// Arrays of render targets for easier handling
151153
RenderTarget* VolumetricLightFullBuffer[2] = {
@@ -188,9 +190,13 @@ namespace GITechDemoApp
188190
&AutofocusBuffer0,
189191
&AutofocusBuffer1
190192
};
191-
RenderTarget* LensFlareBuffer[2] = {
192-
&LensFlareBuffer0,
193-
&LensFlareBuffer1
193+
RenderTarget* SphericalLensFlareBuffer[2] = {
194+
&SphericalLensFlareBuffer0,
195+
&SphericalLensFlareBuffer1
196+
};
197+
RenderTarget* AnamorphicLensFlareBuffer[2] = {
198+
&AnamorphicLensFlareBuffer0,
199+
&AnamorphicLensFlareBuffer1
194200
};
195201
//------------------------------------------------------
196202

@@ -298,6 +304,8 @@ namespace GITechDemoApp
298304
IMPLEMENT_ARTIST_SHADER_CONSTANT(fShiftFactor, float, 1.f );
299305
IMPLEMENT_ARTIST_SHADER_CONSTANT(fLensDirtIntensity, float, 0.3f );
300306
IMPLEMENT_ARTIST_SHADER_CONSTANT(fLensStarBurstIntensity, float, 0.5f );
307+
IMPLEMENT_ARTIST_SHADER_CONSTANT(bAnamorphic, bool, true );
308+
IMPLEMENT_ARTIST_SHADER_CONSTANT(fAnamorphicIntensity, float, 10.f );
301309

302310
/* HUD parameters */
303311
IMPLEMENT_ARTIST_SHADER_CONSTANT(f3TextColor, Vec3f, Vec3f(1.f, 1.f, 1.f) );

GITechDemo/Code/AppMain/GITechDemo/Resources/RenderResourcesDef.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ namespace GITechDemoApp
101101
DECLARE_RENDER_TARGET(AutofocusBuffer0);
102102
DECLARE_RENDER_TARGET(AutofocusBuffer1);
103103
DECLARE_RENDER_TARGET(MotionBlurBuffer);
104-
DECLARE_RENDER_TARGET(LensFlareBuffer0);
105-
DECLARE_RENDER_TARGET(LensFlareBuffer1);
104+
DECLARE_RENDER_TARGET(SphericalLensFlareBuffer0);
105+
DECLARE_RENDER_TARGET(SphericalLensFlareBuffer1);
106+
DECLARE_RENDER_TARGET(AnamorphicLensFlareBuffer0);
107+
DECLARE_RENDER_TARGET(AnamorphicLensFlareBuffer1);
106108

107109
enum HDRDownsampleBufferIndex {
108110
QUARTER = 0,
@@ -118,7 +120,8 @@ namespace GITechDemoApp
118120
extern RenderTarget* SSAOQuarterBuffer[2];
119121
extern RenderTarget* AdaptedLuminance[2];
120122
extern RenderTarget* AutofocusBuffer[2];
121-
extern RenderTarget* LensFlareBuffer[2];
123+
extern RenderTarget* SphericalLensFlareBuffer[2];
124+
extern RenderTarget* AnamorphicLensFlareBuffer[2];
122125
//------------------------------------------------------
123126

124127
// Shader constants
@@ -282,6 +285,8 @@ namespace GITechDemoApp
282285
DECLARE_SHADER_CONSTANT(f3FogBox, Vec3f);
283286
DECLARE_SHADER_CONSTANT(f3FogSpeed, Vec3f);
284287
DECLARE_SHADER_CONSTANT(fFogVerticalFalloff, float);
288+
DECLARE_SHADER_CONSTANT(bAnamorphic, bool);
289+
DECLARE_SHADER_CONSTANT(fAnamorphicIntensity, float);
285290
//-------------------------------------------------------
286291
}
287292

GITechDemo/Data/shaders/BilateralBlur.hlsl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ const float fBlurDepthFalloff;
2929
// Number of samples on each side of the kernel
3030
#define NUM_SAMPLES_HALF (7)
3131

32-
static const float fGaussianFilterWeight[] =
33-
{
34-
0.14446445f, 0.13543542f,
35-
0.11153505f, 0.08055309f,
36-
0.05087564f, 0.02798160f,
37-
0.01332457f, 0.00545096f
38-
};
39-
4032
void psmain(VSOut input, out float4 f4Color : SV_TARGET)
4133
{
34+
const float fGaussianFilterWeight[] =
35+
{
36+
0.14446445f, 0.13543542f,
37+
0.11153505f, 0.08055309f,
38+
0.05087564f, 0.02798160f,
39+
0.01332457f, 0.00545096f
40+
};
41+
4242
f4Color = float4(0.f, 0.f, 0.f, 1.f);
4343
float fTotalWeight = 0.f;
4444

0 commit comments

Comments
 (0)