/
deferred.pipeline.xml
120 lines (104 loc) · 5.16 KB
/
deferred.pipeline.xml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!-- Deferred Shading Pipeline -->
<Pipeline>
<Setup>
<RenderTarget id="GBUFFER" depthBuf="true" numColBufs="4" format="RGBA16F" scale="1.0"/>
<RenderTarget id="MBUFF" depthBuf="true" numColBufs="1" format="RGBA16F" scale="1.0"/>
<RenderTarget id="BLURBUF1" depthBuf="false" numColBufs="1" format="RGBA8" scale="0.5"/>
<RenderTarget id="BLURBUF2" depthBuf="false" numColBufs="1" format="RGBA8" scale="0.5"/>
<RenderTarget id="FINALIMAGE" depthBuf="false" numColBufs="1" format="RGBA16F" scale="1.0"/>
<RenderTarget id="OUTLINE" depthBuf="false" numColBufs="1" format="RGBA8" scale="1.0"/>
<RenderTarget id="SSAOBUF" depthBuf="false" numColBufs="1" format="RGBA8" scale="0.25" />
<RenderTarget id="SSAOBLUR" depthBuf="false" numColBufs="1" format="RGBA8" scale="1.0" />
<RenderTarget id="TEMPSSAOBLUR" depthBuf="false" numColBufs="1" format="RGBA8" scale="1.0" />
</Setup>
<CommandQueue>
<Stage id="Attribpass">
<SwitchTarget target="GBUFFER" />
<ClearTarget depthBuf="true" colBuf0="true" />
<DrawGeometry context="ATTRIBPASS" />
</Stage>
<Stage id="Lighting" link="pipelines/globalSettings.material.xml">
<SwitchTarget target="MBUFF" />
<!-- Copy depth buffer to allow occlusion culling of lights -->
<BindBuffer sampler="depthBuf" sourceRT="GBUFFER" bufIndex="32" />
<DrawQuad material="materials/light.material.xml" context="COPY_DEPTH" />
<UnbindBuffers />
<BindBuffer sampler="gbuf0" sourceRT="GBUFFER" bufIndex="0" />
<BindBuffer sampler="gbuf1" sourceRT="GBUFFER" bufIndex="1" />
<BindBuffer sampler="gbuf2" sourceRT="GBUFFER" bufIndex="2" />
<BindBuffer sampler="gbuf3" sourceRT="GBUFFER" bufIndex="3" />
<DrawQuad material="materials/light.material.xml" context="AMBIENT" />
<DoDeferredLightLoop />
<UnbindBuffers />
</Stage>
<Stage id="BrightPass">
<SwitchTarget target="BLURBUF1" />
<BindBuffer sampler="buf0" sourceRT="MBUFF" bufIndex="0" />
<DrawQuad material="pipelines/postHDR.material.xml" context="BRIGHTPASS" />
<UnbindBuffers />
</Stage>
<Stage id="Bloom">
<SwitchTarget target="BLURBUF2" />
<BindBuffer sampler="buf0" sourceRT="BLURBUF1" bufIndex="0" />
<SetUniform material="pipelines/postHDR.material.xml" uniform="blurParams" a="0.0" />
<DrawQuad material="pipelines/postHDR.material.xml" context="BLUR" />
<witchTarget target="BLURBUF1" />
<BindBuffer sampler="buf0" sourceRT="BLURBUF2" bufIndex="0" />
<SetUniform material="pipelines/postHDR.material.xml" uniform="blurParams" a="1.0" />
<DrawQuad material="pipelines/postHDR.material.xml" context="BLUR" />
<SwitchTarget target="BLURBUF2" />
<BindBuffer sampler="buf0" sourceRT="BLURBUF1" bufIndex="0" />
<SetUniform material="pipelines/postHDR.material.xml" uniform="blurParams" a="2.0" />
<DrawQuad material="pipelines/postHDR.material.xml" context="BLUR" />
<SwitchTarget target="BLURBUF1" />
<BindBuffer sampler="buf0" sourceRT="BLURBUF2" bufIndex="0" />
<SetUniform material="pipelines/postHDR.material.xml" uniform="blurParams" a="3.0" />
<DrawQuad material="pipelines/postHDR.material.xml" context="BLUR" />
<UnbindBuffers />
</Stage>
<Stage id="Outline">
<SwitchTarget target="OUTLINE" />
<BindBuffer sampler="depthBuf" sourceRT="GBUFFER" bufIndex="32" />
<DrawQuad material="materials/light.material.xml" context="COPY_DEPTH" />
<UnbindBuffers />
<DrawQuad material="pipelines/outline.material.xml" context="OUTLINE" />
<UnbindBuffers />
</Stage>
<Stage id="SSAO">
<SwitchTarget target="SSAOBUF" />
<BindBuffer sampler="gbuf0" sourceRT="GBUFFER" bufIndex="0" />
<BindBuffer sampler="gbuf1" sourceRT="GBUFFER" bufIndex="1" />
<DrawQuad material="pipelines/ssao.material.xml" context="SSAO"/>
<UnbindBuffers />
</Stage>
<Stage id="blurSSAO" >
<SwitchTarget target="TEMPSSAOBLUR" />
<BindBuffer sampler="buf0" sourceRT="SSAOBUF" bufIndex="0" />
<DrawQuad material="pipelines/ssao.material.xml" context="VERTICALBLUR" />
<UnbindBuffers />
<SwitchTarget target="SSAOBLUR" />
<BindBuffer sampler="buf0" sourceRT="TEMPSSAOBLUR" bufIndex="0" />
<DrawQuad material="pipelines/ssao.material.xml" context="HORIZONTALBLUR" />
<UnbindBuffers />
</Stage>
<Stage id="Combination">
<SwitchTarget target="FINALIMAGE" />
<ClearTarget colBuf0="true" />
<BindBuffer sampler="buf0" sourceRT="MBUFF" bufIndex="0" />
<BindBuffer sampler="buf1" sourceRT="BLURBUF1" bufIndex="0" />
<BindBuffer sampler="buf2" sourceRT="OUTLINE" bufIndex="0" />
<BindBuffer sampler="buf3" sourceRT="SSAOBLUR" bufIndex="0" />
<DrawQuad material="pipelines/outline.material.xml" context="FINALPASS" />
<UnbindBuffers />
</Stage>
<Stage id="FXAA">
<SwitchTarget target=""/>
<BindBuffer sampler="buf0" sourceRT="FINALIMAGE" bufIndex="0" />
<DrawQuad material="pipelines/outline.material.xml" context="FXAA" />
<UnbindBuffers />
</Stage>
<Stage id="Overlays">
<DrawOverlays context="OVERLAY" />
</Stage>
</CommandQueue>
</Pipeline>