@@ -25,9 +25,8 @@ layout(location = 2) out vec2 v_texcoord;
25
25
26
26
layout(std140, binding = 0) uniform renderer_t {
27
27
mat4 clipSpaceCorrMatrix;
28
- vec2 texcoordAdjust;
29
28
vec2 renderSize;
30
- };
29
+ } renderer ;
31
30
32
31
layout(std140, binding = 2) uniform material_t {
33
32
mat4 matrixModelViewProjection;
@@ -47,16 +46,15 @@ void main()
47
46
esVertex = position;
48
47
esNormal = normal;
49
48
v_texcoord = texcoord;
50
- gl_Position = clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
49
+ gl_Position = renderer. clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
51
50
}
52
51
)_" ;
53
52
54
53
static const constexpr auto model_display_fragment_shader_phong = R"_( #version 450
55
54
layout(std140, binding = 0) uniform renderer_t {
56
55
mat4 clipSpaceCorrMatrix;
57
- vec2 texcoordAdjust;
58
56
vec2 renderSize;
59
- };
57
+ } renderer ;
60
58
61
59
layout(std140, binding = 1) uniform process_t {
62
60
float time;
@@ -71,7 +69,7 @@ layout(std140, binding = 1) uniform process_t {
71
69
vec4 channelTime;
72
70
73
71
float sampleRate;
74
- };
72
+ } process ;
75
73
76
74
layout(std140, binding = 2) uniform material_t {
77
75
mat4 matrixModelViewProjection;
@@ -102,8 +100,8 @@ void main ()
102
100
{
103
101
vec3 normal = normalize(esNormal);
104
102
vec3 light;
105
- lightPosition.y = sin(time) * 20.;
106
- lightPosition.z = cos(time) * 50.;
103
+ lightPosition.y = sin(process. time) * 20.;
104
+ lightPosition.z = cos(process. time) * 50.;
107
105
if(lightPosition.w == 0.0)
108
106
{
109
107
light = normalize(lightPosition.xyz);
@@ -136,9 +134,8 @@ layout(location = 0) out vec2 v_texcoord;
136
134
137
135
layout(std140, binding = 0) uniform renderer_t {
138
136
mat4 clipSpaceCorrMatrix;
139
- vec2 texcoordAdjust;
140
137
vec2 renderSize;
141
- };
138
+ } renderer ;
142
139
143
140
layout(std140, binding = 2) uniform material_t {
144
141
mat4 matrixModelViewProjection;
@@ -156,16 +153,15 @@ out gl_PerVertex { vec4 gl_Position; };
156
153
void main()
157
154
{
158
155
v_texcoord = texcoord;
159
- gl_Position = clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
156
+ gl_Position = renderer. clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
160
157
}
161
158
)_" ;
162
159
163
160
static const constexpr auto model_display_fragment_shader_texcoord = R"_( #version 450
164
161
layout(std140, binding = 0) uniform renderer_t {
165
162
mat4 clipSpaceCorrMatrix;
166
- vec2 texcoordAdjust;
167
163
vec2 renderSize;
168
- };
164
+ } renderer ;
169
165
170
166
layout(std140, binding = 2) uniform material_t {
171
167
mat4 matrixModelViewProjection;
@@ -200,9 +196,8 @@ layout(location = 1) out vec3 v_coords;
200
196
201
197
layout(std140, binding = 0) uniform renderer_t {
202
198
mat4 clipSpaceCorrMatrix;
203
- vec2 texcoordAdjust;
204
199
vec2 renderSize;
205
- };
200
+ } renderer ;
206
201
207
202
layout(std140, binding = 2) uniform material_t {
208
203
mat4 matrixModelViewProjection;
@@ -221,16 +216,15 @@ void main()
221
216
{
222
217
v_normal = normal;
223
218
v_coords = (mat.matrixModel * vec4(position.xyz, 1.0)).xyz;
224
- gl_Position = clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
219
+ gl_Position = renderer. clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
225
220
}
226
221
)_" ;
227
222
228
223
static const constexpr auto model_display_fragment_shader_triplanar = R"_( #version 450
229
224
layout(std140, binding = 0) uniform renderer_t {
230
225
mat4 clipSpaceCorrMatrix;
231
- vec2 texcoordAdjust;
232
226
vec2 renderSize;
233
- };
227
+ } renderer ;
234
228
235
229
layout(std140, binding = 2) uniform material_t {
236
230
mat4 matrixModelViewProjection;
@@ -274,9 +268,8 @@ layout(location = 1) out vec3 v_n;
274
268
275
269
layout(std140, binding = 0) uniform renderer_t {
276
270
mat4 clipSpaceCorrMatrix;
277
- vec2 texcoordAdjust;
278
271
vec2 renderSize;
279
- };
272
+ } renderer ;
280
273
281
274
layout(std140, binding = 2) uniform material_t {
282
275
mat4 matrixModelViewProjection;
@@ -296,15 +289,14 @@ void main()
296
289
vec4 p = vec4( position, 1. );
297
290
v_e = normalize( vec3( mat.matrixModelView * p ) );
298
291
v_n = normal; //normalize( mat.matrixNormal * normal );
299
- gl_Position = clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
292
+ gl_Position = renderer. clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
300
293
}
301
294
)_" ;
302
295
static const constexpr auto model_display_fragment_shader_spherical = R"_( #version 450
303
296
layout(std140, binding = 0) uniform renderer_t {
304
297
mat4 clipSpaceCorrMatrix;
305
- vec2 texcoordAdjust;
306
298
vec2 renderSize;
307
- };
299
+ } renderer ;
308
300
309
301
layout(std140, binding = 2) uniform material_t {
310
302
mat4 matrixModelViewProjection;
@@ -345,9 +337,8 @@ layout(location = 1) out vec3 v_n;
345
337
346
338
layout(std140, binding = 0) uniform renderer_t {
347
339
mat4 clipSpaceCorrMatrix;
348
- vec2 texcoordAdjust;
349
340
vec2 renderSize;
350
- };
341
+ } renderer ;
351
342
352
343
layout(std140, binding = 2) uniform material_t {
353
344
mat4 matrixModelViewProjection;
@@ -372,15 +363,14 @@ void main()
372
363
vec4 p = vec4( position, 1. );
373
364
v_e = normalize( vec3( mat.matrixModelView * p ) );
374
365
v_n = normalize( mat.matrixNormal * normal );
375
- gl_Position = clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
366
+ gl_Position = renderer. clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
376
367
}
377
368
)_" ;
378
369
static const constexpr auto model_display_fragment_shader_spherical2 = R"_( #version 450
379
370
layout(std140, binding = 0) uniform renderer_t {
380
371
mat4 clipSpaceCorrMatrix;
381
- vec2 texcoordAdjust;
382
372
vec2 renderSize;
383
- };
373
+ } renderer ;
384
374
385
375
layout(std140, binding = 2) uniform material_t {
386
376
mat4 matrixModelViewProjection;
@@ -412,9 +402,8 @@ layout(location = 0) in vec3 position;
412
402
413
403
layout(std140, binding = 0) uniform renderer_t {
414
404
mat4 clipSpaceCorrMatrix;
415
- vec2 texcoordAdjust;
416
405
vec2 renderSize;
417
- };
406
+ } renderer ;
418
407
419
408
layout(std140, binding = 2) uniform material_t {
420
409
mat4 matrixModelViewProjection;
@@ -431,16 +420,15 @@ out gl_PerVertex { vec4 gl_Position; };
431
420
432
421
void main()
433
422
{
434
- gl_Position = clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
423
+ gl_Position = renderer. clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
435
424
}
436
425
)_" ;
437
426
438
427
static const constexpr auto model_display_fragment_shader_viewspace = R"_( #version 450
439
428
layout(std140, binding = 0) uniform renderer_t {
440
429
mat4 clipSpaceCorrMatrix;
441
- vec2 texcoordAdjust;
442
430
vec2 renderSize;
443
- };
431
+ } renderer ;
444
432
445
433
layout(std140, binding = 2) uniform material_t {
446
434
mat4 matrixModelViewProjection;
@@ -457,7 +445,7 @@ layout(location = 0) out vec4 fragColor;
457
445
458
446
void main ()
459
447
{
460
- fragColor = texture(y_tex, gl_FragCoord.xy / renderSize.xy);
448
+ fragColor = texture(y_tex, gl_FragCoord.xy / renderer. renderSize.xy);
461
449
}
462
450
)_" ;
463
451
@@ -468,9 +456,8 @@ layout(location = 1) out vec2 v_bary;
468
456
469
457
layout(std140, binding = 0) uniform renderer_t {
470
458
mat4 clipSpaceCorrMatrix;
471
- vec2 texcoordAdjust;
472
459
vec2 renderSize;
473
- };
460
+ } renderer ;
474
461
475
462
layout(std140, binding = 2) uniform material_t {
476
463
mat4 matrixModelViewProjection;
@@ -491,16 +478,15 @@ void main()
491
478
else if(gl_VertexIndex % 3 == 1) v_bary = vec2(0, 1);
492
479
else if(gl_VertexIndex % 3 == 2) v_bary = vec2(1, 0);
493
480
494
- gl_Position = clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
481
+ gl_Position = renderer. clipSpaceCorrMatrix * mat.matrixModelViewProjection * vec4(position.xyz, 1.0);
495
482
}
496
483
)_" ;
497
484
498
485
static const constexpr auto model_display_fragment_shader_barycentric = R"_( #version 450
499
486
layout(std140, binding = 0) uniform renderer_t {
500
487
mat4 clipSpaceCorrMatrix;
501
- vec2 texcoordAdjust;
502
488
vec2 renderSize;
503
- };
489
+ } renderer ;
504
490
505
491
layout(std140, binding = 2) uniform material_t {
506
492
mat4 matrixModelViewProjection;
0 commit comments