TDME2
1.9.121
Toggle main menu visibility
Main Page
Related Pages
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
a
b
c
e
f
g
i
l
m
n
r
s
t
u
v
Enumerator
a
b
c
e
f
g
i
k
l
m
n
o
r
s
t
v
Related Functions
a
b
c
e
f
g
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Files
File List
File Members
All
a
b
c
e
f
g
k
m
o
p
r
s
t
Functions
c
g
m
o
p
r
s
t
Variables
Macros
a
b
c
e
f
g
k
m
p
s
t
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
tdme
engine
subsystems
postprocessing
PostProcessing.cpp
Go to the documentation of this file.
1
#include <map>
2
#include <string>
3
4
using
std::map;
5
using
std::string;
6
7
#include <
tdme/engine/subsystems/postprocessing/PostProcessing.h
>
8
9
#include <
tdme/tdme.h
>
10
#include <
tdme/engine/model/Color4.h
>
11
#include <
tdme/engine/subsystems/postprocessing/PostProcessingProgram.h
>
12
#include <
tdme/engine/subsystems/rendering/EntityRenderer.h
>
13
14
using
tdme::engine::subsystems::postprocessing::PostProcessing
;
15
16
using
tdme::engine::model::Color4
;
17
using
tdme::engine::subsystems::postprocessing::PostProcessingProgram
;
18
using
tdme::engine::subsystems::rendering::EntityRenderer
;
19
20
PostProcessing::PostProcessing() {
21
{
22
auto
program =
new
PostProcessingProgram
(
PostProcessingProgram::RENDERPASS_FINAL
);
23
program->addPostProcessingStep(
"depth_blur"
,
PostProcessingProgram::FRAMEBUFFERSOURCE_SCREEN
,
PostProcessingProgram::FRAMEBUFFERTARGET_SCREEN
);
24
if
(program->isSupported() ==
true
) {
25
programs
[
"depth_blur"
] = program;
26
}
else
{
27
delete
program;
28
}
29
30
}
31
{
32
auto
program =
new
PostProcessingProgram
(
PostProcessingProgram::RENDERPASS_FINAL
);
33
program->addPostProcessingStep(
"desaturation"
,
PostProcessingProgram::FRAMEBUFFERSOURCE_SCREEN
,
PostProcessingProgram::FRAMEBUFFERTARGET_SCREEN
);
34
if
(program->isSupported() ==
true
) {
35
programs
[
"desaturation"
] = program;
36
}
else
{
37
delete
program;
38
}
39
40
}
41
{
42
auto
program =
new
PostProcessingProgram
(
PostProcessingProgram::RENDERPASS_OBJECTS
);
43
program->addPostProcessingStep(
"ssao_map"
,
PostProcessingProgram::FRAMEBUFFERSOURCE_SCREEN
,
PostProcessingProgram::FRAMEBUFFERTARGET_TEMPORARY
);
44
program->addPostProcessingStep(
"ssao"
,
PostProcessingProgram::FRAMEBUFFERSOURCE_SCREEN
,
PostProcessingProgram::FRAMEBUFFERTARGET_SCREEN
,
true
);
45
if
(program->isSupported() ==
true
) {
46
programs
[
"ssao"
] = program;
47
}
else
{
48
delete
program;
49
}
50
}
51
{
52
auto
program =
new
PostProcessingProgram
(
PostProcessingProgram::RENDERPASS_FINAL
);
53
program->addEffectPass(
54
Engine::EFFECTPASS_LIGHTSCATTERING
,
55
2,
56
2,
57
"ls_"
,
58
false
,
59
false
,
60
false
,
61
EntityRenderer::RENDERTYPE_TEXTUREARRAYS_DIFFUSEMASKEDTRANSPARENCY |
62
EntityRenderer::RENDERTYPE_MATERIALS_DIFFUSEMASKEDTRANSPARENCY |
63
EntityRenderer::RENDERTYPE_TEXTURES_DIFFUSEMASKEDTRANSPARENCY,
64
Color4
(1.0f, 1.0f, 1.0f, 0.0f),
65
true
,
66
true
67
);
68
program->addPostProcessingStep(
69
"light_scattering"
,
70
PostProcessingProgram::FRAMEBUFFERSOURCE_EFFECTPASS0
,
71
PostProcessingProgram::FRAMEBUFFERTARGET_SCREEN
,
72
false
,
73
PostProcessingProgram::FRAMEBUFFERSOURCE_SCREEN
74
);
75
if
(program->isSupported() ==
true
) {
76
programs
[
"light_scattering"
] = program;
77
}
else
{
78
delete
program;
79
}
80
}
81
{
82
auto
program =
new
PostProcessingProgram
(
PostProcessingProgram::RENDERPASS_FINAL
);
83
program->addPostProcessingStep(
"vignette"
,
PostProcessingProgram::FRAMEBUFFERSOURCE_SCREEN
,
PostProcessingProgram::FRAMEBUFFERTARGET_SCREEN
);
84
if
(program->isSupported() ==
true
) {
85
programs
[
"vignette"
] = program;
86
}
else
{
87
delete
program;
88
}
89
90
}
91
}
92
93
PostProcessingProgram
*
PostProcessing::getPostProcessingProgram
(
const
string
& programId) {
94
auto
programIt =
programs
.find(programId);
95
return
programIt ==
programs
.end()?
nullptr
:programIt->second;
96
}
97
98
Color4.h
EntityRenderer.h
PostProcessingProgram.h
PostProcessing.h
tdme::engine::Engine::EFFECTPASS_LIGHTSCATTERING
@ EFFECTPASS_LIGHTSCATTERING
Definition:
Engine.h:172
tdme::engine::model::Color4
Color 4 definition.
Definition:
Color4.h:20
tdme::engine::subsystems::postprocessing::PostProcessingProgram
Post processing program.
Definition:
PostProcessingProgram.h:21
tdme::engine::subsystems::postprocessing::PostProcessingProgram::RENDERPASS_OBJECTS
@ RENDERPASS_OBJECTS
Definition:
PostProcessingProgram.h:25
tdme::engine::subsystems::postprocessing::PostProcessingProgram::RENDERPASS_FINAL
@ RENDERPASS_FINAL
Definition:
PostProcessingProgram.h:25
tdme::engine::subsystems::postprocessing::PostProcessingProgram::FRAMEBUFFERTARGET_TEMPORARY
@ FRAMEBUFFERTARGET_TEMPORARY
Definition:
PostProcessingProgram.h:27
tdme::engine::subsystems::postprocessing::PostProcessingProgram::FRAMEBUFFERTARGET_SCREEN
@ FRAMEBUFFERTARGET_SCREEN
Definition:
PostProcessingProgram.h:27
tdme::engine::subsystems::postprocessing::PostProcessingProgram::FRAMEBUFFERSOURCE_SCREEN
@ FRAMEBUFFERSOURCE_SCREEN
Definition:
PostProcessingProgram.h:26
tdme::engine::subsystems::postprocessing::PostProcessingProgram::FRAMEBUFFERSOURCE_EFFECTPASS0
@ FRAMEBUFFERSOURCE_EFFECTPASS0
Definition:
PostProcessingProgram.h:26
tdme::engine::subsystems::postprocessing::PostProcessing
Post processing.
Definition:
PostProcessing.h:20
tdme::engine::subsystems::postprocessing::PostProcessing::getPostProcessingProgram
PostProcessingProgram * getPostProcessingProgram(const string &programId)
Get post processing program.
Definition:
PostProcessing.cpp:93
tdme::engine::subsystems::postprocessing::PostProcessing::programs
map< string, PostProcessingProgram * > programs
Definition:
PostProcessing.h:35
tdme::engine::subsystems::rendering::EntityRenderer
Rendering class.
Definition:
EntityRenderer.h:58
tdme.h
Generated by
1.9.3