MCPcopy Create free account
hub / github.com/TheRealMJP/BakingLab / Initialize

Method Initialize

BakingLab/PostProcessor.cpp:25–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23static const uint32 LumMapSize = 1024;
24
25void PostProcessor::Initialize(ID3D11Device* device)
26{
27 PostProcessorBase::Initialize(device);
28
29 constantBuffer.Initialize(device);
30
31 // Load the shaders
32 toneMap = CompilePSFromFile(device, L"ToneMapping.hlsl", "ToneMap");
33 scale = CompilePSFromFile(device, L"PostProcessing.hlsl", "Scale");
34 blurH = CompilePSFromFile(device, L"PostProcessing.hlsl", "BlurH");
35 blurV = CompilePSFromFile(device, L"PostProcessing.hlsl", "BlurV");
36 bloom = CompilePSFromFile(device, L"PostProcessing.hlsl", "Bloom");
37
38 CompileOptions opts;
39 opts.Add("MSAA_", 0);
40 dofDownscale[0] = CompilePSFromFile(device, L"PostProcessing.hlsl", "DOFDownscale", "ps_5_0", opts);
41
42 opts.Reset();
43 opts.Add("MSAA_", 1);
44 dofDownscale[1] = CompilePSFromFile(device, L"PostProcessing.hlsl", "DOFDownscale", "ps_5_0", opts);
45
46 dilateNearMask = CompilePSFromFile(device, L"PostProcessing.hlsl", "DilateNearMask");
47 nearMaskBlurH = CompilePSFromFile(device, L"PostProcessing.hlsl", "NearMaskBlurH");
48 nearMaskBlurV = CompilePSFromFile(device, L"PostProcessing.hlsl", "NearMaskBlurV");
49
50 opts.Reset();
51 opts.Add("MSAA_", 0);
52 dofComposite[0] = CompilePSFromFile(device, L"PostProcessing.hlsl", "DOFComposite", "ps_5_0", opts);
53
54 opts.Reset();
55 opts.Add("MSAA_", 1);
56 dofComposite[1] = CompilePSFromFile(device, L"PostProcessing.hlsl", "DOFComposite", "ps_5_0", opts);
57
58 floodFillDOF = CompilePSFromFile(device, L"PostProcessing.hlsl", "FloodFillDOF");
59 kernelGatherDOF = CompilePSFromFile(device, L"PostProcessing.hlsl", "KernelGatherDOF");
60
61 opts.Reset();
62 opts.Add("TGSize_", 16);
63 computeNearMask16 = CompileCSFromFile(device, L"ComputeNearMask.hlsl", "ComputeNearMask", "cs_5_0", opts);
64
65 reduceLuminanceInitial = CompileCSFromFile(device, L"LuminanceReduction.hlsl",
66 "LuminanceReductionInitialCS", "cs_5_0");
67 reduceLuminance = CompileCSFromFile(device, L"LuminanceReduction.hlsl", "LuminanceReductionCS");
68
69 opts.Reset();
70 opts.Add("FinalPass_", 1);
71 reduceLuminanceFinal = CompileCSFromFile(device, L"LuminanceReduction.hlsl", "LuminanceReductionCS",
72 "cs_5_0", opts);
73}
74
75void PostProcessor::AfterReset(uint32 width, uint32 height)
76{

Callers 1

AfterResetMethod · 0.45

Calls 5

InitializeFunction · 0.85
CompilePSFromFileFunction · 0.85
CompileCSFromFileFunction · 0.85
AddMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected