-
Notifications
You must be signed in to change notification settings - Fork 0
/
NOTES
231 lines (213 loc) · 4.55 KB
/
NOTES
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
what do we need for game graphics?
- scene culling
- scene sorting
required info for pipeline from scene:
- shadow casters and receivers
- transparent objects
at the moment:
- we need bounding sphere/box for objects
- camera objects (frustum)
- lights:
point
directional
spot
----
always:
clip scene
collect visible objects
nearly always:
sort transparent
render all render queues
todo:
draw data dependecies of these scene:
terrain
with skeletal animated objects
with dynamic lighting
with shadows (vsm/pssm)
with reflective water
with ssao
with bloom on some objects
with HUD
required data from scene:
one camera render use case:
requrements:
render frustum
meshes
bounding sphere/box
material description: shading information
rendering stages:
- scene -> [2D texture]
- [2D texture] -> [2D texture]
- [2D texture] -> 2D texture
compiler:
maps scene elements into texture
most trivial pipeline handler with baked modules (serial chain):
ssao
IN:
- luminance texture
- render texture
- depth texture
OUT:
- render texture
bloom
IN:
- render texture
- glow texture
OUT:
- render texture
vsm
IN:
- camera
frustum
- light
frustum
- scene part
mesh list with bounding sphere/box
OUT:
- luminance texture
pssm
IN:
- camera
frustum
- light
frustum
- scene part
mesh list with bounding sphere/box
OUT:
- luminance texture
env mapping
IN:
-
-----------
{-
attribute types:
ok - FLOAT
ok - FLOAT_VEC2
ok - FLOAT_VEC3
ok - FLOAT_VEC4
ok - FLOAT_MAT2
ok - FLOAT_MAT3
ok - FLOAT_MAT4
FLOAT_MAT2x3
FLOAT_MAT2x4
FLOAT_MAT3x2
FLOAT_MAT3x4
FLOAT_MAT4x2
FLOAT_MAT4x3
ok - INT
INT_VEC2
INT_VEC3
INT_VEC4
ok - UNSIGNED_INT
UNSIGNED_INT_VEC2
UNSIGNED_INT_VEC3
UNSIGNED_INT_VEC4
-}
{-
uniform types:
Float
Vec2
Vec3
Vec4
Int
?? INT_VEC2
?? INT_VEC3
?? INT_VEC4
Word
?? UNSIGNED_INT_VEC2
?? UNSIGNED_INT_VEC3
?? UNSIGNED_INT_VEC4
Bool
?? BOOL_VEC2
?? BOOL_VEC3
?? BOOL_VEC4
Mat2
Mat3
Mat4
?? FLOAT_MAT2x3
?? FLOAT_MAT2x4
?? FLOAT_MAT3x2
?? FLOAT_MAT3x4
?? FLOAT_MAT4x2
?? FLOAT_MAT4x3
?? SAMPLER_1D
?? SAMPLER_2D
?? SAMPLER_3D
?? SAMPLER_CUBE
?? SAMPLER_1D_SHADOW
?? SAMPLER_2D_SHADOW
?? SAMPLER_1D_ARRAY
?? SAMPLER_2D_ARRAY
?? SAMPLER_1D_ARRAY_SHADOW
?? SAMPLER_2D_ARRAY_SHADOW
?? SAMPLER_2D_MULTISAMPLE
?? SAMPLER_2D_MULTISAMPLE_ARRAY
?? SAMPLER_CUBE_SHADOW
?? SAMPLER_BUFFER
?? SAMPLER_2D_RECT
?? SAMPLER_2D_RECT_SHADOW
?? INT_SAMPLER_1D
?? INT_SAMPLER_2D
?? INT_SAMPLER_3D
?? INT_SAMPLER_CUBE
?? INT_SAMPLER_1D_ARRAY
?? INT_SAMPLER_2D_ARRAY
?? INT_SAMPLER_2D_MULTISAMPLE
?? INT_SAMPLER_2D_MULTISAMPLE_ARRAY
?? INT_SAMPLER_BUFFER
?? INT_SAMPLER_2D_RECT
?? UNSIGNED_INT_SAMPLER_1D
?? UNSIGNED_INT_SAMPLER_2D
?? UNSIGNED_INT_SAMPLER_3D
?? UNSIGNED_INT_SAMPLER_CUBE
?? UNSIGNED_INT_SAMPLER_1D_ARRAY
?? UNSIGNED_INT_SAMPLER_2D_ARRAY
?? UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE
?? UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY
?? UNSIGNED_INT_SAMPLER_BUFFER
?? UNSIGNED_INT_SAMPLER_2D_RECT
-}
{-
stage 1:
have nice low level api
hints:
shaders are defined with their input and output types
input:
- uniform variable list
- vertex attribute list
- varying variable list
output:
- varying variable list
-}
{-
stage 2:
create the pipeline desription data types
(simple one pass pipeline)
one pass:
INPUT OUTPUT
(vertex,geometry,fragment)
uniform variables | uniform variables |
textures |--> textures |--> textures
attributes | varying variables | attributes
hints:
- usage: before usage, the pipeline is compiled into IO computation
- render IO
- finalize IO
- OUTPUT should be used as INPUT in a later pass
-}
{-
vertex shader
input: (name, type)
uniforms
textures
attributes
output: varying (name,type)
geometry shader
input: (name, type)
uniforms
output: varying (name,type)
fragment shader
input: (name, type)
uniforms
output:
-}