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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
|
/*
* Copyright 2018 Eric Arnebäck. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
/*
* Reference(s):
* - Next Generation Post Processing in Call of Duty: Advanced Warfare
* https://web.archive.org/web/20180920045230/http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare
*/
#include "common.h"
#include "bgfx_utils.h"
#include "imgui/imgui.h"
#include "camera.h"
#include "bounds.h"
namespace
{
// pass that render the geometry of the boxes.
#define RENDER_PASS_GEOMETRY_ID 0
// the first downsample pass.
#define RENDER_PASS_DOWNSAMPLE0_ID 1
// the first upsample pass.
#define RENDER_PASS_UPSAMPLE0_ID ( (TEX_CHAIN_LEN-1) + 1)
// the final pass the combines the bloom with the g-buffer.
#define RENDER_PASS_COMBINE_ID ( (TEX_CHAIN_LEN-1) + 1 + (TEX_CHAIN_LEN-1) )
// number of downsampled and then upsampled textures(used for bloom.)
#define TEX_CHAIN_LEN 5
static float s_texelHalf = 0.0f;
struct PosVertex
{
float m_x;
float m_y;
float m_z;
static void init()
{
ms_layout
.begin()
.add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
.end();
}
static bgfx::VertexLayout ms_layout;
};
bgfx::VertexLayout PosVertex::ms_layout;
struct PosTexCoord0Vertex
{
float m_x;
float m_y;
float m_z;
float m_u;
float m_v;
static void init()
{
ms_layout
.begin()
.add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
.add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
.end();
}
static bgfx::VertexLayout ms_layout;
};
bgfx::VertexLayout PosTexCoord0Vertex::ms_layout;
constexpr float cs = 0.29f;
static PosVertex s_cubeVertices[24] =
{
{-cs, cs, cs },
{ cs, cs, cs },
{-cs, -cs, cs },
{ cs, -cs, cs },
{-cs, cs, -cs },
{ cs, cs, -cs },
{-cs, -cs, -cs },
{ cs, -cs, -cs },
{-cs, cs, cs },
{ cs, cs, cs },
{-cs, cs, -cs },
{ cs, cs, -cs },
{-cs, -cs, cs },
{ cs, -cs, cs },
{-cs, -cs, -cs },
{ cs, -cs, -cs },
{ cs, -cs, cs },
{ cs, cs, cs },
{ cs, -cs, -cs },
{ cs, cs, -cs },
{-cs, -cs, cs },
{-cs, cs, cs },
{-cs, -cs, -cs },
{-cs, cs, -cs },
};
static const uint16_t s_cubeIndices[36] =
{
0, 2, 1,
1, 2, 3,
4, 5, 6,
5, 7, 6,
8, 10, 9,
9, 10, 11,
12, 13, 14,
13, 15, 14,
16, 18, 17,
17, 18, 19,
20, 21, 22,
21, 23, 22,
};
void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f)
{
if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout) )
{
bgfx::TransientVertexBuffer vb;
bgfx::allocTransientVertexBuffer(&vb, 3, PosTexCoord0Vertex::ms_layout);
PosTexCoord0Vertex* vertex = (PosTexCoord0Vertex*)vb.data;
const float minx = -_width;
const float maxx = _width;
const float miny = 0.0f;
const float maxy = _height*2.0f;
const float texelHalfW = _texelHalf/_textureWidth;
const float texelHalfH = _texelHalf/_textureHeight;
const float minu = -1.0f + texelHalfW;
const float maxu = 1.0f + texelHalfH;
const float zz = 0.0f;
float minv = texelHalfH;
float maxv = 2.0f + texelHalfH;
if (_originBottomLeft)
{
float temp = minv;
minv = maxv;
maxv = temp;
minv -= 1.0f;
maxv -= 1.0f;
}
vertex[0].m_x = minx;
vertex[0].m_y = miny;
vertex[0].m_z = zz;
vertex[0].m_u = minu;
vertex[0].m_v = minv;
vertex[1].m_x = maxx;
vertex[1].m_y = miny;
vertex[1].m_z = zz;
vertex[1].m_u = maxu;
vertex[1].m_v = minv;
vertex[2].m_x = maxx;
vertex[2].m_y = maxy;
vertex[2].m_z = zz;
vertex[2].m_u = maxu;
vertex[2].m_v = maxv;
bgfx::setVertexBuffer(0, &vb);
}
}
class ExampleDeferred : public entry::AppI
{
public:
ExampleDeferred(const char* _name, const char* _description, const char* _url)
: entry::AppI(_name, _description, _url)
{
}
void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) override
{
Args args(_argc, _argv);
m_width = _width;
m_height = _height;
m_debug = BGFX_DEBUG_TEXT;
m_reset = BGFX_RESET_VSYNC;
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
bgfx::init(init);
// Enable m_debug text.
bgfx::setDebug(m_debug);
// Set palette color for index 0
bgfx::setPaletteColor(0, UINT32_C(0x00000000) );
// Set geometry pass view clear state.
bgfx::setViewClear(RENDER_PASS_GEOMETRY_ID
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 1.0f
, 0
, 0
, 0
);
// we need to clear the textures in the chain, before downsampling into them.
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN-1; ++ii)
{
bgfx::setViewClear(RENDER_PASS_DOWNSAMPLE0_ID + ii
, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
, 1.0f
, 0
, 0
);
}
// Create vertex stream declaration.
PosVertex::init();
PosTexCoord0Vertex::init();
// Create static vertex buffer.
m_vbh = bgfx::createVertexBuffer(
bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) )
, PosVertex::ms_layout
);
m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) );
s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Sampler);
s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Sampler);
s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Sampler);
s_light = bgfx::createUniform("s_light", bgfx::UniformType::Sampler);
u_pixelSize = bgfx::createUniform("u_pixelSize", bgfx::UniformType::Vec4);
u_intensity = bgfx::createUniform("u_intensity", bgfx::UniformType::Vec4);
u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4);
u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
// Create program from shaders.
m_geomProgram = loadProgram("vs_albedo_output", "fs_albedo_output");
m_downsampleProgram = loadProgram("vs_fullscreen", "fs_downsample");
m_upsampleProgram = loadProgram("vs_fullscreen", "fs_upsample");
m_combineProgram = loadProgram("vs_fullscreen", "fs_bloom_combine");
m_gbuffer = BGFX_INVALID_HANDLE;
for (int ii = 0; ii < TEX_CHAIN_LEN; ++ii)
{
m_texChainFb[ii] = BGFX_INVALID_HANDLE;
}
// Imgui.
imguiCreate();
m_timeOffset = bx::getHPCounter();
const bgfx::RendererType::Enum renderer = bgfx::getRendererType();
s_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f;
// Get renderer capabilities info.
m_caps = bgfx::getCaps();
m_oldWidth = 0;
m_oldHeight = 0;
m_oldReset = m_reset;
m_scrollArea = 0;
cameraCreate();
cameraSetPosition({ 0.0f, 0.0f, -15.0f });
cameraSetVerticalAngle(0.0f);
}
virtual int shutdown() override
{
// Cleanup.
cameraDestroy();
imguiDestroy();
if (bgfx::isValid(m_gbuffer) )
{
bgfx::destroy(m_gbuffer);
}
for (int ii = 0; ii < TEX_CHAIN_LEN; ++ii)
{
bgfx::destroy(m_texChainFb[ii]);
}
bgfx::destroy(m_ibh);
bgfx::destroy(m_vbh);
bgfx::destroy(m_geomProgram);
bgfx::destroy(m_downsampleProgram);
bgfx::destroy(m_upsampleProgram);
bgfx::destroy(m_combineProgram);
bgfx::destroy(s_albedo);
bgfx::destroy(s_tex);
bgfx::destroy(s_depth);
bgfx::destroy(s_light);
bgfx::destroy(u_mtx);
bgfx::destroy(u_pixelSize);
bgfx::destroy(u_intensity);
bgfx::destroy(u_color);
// Shutdown bgfx.
bgfx::shutdown();
return 0;
}
bool update() override
{
if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
{
imguiBeginFrame(
m_mouseState.m_mx
, m_mouseState.m_my
, (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
| (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
| (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
, m_mouseState.m_mz
, uint16_t(m_width)
, uint16_t(m_height)
);
showExampleDialog(this);
int64_t now = bx::getHPCounter();
static int64_t last = now;
const int64_t frameTime = now - last;
last = now;
const double freq = double(bx::getHPFrequency() );
const float deltaTime = float(frameTime/freq);
float time = (float)( (now-m_timeOffset)/freq);
if (2 > m_caps->limits.maxFBAttachments)
{
// When multiple render targets (MRT) is not supported by GPU,
// implement alternative code path that doesn't use MRT.
bool blink = uint32_t(time*3.0f)&1;
bgfx::dbgTextPrintf(0, 0, blink ? 0x4f : 0x04, " MRT not supported by GPU. ");
// Set view 0 default viewport.
bgfx::setViewRect(0, 0, 0, uint16_t(m_width), uint16_t(m_height) );
// This dummy draw call is here to make sure that view 0 is cleared
// if no other draw calls are submitted to view 0.
bgfx::touch(0);
}
else
{
if (m_oldWidth != m_width
|| m_oldHeight != m_height
|| m_oldReset != m_reset
|| !bgfx::isValid(m_gbuffer) )
{
// Recreate variable size render targets when resolution changes.
m_oldWidth = m_width;
m_oldHeight = m_height;
m_oldReset = m_reset;
if (bgfx::isValid(m_gbuffer) )
{
bgfx::destroy(m_gbuffer);
}
const uint64_t tsFlags = 0
| BGFX_TEXTURE_RT
| BGFX_SAMPLER_U_CLAMP
| BGFX_SAMPLER_V_CLAMP
;
for (int ii = 0; ii < TEX_CHAIN_LEN; ++ii)
{
if (bgfx::isValid(m_texChainFb[ii]) )
{
bgfx::destroy(m_texChainFb[ii]);
}
const float dim = float(1 << ii);
m_texChainFb[ii] = bgfx::createFrameBuffer(
(uint16_t)(m_width / dim)
, (uint16_t)(m_height / dim)
, bgfx::TextureFormat::RGBA32F
, tsFlags
);
}
bgfx::TextureHandle gbufferTex[] =
{
bgfx::createTexture2D(uint16_t(m_width), uint16_t(m_height), false, 1, bgfx::TextureFormat::RGBA32F, tsFlags),
bgfx::getTexture(m_texChainFb[0]),
bgfx::createTexture2D(uint16_t(m_width), uint16_t(m_height), false, 1, bgfx::TextureFormat::D24S8, tsFlags),
};
m_gbuffer = bgfx::createFrameBuffer(BX_COUNTOF(gbufferTex), gbufferTex, true);
}
ImGui::SetNextWindowPos(
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
, ImGuiCond_FirstUseEver
);
ImGui::SetNextWindowSize(
ImVec2(m_width / 5.0f, m_height / 6.0f)
, ImGuiCond_FirstUseEver
);
ImGui::Begin("Settings"
, NULL
, 0
);
ImGui::SliderFloat("intensity", &m_intensity, 0.0f, 3.0f);
ImGui::End();
// Update camera.
cameraUpdate(deltaTime, m_mouseState);
float view[16];
cameraGetViewMtx(view);
float proj[16];
// Setup views
{
bgfx::setViewRect(RENDER_PASS_GEOMETRY_ID, 0, 0, uint16_t(m_width), uint16_t(m_height) );
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN-1; ++ii)
{
const float dim = float(1 << (ii + 1) );
bgfx::setViewRect(RENDER_PASS_DOWNSAMPLE0_ID + ii, 0, 0
, uint16_t(m_width / dim)
, uint16_t(m_height / dim)
);
}
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN-1; ++ii)
{
const float dim = float(1 << (TEX_CHAIN_LEN - ii - 2) );
bgfx::setViewRect(RENDER_PASS_UPSAMPLE0_ID + ii, 0, 0
, uint16_t(m_width / dim)
, uint16_t(m_height / dim)
);
}
bx::mtxProj(proj, 60.0f, float(m_width) / float(m_height), 0.1f, 100.0f, m_caps->homogeneousDepth);
bgfx::setViewFrameBuffer(RENDER_PASS_GEOMETRY_ID, m_gbuffer);
bgfx::setViewTransform(RENDER_PASS_GEOMETRY_ID, view, proj);
bgfx::setViewRect(RENDER_PASS_COMBINE_ID, 0, 0, uint16_t(m_width), uint16_t(m_height));
bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f, 0.0f, m_caps->homogeneousDepth);
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN-1; ++ii)
{
bgfx::setViewTransform(RENDER_PASS_DOWNSAMPLE0_ID + ii, NULL, proj);
bgfx::setViewFrameBuffer(RENDER_PASS_DOWNSAMPLE0_ID + ii, m_texChainFb[ii+1]);
}
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN-1; ++ii)
{
bgfx::setViewTransform(RENDER_PASS_UPSAMPLE0_ID + ii, NULL, proj);
bgfx::setViewFrameBuffer(RENDER_PASS_UPSAMPLE0_ID + ii, m_texChainFb[TEX_CHAIN_LEN - ii - 2]);
}
bgfx::setViewTransform(RENDER_PASS_COMBINE_ID, NULL, proj);
}
const uint32_t kNum = 9;
const int kNumColors = 5;
const float color[4*kNumColors] =
{ // Reference(s):
// - Palette
// https://web.archive.org/web/20180219034657/http://www.colourlovers.com/palette/3647908/RGB_Ice_Cream
0.847f*0.2f, 0.365f*0.2f, 0.408f*0.2f, 1.0f,
0.976f*0.2f, 0.827f*0.2f, 0.533f*0.2f, 1.0f,
0.533f*0.2f, 0.867f*0.2f, 0.741f*0.2f, 1.0f,
0.894f*0.2f, 0.620f*0.2f, 0.416f*0.2f, 1.0f,
0.584f*0.2f, 0.788f*0.2f, 0.882f*0.2f, 1.0f,
};
// Render a whole bunch of colored cubes to the g-buffer.
for (uint32_t xx = 0; xx < kNum; ++xx)
{
bgfx::setUniform(u_color, &color[4 * (xx % kNumColors)]);
float mtx[16];
bx::mtxIdentity(mtx);
const float tt = (float)xx / (float)kNum + 0.07f * time;
const float rr = bx::sin(0.47f * time * bx::kPi2) + 1.4f;
mtx[12] = bx::sin(tt * bx::kPi2)*rr;
mtx[13] = bx::cos(tt * bx::kPi2)*rr;
mtx[14] = 0.2f * (float)xx / (float)kNum;
// Set transform for draw call.
bgfx::setTransform(mtx);
// Set vertex and index buffer.
bgfx::setVertexBuffer(0, m_vbh);
bgfx::setIndexBuffer(m_ibh);
// Set render states.
bgfx::setState(0
| BGFX_STATE_WRITE_RGB
| BGFX_STATE_WRITE_A
| BGFX_STATE_WRITE_Z
| BGFX_STATE_DEPTH_TEST_LESS
| BGFX_STATE_MSAA
);
// Submit primitive for rendering to view 0.
bgfx::submit(RENDER_PASS_GEOMETRY_ID, m_geomProgram);
}
// Now downsample.
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN-1; ++ii)
{
const float dim = float(1 << (ii + 1) );
const float pixelSize[4] =
{
1.0f / (m_width / dim),
1.0f / (m_height / dim),
0.0f,
0.0f,
};
bgfx::setUniform(u_pixelSize, pixelSize);
bgfx::setTexture(0, s_tex, bgfx::getTexture(m_texChainFb[ii]) );
bgfx::setState(0
| BGFX_STATE_WRITE_RGB
| BGFX_STATE_WRITE_A
);
screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft);
bgfx::submit(RENDER_PASS_DOWNSAMPLE0_ID + ii, m_downsampleProgram);
}
// Now upsample.
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN - 1; ++ii)
{
const float dim = float(1 << (TEX_CHAIN_LEN - 2 - ii) );
const float pixelSize[4] =
{
1.0f / (float)(m_width / dim),
1.0f / (float)(m_height / dim),
0.0f,
0.0f,
};
const float intensity[4] = { m_intensity, 0.0f, 0.0f, 0.0f };
bgfx::setUniform(u_pixelSize, pixelSize);
bgfx::setUniform(u_intensity, intensity);
// Combine color and light buffers.
bgfx::setTexture(0, s_tex, bgfx::getTexture(m_texChainFb[TEX_CHAIN_LEN - 1 - ii]) );
// As we upscale, we also sum with the previous mip level. We do this by alpha blending.
bgfx::setState(0
| BGFX_STATE_WRITE_RGB
| BGFX_STATE_WRITE_A
| BGFX_STATE_BLEND_ADD
);
screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft);
bgfx::submit(RENDER_PASS_UPSAMPLE0_ID + ii, m_upsampleProgram);
}
// Do final pass, that combines the bloom with the g-buffer.
bgfx::setTexture(0, s_albedo, bgfx::getTexture(m_gbuffer, 0) );
bgfx::setTexture(1, s_light, bgfx::getTexture(m_texChainFb[0]) );
bgfx::setState(0
| BGFX_STATE_WRITE_RGB
| BGFX_STATE_WRITE_A
);
screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft);
bgfx::submit(RENDER_PASS_COMBINE_ID, m_combineProgram);
}
imguiEndFrame();
// Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx::frame();
return true;
}
return false;
}
bgfx::VertexBufferHandle m_vbh;
bgfx::IndexBufferHandle m_ibh;
bgfx::UniformHandle s_albedo;
bgfx::UniformHandle s_tex;
bgfx::UniformHandle s_depth;
bgfx::UniformHandle s_light;
bgfx::UniformHandle u_pixelSize;
bgfx::UniformHandle u_intensity;
bgfx::UniformHandle u_color;
bgfx::UniformHandle u_mtx;
bgfx::ProgramHandle m_geomProgram;
bgfx::ProgramHandle m_downsampleProgram;
bgfx::ProgramHandle m_upsampleProgram;
bgfx::ProgramHandle m_combineProgram;
bgfx::FrameBufferHandle m_gbuffer;
bgfx::FrameBufferHandle m_texChainFb[TEX_CHAIN_LEN];
uint32_t m_width;
uint32_t m_height;
uint32_t m_debug;
uint32_t m_reset;
float m_intensity = 1.0f;
uint32_t m_oldWidth;
uint32_t m_oldHeight;
uint32_t m_oldReset;
int32_t m_scrollArea;
entry::MouseState m_mouseState;
const bgfx::Caps* m_caps;
int64_t m_timeOffset;
};
} // namespace
ENTRY_IMPLEMENT_MAIN(
ExampleDeferred
, "38-bloom"
, "Bloom."
, "https://bkaradzic.github.io/bgfx/examples.html#bloom"
);
|