-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeferredRenderer.h
60 lines (52 loc) · 1.35 KB
/
DeferredRenderer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
#include "CommonD.h"
#include "VolumetricClouds.h"
#include "PostProcessing.h"
#include "PixelShader.h"
#include "VolumetricLight.h"
#include "AmbientOcclusion.h"
#include "RenderTarget.h"
#include "SamplerState.h"
enum RenderingStage
{
stageDeferred,
stageForward,
stageDualParaboloidMap,
stageSphereMap,
stageReflectionCubemap,
stageReflection,
stageRefraction,
stageCascadeShadow,
stagePointShadow,
stageSpotShadow
}extern gRenderState;
class DeferredRendering
{
public:
SamplerState mShadowSampler;
SamplerState mDefaultSampler;
unique_ptr<PostProcessing> mPostProcessing;
unique_ptr<RenderTarget> mScreenRT;
unique_ptr<RenderTarget> mGraphicsLight;
unique_ptr<RenderTarget> mGraphicsBuffer[5];
void Start();
void Stop();
void RenderPostProcessing();
void Initialize();
void UpdateImgui();
void UpdateTextures();
private:
unique_ptr<PixelShader> mDirectLightPS;
unique_ptr<PixelShader> mCombineLightPS;
unique_ptr<PixelShader> mAtmosphereScaterringPS;
unique_ptr<PixelShader> mPointLightPS;
unique_ptr<PixelShader> mSpotLightPS;
unique_ptr<VolumetricClouds> mVolumetricClouds;
unique_ptr<VolumetricLight> mVolumetricLight;
unique_ptr<AmbientOcclusion> mAmbientOcclusion;
void RenderLights();
void RenderPointAndSpotLight();
void RenderFinalPass();
void AtmosphericScattering();
};
extern DeferredRendering *DeferredContext;