Untitled
Loading...
Searching...
No Matches
engine_types.h
Go to the documentation of this file.
1
5
6#ifndef ENGINE_TYPES_H
7#define ENGINE_TYPES_H
8#include <stdbool.h>
9#include <stddef.h>
10#include <stdint.h>
11#include <SDL2/SDL.h>
12#include <GL/glew.h>
13#include "SDL2/SDL_mutex.h"
14#include "SDL2/SDL_thread.h"
15#include "nk_config.h"
16#include "nuklear/nuklear.h"
17#include <omp.h>
18#include "nuklear/nuklear_sdl_gl3.h"
19#include "miniaudio/miniaudio.h"
20#include <fftw3.h>
21#include "uthash/uthash.h"
22#include <stdatomic.h>
23#include "utilities/types.h"
24
31
37#define MAX_AUDIO_EMITTERS 1024
38#define MAX_AUDIO_EMITTERS_PER_ENTITY 24
39#define LPF_ORDER 2
53
60
67
68#define PI 3.14159265358979323846
69
70#define FOV 90
71#define VIEW_NEAR 0.1
72#define VIEW_FAR 1000.0
73
74
80#define MAX_INTERP_APROBES 4
81#define SAMPLE_RATE 48000
82
83#define IR_SAMPLE_RATE 48000
84#define EDC_SAMPLE_RATE 48000
85
86#define SPEED_OF_SOUND 343.0f
87#define MAX_APROBE_SECONDS 1
88#define MAX_IR_SAMPLES (IR_SAMPLE_RATE * MAX_APROBE_SECONDS)
89#define MAX_EDC_SAMPLES (EDC_SAMPLE_RATE * MAX_APROBE_SECONDS)
90#define MAX_SAMPLES (SAMPLE_RATE * MAX_APROBE_SECONDS)
91#define AUDIO_PROBE_BINS 48000
92#define AUDIO_KERNEL_SIZE 31
93#define AUDIO_KERNEL_CENTER 15
94#define AUDIO_NUM_BANDS 6
95
96#define NUM_PARTITIONS_MAX 96
97#define NUM_PARTITIONS 95
101const static float AUDIO_BAND_FREQ[] = {125.0f, 250.0f, 500.0f, 1000.0f, 2000.0f, 4000.0f};
103
104
105
106#define MAX_NUKLEAR_EVENTS 256
107#define MAX_SDL_EVENTS 512
108#define MAX_MESH_NODES 1024
109#define MAX_MESHES 512
110#define MAX_JOINT_MATRICES 512
111#define MAX_INSTANCES 1024
112#define MAX_MATERIALS 256
113#define MAX_LIGHTS 1024
114
115// TODO remove this define
116#define MINIMUM_LIGHT_VISIBILITY_DIST 0.01
117#define MAX_LIGHTS_PER_MESH 4
118
119// TODO this might be too small
120#define MAX_DRAW_COMMANDS 512
121
122#define MAX_DIRECTIONAL_LIGHTS 4
123
124#define MAX_ENTITY_STATES 256
125
126#define DEFAULT_TEXTURES 5
127
128// TODO move this to editor.c
129#define MAX_UI_MENU_NAMES 128
130
140 #define EDITOR_LIGHT_SIZE 0.5f
141
142 #define EDITOR_RPROBE_SIZE 0.5f
143
144 #define EDITOR_AUDIO_EMITTER_SIZE 0.5f
145
146 #define EDITOR_APROBE_SIZE 0.1f
147
148 #define EDITOR_APORTAL_SIZE 0.2f
150
152
153#define PERFORMANCE_OVERLAY_TEXT_BOX_COUNT 13
154
155#define BUFFER_FRAMES 3
156
157#define UBERSHADER_VERSIONS 17
158#define GBUFFER_VERSIONS 1
159
160#define MAX_PLAYER_CONTACTS 10
161
167#define LIGHTMAP_WIDTH 2048
168#define LIGHTMAP_HEIGHT 2048
169
170#define RPROBE_WIDTH 128
171#define RPROBE_HEIGHT 128
172
173#define DEFAULT_POINT_LIGHT_SHADOWS_SIZE 128
174
175#define DEFAULT_SHADOW_MAP_SIZE 2048
176
177#define FBM_TEXTURE_SIZE 128
179
180
181
182#define MAX_POINT_LIGHT_SHADOWS_CMA 16
183
184#define SH_MAX 9
185
186#define MAX_RPROBE_MIPS 1
187
188#define MAX_RPROBES_PER_FRAME 4
189
190#define SSAO_KERNEL_SIZE 16
191
192#define ACCEL_BETA 0.005f
193
194
200#define GRID_X 16
201#define GRID_Y 9
202#define GRID_Z 24
203#define TOTAL_CLUSTERS (GRID_X * GRID_Y * GRID_Z)
204#define MAX_LIGHTS_PER_CLUSTER 12
206
207
213#define LPV_SLOTS 6
214#define MAX_AUDIO_PROBE_VOLUMES 4
215#define PROBE_VOLUME_WIDTH 12
216#define PROBE_VOLUME_HEIGHT 12
217#define PROBE_VOLUME_DEPTH 12
218#define PROBE_VOLUME_DEPTH_PADDED (PROBE_VOLUME_DEPTH + 2)
219#define LPV_COUNT (PROBE_VOLUME_WIDTH * PROBE_VOLUME_HEIGHT * PROBE_VOLUME_DEPTH)
220#define LPV_PADDED_COUNT (PROBE_VOLUME_WIDTH * PROBE_VOLUME_HEIGHT * PROBE_VOLUME_DEPTH_PADDED)
222
223
224
250
254static const char * DVIEW_NAMES[] =
255{
256 "DVIEW_DEFAULT",
257 "DVIEW_ALBEDO",
258 "DVIEW_ARM",
259 "DVIEW_EMISSIVE",
260 "DVIEW_AO",
261 "DVIEW_UV",
262 "DVIEW_POM_VDIR",
263 "DVIEW_CLUSTERS",
264 "DVIEW_NORMAL",
265 "DVIEW_ORIGINAL_NORMAL",
266 "DVIEW_DIRECT",
267 "DVIEW_INDIRECT",
268 "DVIEW_LM_IRRADIANCE",
269 "DVIEW_LM_DIRECTIONAL",
270 "DVIEW_RPROBE",
271 "DVIEW_SPECULAR"
272};
273
281
294
298static const char * PPDVIEW_NAMES[] =
299{
300 "PP_DVIEW_DEFAULT",
301 "PPDVIEW_DEPTH",
302 "PPDVIEW_VEL",
303 "PPDVIEW_BOKEH",
304 "PPDVIEW_LM",
305 "PPDVIEW_MAX",
306};
307
321
326static const char * FULLSCREEN_OPTION_NAMES[] =
327{
328 "FULLSCREEN",
329 "BORDERLESS",
330 "WINDOWED"
331};
332
342
343
345
346
363
368typedef fftwf_complex * PartitionTableChannel[NUM_PARTITIONS];
369
375
390
397typedef struct AudioPortal
398{
399
402
404
405
406
407#define PARTITION_BUFFERS 4
408
436
444{
445
446 SDL_mutex * aprobe_mutex;
447
452 int ir_len;
454
455 float * HRTF_IR_IN;
456 fftwf_plan fwd_plan;
457 fftwf_plan static_fwd_plan;
458 fftwf_plan IR_fwd_plan;
459 fftwf_plan IR_bwd_plan;
460 fftwf_plan bwd_plan;
461
462 float * IR_SUM_L;
463 float * IR_SUM_R;
464 fftwf_complex * IR_SUM_L_FWD;
465 fftwf_complex * IR_SUM_R_FWD;
468 fftwf_complex * STATIC_HRTF_L_FWD[SH_MAX];
469 fftwf_complex * STATIC_HRTF_R_FWD[SH_MAX];
470 float * IR_ROT[SH_MAX];
471 fftwf_complex * IR_ROT_FWD[SH_MAX];
472
474
475
482typedef struct ConvolverNode
483{
484
485 ma_node_base base;
486 ma_mutex lock;
493
494 fftwf_plan fwd_plan;
495 fftwf_plan bwd_plan;
496
497 fftwf_complex * MONO_FWD;
499
500 fftwf_complex * PREV_SUM_L;
501 fftwf_complex * PREV_SUM_R;
502 fftwf_complex * SUM_L;
503 fftwf_complex * SUM_R;
504
506
509 float * LEFT_OUT;
510 float * RIGHT_OUT;
511
514 float * TAIL_LEFT;
515 float * TAIL_RIGHT;
516
519
520
522
523
530typedef struct AudioEmitter
531{
532
533 char path[256];
534 uint32_t id;
535 ma_sound sound_obj;
536 ma_lpf_node lpf_node;
545 bool is_loop;
546 bool free;
547
549
550
558
559
568
569
575typedef struct GLTexture
576{
577
580 GLint wrap_s;
581 GLint wrap_t;
582 GLint wrap_r;
584 GLenum format;
585 GLenum type;
586 GLenum target;
587 GLsizei w, h, d;
588 GLsizei levels;
590 GLuint i;
595
596} GLTexture;
597
602typedef struct GLRenderbuffer
603{
604
605 GLuint i;
607 GLsizei w, h, d;
610
612
613
631
652
653
662
668typedef struct EditorSettings
669{
670
680
702
704
707
714 bool SSAO;
715 bool SSR;
716 bool DOF;
717 bool MBLUR;
718 bool TAA;
719 bool BLOOM;
720 bool MSAA;
721 bool VSYNC;
722 bool NOISE;
723 bool LUT;
724 bool ACES;
725 bool UI;
728
743
745
754
784
787
796
810 float mfactor;
812
815
817
819 float volume;
820
830
832
834
836
837
843
844 uint32_t count;
846 uint32_t first;
847 uint32_t baseInstance;
848 uint32_t instanceOffset;
849 uint32_t pad0;
850
852
858
859 uint32_t count;
861 uint32_t firstIndex;
862 uint32_t baseVertex;
863 uint32_t baseInstance;
864 uint32_t instanceOffset;
865
867
877
878
884typedef struct MeshNodeDataGPU
885{
886
897
898 uint32_t instance_count;
899 uint32_t static_mesh;
900 uint32_t lm_offset;
901 uint32_t material;
902 uint32_t first;
903 uint32_t count;
904 uint32_t pad0;
905 uint32_t pad1;
906
908
913typedef struct MeshNodeSSBO
914{
916 uint32_t pad0;
917 uint32_t pad1;
918 uint32_t pad2;
921
938
939
940typedef struct Filter Filter;
944struct Filter
945{
946
947 void * val;
948 size_t byte_size;
949 bool (*fn)(void*, Filter*);
950
951} ;
952
964
968typedef struct Trigger
969{
970
973 void (*fn)(void*);
974
975} Trigger;
976
977
1033
1034
1035
1036
1043typedef struct Manifold
1044{
1045
1054 int mnA;
1056 int mnB;
1058
1060 int count;
1061
1063 bool free;
1064
1065 float deepest;
1066
1067} Manifold;
1068
1069// each lightmap texel gets a patch
1070// triangles link to uv lightmap triangles
1071// on import build adjacency map for triangles
1072// then find coplanar faces within some epsilon and then create surfaces with tri lists
1073// from there create uv islands for each surface and wrap
1074// then bake lighting
1075
1076
1077
1099
1100
1117
1131
1132
1140typedef struct BVHNode
1141{
1142
1148 int left;
1149 int right;
1150 int parent;
1151 int index;
1152 int next;
1154
1157 size_t count;
1158 float flux;
1160
1161} BVHNode;
1162
1163
1180
1196
1197
1202typedef struct DebugVertex
1203{
1206
1207} DebugVertex;
1208
1213typedef struct TextVertex
1214{
1215
1221 uint32_t state;
1222 uint32_t uID;
1223
1224} TextVertex;
1225
1236
1237
1253
1258typedef struct Render
1259{
1261
1262} RenderData;
1263
1283
1302
1338
1339
1353
1354
1359typedef struct RProbe
1360{
1362 uint32_t pad0;
1364 uint32_t pad1;
1366 uint32_t pad2;
1367
1368} RProbe;
1369
1370#define MAX_RPROBES 256
1375typedef struct RProbeData
1376{
1377
1379
1380} RProbeData;
1381
1382
1387typedef struct {
1388 float b0, b1, b2, a0, a1, a2;
1389 float x1, x2, y1, y2;
1390} Biquad;
1391
1397typedef struct AudioProbe
1398{
1399
1400 size_t ir_length;
1401 vec3 pos;
1404 float (* final_ir)[SH_MAX];
1405
1406} AudioProbe;
1407
1413typedef struct AudioProbeGPU
1414{
1416 uint32_t pad0;
1418
1424typedef struct AudioSampleGPU
1425{
1426
1430 uint32_t valid;
1431 float energy[6];
1432 uint32_t pad0;
1433 uint32_t pad1;
1434 float abs_energy[6];
1435 uint32_t pad4;
1436 uint32_t pad5;
1437
1439
1453
1461typedef struct Light
1462{
1463
1465 uint32_t entity_id;
1466
1469
1471 float penumbra;
1472
1477
1478 float radius;
1481
1483 uint32_t layer;
1484
1485 int mesh;
1486 int tri;
1487
1488 float lum;
1489 float power;
1490
1502
1503} Light;
1504
1505
1513typedef struct LightGPU
1514{
1515
1517 uint32_t entity_id;
1518
1521
1523 float cos_diff;
1524
1529
1530 float radius;
1531 uint32_t layer;
1532 uint32_t mesh;
1533 uint32_t tri;
1534
1535 float area;
1536 uint32_t bvh_index;
1537 uint32_t pad1;
1538 uint32_t pad2;
1539
1540} LightGPU;
1541
1542#define MAX_TEX_LABELS 600
1543#define LABEL_LEN 256
1544
1560
1568
1573typedef struct Material
1574{
1575
1576 char name[256];
1588 float metallic;
1589 float roughness;
1590 float ao_strength;
1591 float emissive_strength;
1593
1596
1609
1610 float normal_scale;
1612 float alpha_cutoff;
1613
1614
1618
1619} Material;
1620
1621
1662
1669typedef struct MaterialData
1670{
1671
1673
1674} MaterialData;
1675
1681typedef struct VertexGPU
1682{
1683
1685 uint32_t pad0;
1687 uint32_t pad1;
1689 uint32_t pad2;
1690 uint32_t pad3;
1691
1692} VertexGPU;
1693
1699typedef struct VertexData
1700{
1701
1703
1704} VertexData;
1705
1711typedef struct TriGPU
1712{
1713
1715 uint32_t material_id;
1717 uint32_t mesh_id;
1718 uint32_t bvh_index;
1719 uint32_t tri_idx;
1720 uint32_t pad1;
1721 uint32_t pad2;
1722
1732
1733} TriGPU;
1734
1740typedef struct TriData
1741{
1742
1744
1745} TriData;
1746
1752typedef struct MeshGPU
1753{
1754
1756 uint32_t mesh_id;
1757
1758 uint32_t node_offset;
1759 uint32_t node_count;
1760 uint32_t vertex_offset;
1761 uint32_t vertex_count;
1762 uint32_t tri_offset;
1763 uint32_t tri_count;
1764 uint32_t bvh_index;
1765 uint32_t is_static;
1767 uint32_t pad2;
1768
1771
1772} MeshGPU;
1773
1779typedef struct MeshData
1780{
1781
1783
1784} MeshData;
1785
1789typedef struct AABBGPU
1790{
1791
1793 uint32_t pad0;
1795 uint32_t pad1;
1797 uint32_t pad2;
1799 uint32_t pad3;
1800
1801} AABBGPU;
1802
1808typedef struct BVHNodeGPU
1809{
1810
1811 int32_t left;
1812 int32_t right;
1813 int32_t parent;
1814 int32_t index;
1815
1817 int32_t count;
1818 int32_t next;
1819 float flux;
1820
1824 uint32_t pad2;
1826 uint32_t pad3;
1828 uint32_t pad4;
1829
1830} BVHNodeGPU;
1831
1837typedef struct BVHGPU
1838{
1839
1841
1842} BVHGPU;
1843
1848typedef struct SHDataGPU
1849{
1851 uint32_t pad0;
1853} SHDataGPU;
1854
1859typedef struct OBBGPU
1860{
1861
1863 uint32_t loaded;
1865 uint32_t pad1;
1867 uint32_t pad2;
1869 uint32_t pad3;
1871 uint32_t pad4;
1872
1873} OBBGPU;
1874
1880typedef struct ProbeVolumeUBO
1881{
1882
1884
1886
1892typedef struct RProbeUBO
1893{
1894
1895 struct Align16
1896 {
1897 uint32_t val;
1898 uint32_t padding[3];
1900
1901 uint32_t probe_count;
1902 uint32_t pad0;
1903 uint32_t pad1;
1904 uint32_t pad2;
1905
1906} RProbeUBO;
1907
1908
1914typedef struct LightmapGPU
1915{
1917} LightmapGPU;
1918
1923typedef struct LightmapSSBO
1924{
1925
1927
1928} LightmapSSBO;
1929
1935typedef struct ClusterAABBGPU
1936{
1937
1940
1942
1948typedef struct ClusterGPU
1949{
1950 uint32_t offset;
1951 uint32_t count;
1952} ClusterGPU;
1953
1954
1961typedef struct LightmapAtlas{
1962
1963 int width;
1966 unsigned char *occupied;
1967
1969
1976typedef struct LightmapRect {
1977
1978 int u;
1979 int v;
1980 int w;
1981 int h;
1984
1985} LightmapRect;
1986
1991typedef vec2 LightmapUV[3];
1992
1993
2013
2030
2031
2039typedef struct UVMapping
2040{
2041
2042 size_t uv_island;
2043 size_t uv_idx;
2044 bool valid;
2045
2046} UVMapping;
2047
2048typedef struct Entity Entity;
2049
2065
2082
2083
2092typedef struct CapsuleData
2093{
2094
2097 float radius;
2098
2099} CapsuleData;
2100
2110typedef struct HullData
2111{
2112
2114 size_t count;
2116 size_t face_count;
2117
2118} HullData;
2119
2137
2138
2186
2187
2198
2209
2216typedef struct AnimationKeyframe
2217{
2218 float time;
2219 union
2220 {
2221 float v;
2222 vec3 v3;
2223 int i;
2225
2227
2228
2229#define MAX_KEYFRAMES 64
2230
2255
2256#define MAX_TRACKS 64
2257
2275
2289
2310
2311
2317typedef struct State
2318{
2319
2320 char name[256];
2321 void (*fn[ESTATE_MAX])(void*);
2322
2323} State;
2324
2325
2326
2333{
2334
2335 size_t id;
2336 bool free;
2337
2339 int skin;
2341
2343 union
2344 {
2346 Filter filter;
2347 } as;
2348
2353
2354};
2355
2356// TODO Probably expand this or change this number.
2357#define MAX_NODE_CHILDREN 128
2358
2367typedef struct MeshNode {
2368
2369 char name[256];
2370 bool active;
2371 bool free;
2372 size_t id;
2373 size_t local_id;
2385
2386 int mesh;
2387 int asset;
2389 int skin;
2390 uint32_t skin_offset;
2391
2398
2400
2401 size_t offset;
2402 size_t count;
2403
2404
2418
2421
2428 uint32_t mesh_data_id[32];
2429 uint32_t command_id[32];
2431
2436
2442
2443} MeshNode;
2444
2452typedef struct SubMesh
2453{
2454
2455 size_t material;
2460 size_t lm_offset;
2462 size_t command_id;
2464
2465} SubMesh;
2466
2477
2522
2523
2529typedef struct Image
2530{
2531
2532 char path[256];
2533 char mime_type[256];
2534 char name[256];
2536 unsigned char * buf;
2537 GLuint i;
2538 GLuint64 handle;
2539 int width;
2541 bool sRGB;
2542
2545 GLint wrap_s;
2546 GLint wrap_t;
2547
2548} Image;
2549
2586
2591typedef struct {
2592
2593 char *uri;
2595 unsigned char *data;
2596
2597} GLTFBuffer;
2598
2609
2614typedef struct {
2619 char type[8];
2620} GLTFAccessor;
2621
2636
2642typedef struct {
2645} GLTFMesh;
2646
2653
2660
2666typedef struct {
2667 // count is times, elem is values
2668 int count;
2669 float *times;
2670
2672 float *values;
2675
2681typedef struct {
2682 int input;
2686
2697
2698
2704
2712
2713
2729
2730
2735#define MAX_ANIMATION_INDICES 256
2736
2737
2738
2761
2766typedef struct GLTFTexture
2767{
2768
2771
2772} GLTFTexture;
2773
2778typedef struct GLTFImage
2779{
2780
2781 char uri[256];
2783 char mime_type[256];
2784 char name[256];
2785
2786} GLTFImage;
2787
2792typedef struct GLTFSampler
2793{
2794
2799 char name[256];
2800
2801
2802} GLTFSampler;
2803
2833
2841typedef struct AssetInstance
2842{
2843
2844 size_t id;
2845 size_t first_skin;
2846 size_t skin_count;
2847
2849 size_t node_count;
2850 size_t * node_indices;
2851 size_t * skin_indices;
2852
2863
2864 bool free;
2866
2868
2869
2891
2905
2912typedef struct DrawCommand
2913{
2914
2916 uint8_t fwd_shader;
2917 uint8_t material;
2918 uint8_t opaque;
2919 uint8_t static_mesh;
2920 uint16_t mesh_id;
2921 uint16_t skin_offset;
2922
2935
2936 uint32_t start_index;
2937 uint32_t index_count;
2938 uint32_t lm_offset;
2939 uint32_t mn_id;
2940 uint32_t sm_id;
2941 uint32_t array_offset;
2943 uint64_t sort_key;
2945
2946} DrawCommand;
2947
2948
2949
2950
2957#define MAX_EPA_VERTICES 1024
2958#define MAX_EPA_FACES 1024
2959#define MAX_EPA_INDICES 1024
2960#define MAX_EPA_HORIZON_EDGES 1024
2961#define MAX_EPA_HORIZON_COUNTS 1024
2962#define MAX_EPA_VISIBLE_FACES_INDICES 1024
2964
2988
2994typedef struct OpenNode
2995{
2996
2997 int i;
2998 float g;
2999 float f;
3001
3002} OpenNode;
3003
3004
3005#define MAX_PORTALS 256
3006
3011typedef struct AStarStateStack
3012{
3013
3014 float g;
3015 float f;
3018
3020
3037
3060
3061
3062static const ivec3 DEFAULT_APV_RES = {6, 6, 6};
3064
3065
3073typedef struct ProbeVolume
3074{
3075
3077 size_t size;
3080
3081} ProbeVolume;
3082
3089typedef struct APV
3090{
3091
3092 int pv_id;
3094
3095} APV;
3096
3097
3103typedef struct LPV
3104{
3105
3106 int pv_id;
3107
3113 float * lprobes;
3114
3115} LPV;
3116
3122typedef struct LightBVH
3123{
3124
3126 size_t * indices;
3129
3130} LightBVH;
3131
3182
3183
3201
3202
3203
3221
3283
3284typedef struct LProbeEditorMenu
3285{
3286
3288
3290
3310
3357
3359{
3360
3362
3364
3366{
3367
3369
3371
3388
3390
3391
3434
3439typedef struct Uniform
3440{
3441 GLuint location;
3442 char name[256];
3443} Uniform;
3444
3450typedef struct ShaderProgram
3451{
3452
3453 GLuint program;
3454 uint32_t perm;
3455 char name[256];
3456 char vert_path[256];
3457 char geom_path[256];
3458 char frag_path[256];
3459
3461
3463
3468typedef struct VertexLayout {
3469
3470 char name[256];
3472 GLsizei vertex_size;
3473 GLuint vao;
3474 GLuint vbo;
3475 GLuint ebo;
3476 GLenum buffer_usage; // GL_STATIC_DRAW
3477 int buffer_override; // for static buffers
3478 GLenum buffer_target; // GL_ARRAY_BUFFER
3485
3486} VertexLayout;
3487
3488extern Globals GLOBALS;
3489extern Camera cam;
3491
3492
3493#endif
Camera cam
This is currently the player cam.
Definition main.c:322
uint32_t instanceOffset
This tracks how many offsets were pushed in a frame and is used in the prefix sum.
DrawArraysIndirect commands are used for non-static meshes.
GLenum type
uint8_t static_mesh
If it is a static mesh.
PerformanceQueryTypes
Performance query types used to profile the render loop.
@ PQUERY_MAIN
@ PQUERY_SM
@ PQUERY_BLOOM
@ PQUERY_GBUFFER
@ PQUERY_DOF
@ PQUERY_CULL
@ PQUERY_SSAO
@ PQUERY_MAX
@ PQUERY_SSR
@ PQUERY_TAA
@ PQUERY_PL
@ PQUERY_RENDER
LightBVH light_bvh
The LightBVH, required for baking lighting.
size_t first_vertex
The first Point in Mesh.vertices that this SubMesh refers to.
Spring neck
Neck Spring (target based on pelvis).
VertexGPU v2
vec3 pos
Currently anchors the Skeleton.
uint32_t pad2
bool fixed_sample_locations
This is set to true if multisampled and is standard for MSAA.
int block_size
How much to allocate in one rect.
#define PROBE_VOLUME_DEPTH
AABB aabb
Bounding box of area.
int joint_count
The amount of joints.
int bvh_indices_count
bool lights_dirty
If lights need to be reuploaded.
int horizon_counts[1024]
The amount of times each horizon edge appears (if it only appears once then it is evaluated).
uint32_t array_offset
The offset into INDIRECT_ARRAYS_COMMAND_BUFFER.
uint32_t static_mesh
vec3 p_right
The current right foot position.
uint16_t spot_light_offset
ivec4 joint_indices
The indices for each joint matrix (skeletal animations).
GLTFSkin * skins
float * lprobes
The raw SH data.
FILE * LPV_FILE
FILE pointer to the opened binary file.
int v
The height of the rect in UV space.
float roll
vec2 LightmapUV[3]
The lightmap UVs stored on UVIslands per MeshFace.
size_t mesh_data_id
The MeshNodeDataGPU this is assigned to.
uint32_t pad1
uint32_t pad2
bool on_ground
If the camera is on the ground.
size_t faces_count
The amount of faces.
#define MAX_EPA_HORIZON_COUNTS
vec4 coefficients[9]
bool noclip
If collision is enabled.
FILE * APV_FILE
FILE pointer to the opened binary file.
bool override_transparent
size_t indices_count
The amount of current faces.
int visible_faces_indices[1024]
The faces that are visibile from the newest SupportVertex.
int material_id
The Material this belongs to.
SupportVertex vertices[1024]
The vertices of the current polyhedron.
AlphaMode alpha_mode
int image_count
Vector mesh_nodes
MeshNodes.
char name[256]
bool free
Indicates an empty slot in ASSET_INSTANCES.
GLsizei d
float height
The height of the Player body.
int skin
The GLTFSkin to be modified by this Entity (skeletal animations).
size_t lm_offset
The starting index in LIGHTMAP_DATA that this SubMesh points to.
StateType
Entity States that change behaviors and available reactions to Triggers.
@ ESTATE_KILLED
@ ESTATE_PLAYER_INTERACT
@ ESTATE_DISABLED
@ ESTATE_NONE
@ ESTATE_MAX
@ ESTATE_DAMAGED
@ ESTATE_COMBAT
@ ESTATE_IDLE
@ ESTATE_TRIGGER
uint32_t pad2
float stiff
Stiffness.
uint32_t tri_idx
Local: The bvh index for this MeshFace.
AnimationInterpolation interpolation
LightType
Enum for types of Lights.
@ AREA_LIGHT
@ POINT_LIGHT
@ SPOT_LIGHT
@ DIRECTIONAL_LIGHT
@ MAX_LIGHT_TYPES
#define PROBE_VOLUME_HEIGHT
vec3 right_hip_pos
The right hip pos, offset by right_leg_offset.
GLuint texture_id
The texture ID for the current lightmap.
unsigned char * occupied
The map of what is currently occupied by LightmapRects.
uint32_t pad3
#define MAX_MESHES
Maximum Meshes in a scene (used for SSBO sizing).
RProbe probes[256]
vec3 start_pos
Starting position of the foot.
uint32_t start_index
Where the indices / vertices start for this SubMesh in MAIN_VBO.
int rbo_count
The amount of GLRenderbuffers bound.
Vector lights
The Lights that were created (emissive triangles become AREA_LIGHTS).
const ivec3 DEFAULT_LPV_RES
What LPVs should always be at to match texture dimensions.
LightmapUV * uvs
The uvs for each MeshFace on this islands.
float absorption_coefficients[6]
SceneData scene_data
SceneData that is more-so scene specific.
MeshGPU * meshes
mat4 tr
The Transform's matrix.
int tri_id
The ID of the MeshFace.
DepthMode
The depth modes for initializing depth textures.
@ DEPTH_MODE_NO_HW
@ DEPTH_MODE_NONE
@ DEPTH_MODE_HW
char name[256]
AnimationKeyframe kf[64]
The AnimationKeyframes for this track.
uint32_t alpha_mode
int32_t index
uint32_t pad4
vec3 pos
The position.
GLint min_filter
Refer to OpenGL texture loading.
uint8_t material
The Material ID into Globals.materials.
uint32_t pad1
int accessorCount
int i
The index into the array of whatever is being traversed.
uint32_t mesh
LightmapGPU * uvs
float emissive_flux
uint16_t directional_light_count
bool loop
If the animation loops.
#define MAX_AUDIO_PROBE_VOLUMES
#define MAX_EPA_HORIZON_EDGES
int came_from
The index into the array of traversed items that this node came from.
uint32_t count
uint32_t pad1
union Entity::@176104171171243366236114066074167027016130272210 as
size_t animation_count
mat4 matrix
The transformation matrix of the MeshNode.
uint32_t pad4
int run_id
Makes sure that no old stack items are used.
float scattering_coefficients[6]
size_t id
The ID of this skin in Globals.skins.
uint32_t tri_offset
Where the TriGPUs for this Mesh start in the SSBO.
size_t byte_size
Vector bvh_nodes
GLuint i
The image handle for this texture.
void(* fn[ESTATE_MAX])(void *)
int height
Height of the atlas.
ivec3 probe_tex_size
The texture size for lighting probes.
GLTFMesh * meshes
float metallic_factor
VertexGPU v1
size_t horizon_edges_count
The amount of horizon edges.
#define PROBE_VOLUME_WIDTH
uint32_t uID
The ID in the TEXT_BOX_SSBO.
GLint internal_format
uint32_t probe_count
int32_t first_index
uint32_t mn_id
The MeshNode this belongs to.
uint32_t pad0
GLRenderbuffer renderbuffers[6]
The renderbuffers bound to this fbo.
PostprocessToggles
Postprocess options.
@ PP_MBLUR
@ PP_LUT
@ PP_BLOOM
@ PP_DOF
@ PP_ACES
@ PP_MAX
@ PP_NOISE
size_t attrib_count
uint32_t skip_directional_light
Skip directional lights so that they go through this Mesh.
uint32_t node_offset
Where the BVHNodes start in the SSBO.
nk_bool open
If the directory is currently open in a dropdown.
char LPV_PATH[256]
Path to binary file with lighting ProbeVolumes.
size_t skin_count
The amount of GLTFSkins in this instance.
int asset_id
The ID into Globals.assets.
mat4 global_matrix
vec3 velocity
Velocity of this spring.
#define MAX_TEX_LABELS
The maximum amount of labels for a ComboLabel.
uvec2 spot_lights
Spot Lights count and offset.
vec3 extents
uint64_t albedo_handle
AnimationComponent * ac
The AnimationComponent inside of ANIMATION_COMPONENTS.
Skeleton skeleton
Player Skeleton.
bool(*) fn(void *, Filter *)
vec3 centroid
The centroid of the MeshFaces on this island.
vec3 capture_pos
The position to capture the cubemap from.
vec3 fade_margin
The margin to fade between this probe and another.
uint32_t pad2
vec3 p_left
The current left foot position.
size_t skin_count
float base_color_factor[4]
float neck_pelvis_diff
Height from pelvis to neck.
vec3 angular_vel
Current velocity for the rotation.
uint32_t lm_offset
Lightmap offset into LIGHTMAP_DATA / LIGHTMAP_SSBO.
float outer_cos
Precomputed when uploading to the GPU for SPOT_LIGHTs.
int sampler_count
Vector vertex_layouts
VertexLayouts.
PhysicsComponent * pc
PhysicsComponent in PHYSICS_COMPONENTS.
int mesh_node
The top-most MeshNode that belongs to this Entity.
#define MAX_RPROBES
The maximum amount of RProbes to send to the GPU at once.
vec4 fill
The fill color for the TextBox.
float lower_leg_length
Lower leg length.
EntityType type
Type of entity for Filters.
#define MAX_TRACKS
Maximum AnimationTracks in an AnimationComponent.
size_t index_count
The amount of indices that this SubMesh refers to: Mesh.tris -> MeshFace.indices.
vec3 pos
The position.
int width
Width of the atlas.
GLenum format
float g
The g score: current score of the path.
MeshNode * nodes
Mesh mesh
The Mesh for the ConvexHull used for collisions (an AABB).
DepthMode dm
If this is a depth texture and what mode it is.
uint32_t pad0
bool LOADED_AUDIO_PV_FLAG[4]
Flags that indicate if the slot is loaded.
uint32_t pad2
#define LPV_SLOTS
#define MAX_NODE_CHILDREN
Maximum amount of direct MeshNode children to be stored in a MeshNode.
MeshNodeDataGPU mns[1024]
vec4 color
The color of the text.
Vector audio_portals
AudioPortals.
uint32_t loaded
bool valid
If this island is valid to rasterize.
size_t command_id
The DrawCommand this is assigned to.
float stiff_rot
Stiffness for rotation.
vec4 weights
The weights each joint is multiplied by.
TriggerType
Types of Triggers.
@ TRIGGER_ONESHOT
@ TRIGGER_CONTINUOUS
@ TRIGGER_NONE
LegIK right_leg
Right leg.
uint32_t command_id
The DrawCommand this refers to.
uint32_t material_id
Vector meshes
Meshes.
int animation_indices_count
The amount of Animation indices.
GLuint program
Program handle.
uint32_t mn_id
The MeshNode.
AlphaMode
Alpha mode to determine Material blending.
@ ALPHA_MASK
@ ALPHA_OPAQUE
@ ALPHA_BLEND
char geom_path[256]
Path to geometry shader.
bool sprinting
Currently unused flag for sprinting.
#define MAX_EPA_FACES
int animation_indices[256]
Animation indices into Asset.
AudioProbe * audio_probes
A scratch buffer used when baking AudioProbes.
AnimationSampler * samplers
float cos_diff
Precomputed when uploading to the GPU for SPOT_LIGHTs.
mat4 inv_proj
The inverse projection matrix.
vec2 uv
The texture coordinates.
uint8_t fwd_shader
The shader in DYNAMIC_SHADER.
bool sRGB
To load in this Image as sRGB.
int material_count
AnimationTargetType
Animation targets based on type to cast.
@ ANIM_TARGET_BOOL
@ ANIM_TARGET_MAX
@ ANIM_TARGET_VEC3
@ ANIM_TARGET_INT
@ ANIM_TARGET_FLOAT
const char * DVIEW_NAMES[]
Debug view names used for choosing a debug view.
GLint wrap_t
Refer to OpenGL texture loading.
float neck_height
Height from ground to neck.
int h
Dimensions.
uint32_t pad0
float emissive_factor[3]
#define MAX_DIRECTIONAL_LIGHTS
Maxmimum directional Lights at one time (used for shadowmap sizing).
AnimationTrack tracks[64]
The AnimationTracks with individual values that occur simultaneously.
bool multisampled
If this is a multisampled texture.
uint32_t material
The Material ID for this submesh.
char uri[256]
int mesh_node
The MeshNode this island belongs to.
GLTFAnimation * animations
float occlusion_strength
int parent
The index of the parent of this neighbor.
uint32_t pad3
int asset_id
The Asset ID in Globals.assets.
int32_t count
int kf_count
The amount of AnimationKeyframes.
vec3 normal
The normal of the island.
AABB aabb
The AABB over each MeshNode via Asset.
vec3 axis_z
int w
The width of the rect in pixels.
SelectionMode
The selection mode for the editor.
@ SELMODE_TEXTBOX
TextBox.
@ SELMODE_ASSETINSTANCE
AssetInstance.
@ SELMODE_MN
MeshNode.
@ SELMODE_RPROBE
ReflectionProbe.
@ SELMODE_APV
Audio ProbeVolume (APV).
@ SELMODE_LIGHT
Light.
@ SELMODE_ENTITY
Entity.
@ SELMODE_LPV
Lighting ProbeVolume (LPV).
@ SELMODE_UIELEMENT
UIElement.
@ SELMODE_AEM
AudioEmitter.
@ SELMODE_APORTAL
AudioPortal.
Vector tris
size_t indices of the MeshFaces in this island.
GLTFMaterial * materials
char name[256]
mat4 * inverse_bind
The inverse_bind that is computed on load_gltf().
uint16_t spot_light_count
GLTFTexture * textures
int indices[1024]
Indices into EPAWorkspace.faces that describe which faces are still used (when faces are removed they...
int channels
The amount of channels for an Image (RGBA).
AnimationDataType
Indicates what type of structure the animation is targeting.
@ ANIM_DATA_MESH
@ ANIM_DATA_PC
@ ANIM_DATA_RPROBE
@ ANIM_DATA_LIGHT
@ ANIM_DATA_MAX
@ ANIM_DATA_MN
@ ANIM_DATA_ASSET_INSTANCE
@ ANIM_DATA_AC
@ ANIM_DATA_ASSET
@ ANIM_DATA_ENT
uint32_t offset
int texture_count
vec3 world_min
Unused but uploaded to main shader.
vec3 rotation
Current rotation of the spring.
uint32_t pad0
GLenum target
AABB aabb
AABB over each MeshNode for this Asset.
int cubemap_idx
Which cubemap this is linked to.
Globals GLOBALS
Engine Globals.
Definition main.c:310
size_t * node_indices
The indices of MeshNodes spawned from this instance inside of Globals.mesh_nodes.
size_t first_index
The first index that this SubMesh refers to (Mesh.tris count * 3).
bool free
If the component is empty.
#define MAX_MATERIALS
Maximum amount of Materials (used for SSBO sizing).
uint32_t bvh_index
Global: The bvh index + the offset for the current Mesh.
uint64_t arm_handle
bool keyboard_locked
If the keyboard is unlocked to register text events in the editor UI.
int * joints
The joints for skeletal animating.
size_t current_offset
vec3 axis_y
AnimationPath
What an GLTFAnimationChannel is targeting.
@ TARGET_ROTATION
@ TARGET_SCALE
@ TARGET_TRANSLATION
@ TARGET_WEIGHTS
GLTexture depth_texture
The normal depth texture, if there is one.
LPV LOADED_LIGHTING_PV[6]
Load slots for lighting ProbeVolumes.
AnimationTargetType completion_type
Type of data that is modified on completion.
float damp_rot
Dampening for rotation.
GLint min_filter
float damp
Dampening.
Vector reflection_probes
ReflectionProbes in the scene.
uint32_t pad2
Vector lights
Lights.
#define MAX_EPA_VISIBLE_FACES_INDICES
int ssbo_offset
The offset into JOINT_SSBO.
mat4 inv_view
The inverse view matrix.
bool search_suffix
If there is a suffix.
#define LABEL_LEN
The maximum label length of labels in a ComboLabel.
vec3 pos
Position of the foot.
int metallic_roughness_tex
GLenum buffer_target
#define MAX_EPA_VERTICES
int h
The height of the rect in piexles.
uint32_t pad3
int u
The width of the rect in UV space.
GLint wrap_s
Refer to OpenGL texture loading.
uint32_t perm
Which permutation of a shader branch this is.
Vector adjacent_indices
size_t indices.
float probe_spacing
The spacing between lighting probes.
Vector names
The name of each file in the directory.
vec3 forward
APV LOADED_AUDIO_PV[4]
Load slots for Audio ProbeVolumes.
mat4 unjittered_proj
The projection matrix without TAA jittering.
FullscreenOptions
Fullscreen options.
@ FSOPT_MAX
@ FSOPT_WINDOWED
@ FSOPT_BORDERLESS
@ FSOPT_FULLSCREEN
uint8_t opaque
How opaque a Material is.
size_t visible_faces_count
The amount of visible faces found.
uint32_t * mesh_light_indices
Buffer used when calling determine_light_visibility_per_mesh.
uint32_t pad1
int success
If the rect was allocated.
#define PARTITION_BUFFERS
The amount of audio partition back buffers.
vec2 uv
The Font atlas coordinates.
float duration
The duration of all of the AnimationKeyframes.
char frag_path[256]
Path to fragment shader.
void * data
Stored pointer to data to change during animation.
MenuNames
The Editor menu names rendered in editor/editor.c.
@ MENU_MN
@ MENU_MAIN
@ MENU_ENT
@ MENU_UI
@ MENU_MATERIAL
@ MENU_LIGHT
@ MENU_LPROBE
@ MENU_AINST
@ MENU_TEXT
@ MENU_MAX
@ MENU_AUDIO
vec3 q_right
The current knee position for right leg.
Camera LIGHT_CAM[4]
DIRECTIONAL_LIGHT Cameras for shadowmaps
Definition main.c:323
vec3 world_size
Unused but uploaded to main shader.
uint32_t is_static
If the mesh is not static it is not considered for path tracing.
int path_count
The final path count.
uint16_t mesh_id
The Mesh.
Vector lighting_probe_volumes
All of the lighting probe volumes, regardless of if they have been loaded yet.
char name[256]
The name of the skin from load.
uint32_t pad1
float upper_leg_length
Upper leg length.
char vert_path[256]
Path to vertex shader (or compute shader).
uint32_t pad1
uint32_t state
The current UIState.
const char * PPDVIEW_NAMES[]
Postprocess debug view names used for choosing.
uint32_t pad0
bool free
If the Entity is empty.
float radius
The radius of the Player body.
uint32_t pad2
MeshFace faces[1024]
The faces of the current polyhedron.
TriGPU * tris
struct RProbeUBO::Align16 probe_indices[4]
TriggerType type
char name[256]
ivec2 directional_lights
GLTFSampler * samplers
GLTFSkin * skins
struct AssetInstance * instance
The AssetInstance that spawned this Entity.
int texture_count
The amount of GLTextures bound.
MaterialGPU materials[256]
uint32_t mesh_node_id
const ivec3 DEFAULT_APV_RES
When APVs are spawned, they use this.
GLsizei levels
Vector audio_probe_volumes
All of the AudioProbe% volumes, regardless of if they have been loaded yet.
Vector mesh_indices
int - Indices into Globals.meshes which indicate what Meshes are within this Asset.
GLTFAnimationSampler * samplers
uint32_t mesh_id
The Mesh id.
GLsizei vertex_size
uint64_t sort_key
The key that is sorted in create_and_sort_draw_commands().
uint32_t double_sided
MSAASampleOptions
MSAA options handled in render_main_menu().
@ MSAA_2
@ MSAA_4
@ MSAA_16
@ MSAA_SAMPLE_OPTIONS_MAX
@ MSAA_8
GLint mag_filter
Refer to OpenGL texture loading.
size_t node_count
The amount of MeshNodes in this instance.
size_t material
The Material.
GLTFPrimitive * prims
int bufferCount
void * buffer_override_data
size_t data_byte_offset
The byte offset in the structure we are targeting.
vec2 center
The center of the TextBox before transform (should be 0,0 if justified center).
float g
The g score: current score of the path.
vec3 normal
The normal.
GLTexture texture[6]
The textures bound to this fbo.
vec2 uv
The texture coordinates for the actual face's GLTexture.
GLint mag_filter
uint16_t point_light_offset
Vector images
Images.
vec3 q_left
The current knee position for left leg.
bool stepping
If the leg is currently stepping.
size_t data_index_offset
The index of the structure we are targeting.
PostprocessDView
Postprocess debug view shader branches.
@ PPDVIEW_LM
@ PPDVIEW_DEPTH
@ PPDVIEW_MAX
@ PPDVIEW_DEFAULT
@ PPDVIEW_BOKEH
@ PPDVIEW_VEL
vec3 target
#define MAX_EPA_INDICES
bool stepping_off_ledge
If the leg is over air.
vec3 center
size_t id
The ID in ASSET_INSTANCES.
MeshNode * nodes
uvec2 directional_lights
Directional Lights count and offset.
Vector min_heap
OpenNode - the heap of nodes that are pushed and popped until there are none left or it reaches the e...
int current_run
The current run indicates what AStarStateStack entries we can use.
size_t uv_island
What island inside of LightmapData.islands that this MeshFace refers to.
size_t first_skin
Refer to todo.
HorizonEdge horizon_edges[1024]
The amount of unique edges that are not shared between visible faces.
uint16_t skin_offset
The offset into JOINT_SSBO.
unsigned char * buf
If available, the raw bytes of the Image.
const char * FULLSCREEN_OPTION_NAMES[]
Fullscreen option names.
char name[256]
The name of the Image file.
mat4 view
The view matrix.
char APV_PATH[256]
Path to binary file with Audio ProbeVolumes.
float pitch
Entity * ent
The pointer to the Entity.
Vector materials
Materials.
DebugView
Enum for debug views that are ubershader branches.
@ DVIEW_CLUSTERS
@ DVIEW_POM_VDIR
@ DVIEW_LM_DIRECTIONAL
@ DVIEW_AO
@ DVIEW_INDIRECT
@ DVIEW_NORMAL
@ DVIEW_DEFAULT
@ DVIEW_ALBEDO
@ DVIEW_RPROBE
@ DVIEW_SPECULAR
@ DVIEW_ARM
@ DVIEW_DIRECT
@ DVIEW_ORIGINAL_NORMAL
@ DVIEW_LM_IRRADIANCE
@ DVIEW_EMISSIVE
@ DVIEW_MAX
@ DVIEW_UV
uint32_t visibility[512 *1024]
#define MAX_ANIMATION_INDICES
The maximum amount of animation indices per GLTFSkin.
GLTFBufferView * views
mat4 unjittered_inv_proj
The inverse projection matrix without TAA jittering.
BVHNodeGPU * nodes
mat4 * final_mat
The transformation after update_skin_matrices().
Vector assets
Assets.
GLuint64 handle
The handle for the bindless texture.
uint32_t sm_id
The SubMesh.
char name[256]
float absorption_coefficients[6]
int track_count
The amount of AnimationTracks.
GLTFAnimationChannel * channels
AABB aabb
AABB over the entire scene.
uint32_t vertex_offset
Where the VertexGPUs for this Mesh start in the SSBO.
float time
The current time to linearly interpolate between start and target pos.
State * state
The current State that describes actions for this Entity.
int * path
The path indices that are returned.
uint32_t vertex_count
How many VertexGPUs this Mesh has.
char name[256]
Name of the shader.
vec3 normal
size_t current_index_offset
bool sample_cubemap
Unused - was used to toggle skybox sampling.
GLuint i
The handle for the texture.
GLenum buffer_usage
float hip_height
Height from ground to hip.
VertexGPU v0
LightType light_type
PhysicsComponent * pc
The PhysicsComponent inside of PHYSICS_COMPONENTS.
uint32_t instance_count
Used to be used to find the instance being rendered, but now that's on the transform data itself.
size_t node_count
Animation * animations
uint32_t lm_offset
The lightmap offset into LIGHTMAP_SSBO where this mesh node starts.
size_t * indices
The indices sorted when initialized.
uint32_t pad3
uint32_t skin_offset
The GLTFSkin matrix offset for this transform.
vec3 target_pos
Target position for the current step.
char mime_type[256]
float pelvis_height
Height from ground to pelvis.
char suffix[256]
The suffix to append to the end of the file when searching.
size_t id
ID inside of ENTITIES.
int pv_id
The ProbeVolume in SceneData.lighting_probe_volume.
AABB aabb
The bounding box over all MeshNodes for this Entity.
Vector nodes
Each node of the BVH.
GLsizei w
int32_t parent
VertexGPU * vertices
float inner_angle
bool LOADED_LIGHTING_PV_FLAG[6]
Flags that indicate if the slot is loaded.
char directory[256]
Path to directory for the file.
vec4 cam_vel
The velocity of the Camera (padded).
int32_t right
float scattering_coefficients[6]
GLsizei h
float emissive_strength
LegIK left_leg
Left leg.
uint32_t pad2
uint32_t element_offset
The offset into INDIRECT_ELEMENTS_COMMAND_BUFFER.
uint64_t normal_handle
int ibm_accessor
Which GLTFAccessor this refers to.
vec2 pos
The position.
void * val
Vector skins
GLTFSkins.
uint32_t mesh_id
char path[256]
The path to the Asset.
AnimationInterpolation
Types of Animation interpolation.
@ CUBICSPLINE
@ STEP
@ LINEAR
vec3 pos
Position of the spring.
GLTFAccessor * accessors
float f
The f score: score from neighbor to end.
GLuint fbo
The handle for this fbo.
uint16_t directional_light_offset
bool free
If this skin is free.
#define MAX_INSTANCES
Maximum amount of TransformGPU instances to push in one frame (used for SSBO sizing).
uint32_t pad3
float yaw
EntityType
Types of Entity used for Filters.
@ ENTITY_FILTER
@ ENTITY_NONE
@ ENTITY_TRIGGER
uint32_t entity_id
vec3 normal
The normal.
unsigned char * data
float intensity
size_t uv_idx
The UV slot on the UVIsland.
float outer_angle
uint32_t index_count
How many indices in this SubMesh.
GBufferTextureNames
Gbuffer textures.
@ GNORMAL
@ GPOMDEPTH
@ GVEL
@ GUV
@ GALBEDO
@ GEXTRA
AnimationDataType data_type
The type of data that is changed during animation.
size_t vertex_count
The amount of Points that this SubMesh refers to.
#define MAX_MESH_NODES
Maximum MeshNodes in a scene (used for SSBO sizing).
union AnimationKeyframe::@243377164052067242366020157201307241363031166101 val
GLuint location
uvec3 indices
Unused - the indices of each point.
mat4 proj
The projection matrix.
uint32_t layer
size_t horizon_counts_count
The amount of horizon counts.
Camera * cam
Player Camera.
GLTFBuffer * buffers
GLTFAnimationChannel * channels
size_t vertices_count
The amount of vertices.
uint8_t gbuffer_shader
The shader for the DEPTH_PRE_PASS_SHADER.
float focal_distance
The current focal distance found via compute shader, transported via this ssbo to coc.
CamData cam_data
bool valid
If this mapping is valid.
char name[256]
int padding
How much padding to avoid light leaking.
uint32_t pad1
float duration
The duration of the entire step.
void(*) fn(void *)
mat4 inverse_global_matrix
vec2 lm_uv
The texture coordinates for the LightmapAtlas.
vec3 left_hip_pos
The left hip pos, offset by left_leg_offset.
uint64_t emissive_handle
char path[256]
The path to the Image.
uint32_t pad2
vec3 target
Where the spring wants to move to based on Skeleton positions, before velocity is integrated.
uint32_t tri
size_t draw_offset
Currently the same index as SubMesh.lm_offset.
LightmapData lightmap_data
The loaded lightmap and lightmap configuration for the scene.
void * completion_data
Pointer to the data that is modified on completion.
float roughness_factor
vec3 axis_x
uint16_t point_light_count
size_t * bvh_indices
char name[256]
Modifiable name of the scene.
uint32_t pad0
uint32_t bvh_index
The BVH index for this Mesh in the scene BVH.
size_t indices_count
The amount of indices on init (some lights are omitted).
vec4 tangent
The tangent for TBN construction.
AnimationTargetType type
The type of the data stored on AnimationKeyframe.
bool active
If this animation is currently running.
size_t current_index_capacity
char mime_type[256]
Unused, refer to GLTF spec.
int current_selection
The file that is currently selected (starts at 0).
int samples
If multisampled, how many samples.
Vector islands
The UVIslands on the current lightmap.
int animation_count
int msaa_samples
How many samples our multisampled textures are using.
float current_time
How long the animation has been running.
Uniform uniforms[32]
Uniforms for shader data.
vec4 border_color
bool noclip
Enables flying (but not collisions).
uint32_t pad1
vec4 cam_pos
The position of the Camera (padded).
AStarStateStack * stack
The stack that tracks where each node connects so that it can be backtracked.
size_t current_capacity
Spring pelvis
Pelvis Spring (target based on leg positions).
GLTFImage * images
LightmapRect rect
The rect that this island allocates.
uint32_t pad2
vec3 target_rot
Where the spring is facing based on Skeleton positions.
GLRenderbuffer depth_rbo
The renderbuffer depth texture, if there is one.
float f
The f score: score from neighbor to end.
uint32_t bvh_index
float pelvis_hip_diff
Height from pelvis to hip.
#define MAX_KEYFRAMES
Maximum AnimationKeyframes in an AnimationTrack.
uint32_t tri_count
How many TriGPUs there are for this Mesh.
size_t * skin_indices
The indices of GLTFSkins spawned from this instance inside of Globals.skins.
uint32_t node_count
How many BVHNodes are in this Mesh.
bool currently_rasterizing
If we are going to rasterize this island on the next lightmap bake.
LightmapAtlas atlas
The atlas settings for the lightmap.
float emissive_strength
The GPU side structure of an AABB, used for path traced baking.
A running stack of nodes in a path that tracks where they came from so they can be retraced at the en...
The workspace for conducting a-star pathfinding/.
The structure of an Skeletatal Animation loaded in from GLTFAnimation.
The animation component for interpolation between AnimationKeyframes.
Tagged union for the value stored in a keyframe.
Engine-side sampler version of GLTFAnimationSampler with the field allocated.
Tagged union for the value stored in a keyframe.
An Asset after it is loaded in from file into Globals.assets.
A instance of an Asset that retains its node structure but can be duplicated into multiple instances ...
The GPU side structure for the SSBO of BVHNodes.
The GPU side structure of a BVHNode, used for path traced baking.
Biquad filter.
The structure uploaded to the GPU for providing render data for a Camera.
The camera structure for players and entities.
The structure for cluster AABBs for clustered shading.
The structure that we push clusters to when we cull them in clustered shading.
The structure used for debug wireframes.
The structure used to sort unique submeshes by materials, and shaders in the main render pass.
A workspace used for EPA during collision detection.
Entity structure that holds components and references to the data it owns.
Registry for folders that are used for dropdowns in the editor UI.
Filters to be used for filtering out entities for triggers.
The abstraction for a framebuffer in OpenGL.
The abstraction for a renderbuffer in OpenGL.
The accessors of a GLTF file.
The GLTF structure of an Animation.
The channels of an Animation.
The individual interpolation of an Animation.
The raw bytes of a GLTF file.
The views of a GLTF file.
The entire GLTF after it is parsed via load_gltf().
The Image before it is processed.
The structure for Materials when loaded in from file.
The Meshes of a GLTF file.
The primitives of a GLTF file.
The sampler for the Image before it is processed.
The structure of an Skeletatal Animation loaded in from GLTFAnimation.
The GLTFTexture before it is processed.
Texture abstraction for init.
The global visibility buffer that holds all indices to instances per frame after they are pushed duri...
Global settings and structures for each system in the engine.
Where Material textures are saved upon loading from file.
Simply the size we use to allocate the INSTANCE_VBO (unused).
A ProbeVolume for indirect lighting probes.
The controller for leg IKs for Skeletons.
The BVH for Lights.
The GPU side structure for Lights padded for GPU.
The atlas that UVIslands are allocated on in LightmapRects during UV lightmapping.
The metadata for the lightmap settings.
The structure that stores lightmap uvs.
The rects that are slotted into thet LightmapAtlas during UV generation for UV lightmaps.
The structure for the LIGHTMAP_SSBO.
The structure used when rasterizing lightmap data to a texture before baking.
Main rendering vertex.
The GPU side SSBO structure.
The GPU side padded structure for Materials.
The GPU side structure for the SSBO of Meshs.
The GPU side structure of a Mesh, used for path traced baking.
MeshNode structure padded for GPU (MESH_NODE_SSBO).
MeshNode buffer structure for MESH_NODE_SSBO.
GPU side structure for an OBB.
A node inside of the min_heap of an AStarWorkspace.
The Player.
GPU side structure for an OBB UBO.
The structure for RProbes sent to the GPU.
The UBO structure for pushing the closest ReflectionProbes to the main shader.
ReflectionProbes used for parallax corrected cubemaps.
The structure uploaded to the GPU for providing the current resolution (fairly unused).
Used to store SH coefficients when baking LPVs into ProbeVolumes.
The data for the current scene.
OpenGL ShaderPrograms: vertex, fragment, geometry, and compute.
The structure used for uploading matrices for directional Lights used when rendering shadowmaps.
The controller for leg IKs for Skeletons.
The spring used for determining Skeleton positions and eventually neck trajectory.
Entity States that control what functions are available for an Entity.
Sections of Meshes that are divided based on Material for batching and DrawCommand ordering purposes.
The structure used for rendering TextBoxes.
TransformGPU buffer structure for INSTANCE_SSBO.
The GPU side structure for the SSBO of MeshFaces.
The GPU side structure of a MeshFace, used for path traced baking.
Adjacent triangles for each MeshFace on a Mesh.
Triggers that cause events or persisting effects.
The UVIslands that are generated from contiguous MeshFaces with similar planes for UV lightmapping.
This bridges from MeshNode's MeshFaces to their respective UVIslands.
OpenGL shader Uniforms.
The GPU side structure for the SSBO of Points.
The GPU side structure of a Point, used for path traced baking.
An unused abstraction for VertexLayouts.
fftwf_plan bwd_plan
Inverse plan used when convolving IR with current audio stream.
float * PREV_LEFT_OUT
Contains the output of the inverse FFT of the previous IR with current audio stream.
float abs_energy[6]
The energy per band with only absorption and no scattering.
float * IR_ROT[9]
The IR with rotated SH.
fftwf_complex * STATIC_HRTF_R_FWD[9]
The forward FFT of the static HRTF loaded from HRTF.bin.
fftwf_complex * PREV_SUM_L
The complex multiply of the previous IR with the partitions.
float time_of_flight
The time that it takes for the sample to reach this position in total dist + dist to probe.
int tail_len
Currently: = block_size.
PartitionTable tables[4]
The partitions for overlap-add quad-buffered.
fftwf_plan fwd_plan
Forward plan used when convolving IR with current audio stream.
PartitionTable * FRONT
The current partition presented to the audio thread.
fftwf_plan IR_bwd_plan
Inverse plan used when convolving IR with HRTF.
vec3 last_pos
The last job's position.
ma_node_base base
miniaudio node base.
bool crossfading
Indicates if it is still crossfading between an old and new IR.
AudioProbe * audio_probes
The probes in the volume, loaded in from binary.
PartitionTable * ir
The pointer to the new IR to convolve with.
float * PREV_RIGHT_OUT
Contains the output of the inverse FFT of the previous IR with current audio stream.
int probes[4]
The indices of the AudioProbes.
ma_mutex lock
Unused mutex for the audio thread.
int complex_ir_len
(padded_len / 2) + 1
bool new_probe_ready
If a new job is ready.
fftwf_complex * PREV_SUM_R
The complex multiply of the previous IR with the partitions.
float(* final_ir)[9]
The baked IR samples by 9 SH.
fftwf_complex * MONO_FWD
Contains the output of the forward FFT of IR with current audio stream.
bool stop_requested
Used to quit gracefully.
fftwf_plan static_fwd_plan
Unusued - was used when parsing in sofas.
float * HRTF_IR_IN
Buffer used when splitting IR into partitions.
vec3 arrival_dir
The direction the ray was traveling to this position.
fftwf_complex * IR_SUM_L_FWD
Used to accumulate the complex multiply of IR with the HRTF.
fftwf_complex * IR_ROT_FWD[9]
The forward FFT of the rotated IR.
float * STATIC_HRTF_L[9]
The static HRTF loaded from HRTF.bin.
float rt60[6]
The RT60 from schroeder integration.
float * RIGHT_OUT
Contains the output of the inverse FFT of the new IR with current audio stream.
vec3 pos
The hit position.
fftwf_plan bwd_plan
Unusued - was used when parsing in sofas.
int padded_len
Currently 1024.
ivec3 resolution
The resolution in X, Y, Z.
int complex_len
(padded_len / 2) + 1
float * IR_SUM_R
Used to hold the output of the inverse FFT of the IR with the HRTF.
size_t size
The byte size of this volume.
float * IR_SUM_L
Used to hold the output of the inverse FFT of the IR with the HRTF.
size_t byte_offset
The byte offset into the binary file storing this volume.
float * PREV_TAIL_RIGHT
Contains the tail of the previous IR.
float energy[6]
The energy per band.
fftwf_complex * SUM_R
The complex multiply of the new IR with the partitions.
SDL_mutex * mutex
The mutex used when signalling a job.
int pv_id
Which ProbeVolume in SceneData.audio_probe_volumes.
OBB obb
The OBB that defines the size.
float slope[6]
The slope from EDC.
float * TAIL_RIGHT
Contains the tail of the new IR.
uint32_t valid
If it is occluded then it is not valid.
size_t ir_length
The amount of IR samples for this probe.
int block_size
Currently 512.
fftwf_plan IR_fwd_plan
Forward plan used when convolving IR with HRTF.
SDL_mutex * aprobe_mutex
Used when loading new APVs to avoid concurrency with the HRTF thread.
float weights[4]
The weights that correspond to each probe's value.
vec3 last_fwd
The last job's direction.
fftwf_complex * SUM_L
The complex multiply of the new IR with the partitions.
float * PREV_TAIL_LEFT
Contains the tail of the previous IR.
vec3 pos
The world position of this probe.
int complex_len
(padded_len / 2) + 1
int ir_len
MAX_IR_SAMPLES + hrtf_length - 1 and rounded up to next power of 2.
PartitionTable * prev_ir
The pointer to the previous IR we were convolving with.
int APV_id
Which APV these probes belong to.
float * STATIC_HRTF_R[9]
The static HRTF loaded from HRTF.bin.
fftwf_complex * IR_SUM_R_FWD
Used to accumulate the complex multiply of IR with the HRTF.
float * TAIL_LEFT
Contains the tail of the new IR.
fftwf_complex * AUDIO_HISTORY[96]
Contains the history of MONO_FWD up to NUM_PARTITIONS_MAX.
SDL_SpinLock ir_swap_lock
The spinlock used when presenting an IR to the audio thread.
int block_size
Currently 512.
int count
The amount of probes that were sampled.
fftwf_complex * STATIC_HRTF_L_FWD[9]
The forward FFT of the static HRTF loaded from HRTF.bin.
fftwf_plan fwd_plan
The plan used when splitting IR into partitions.
int padded_len
Currently 1024.
int crossfade_pos
The amount of samples crossfaded so far.
int history_head
Contains the current position in the audio history buffer.
AudioProbeWeights w
Current job's weights.
float * LEFT_OUT
Contains the output of the inverse FFT of the new IR with current audio stream.
SDL_cond * work_cond
The job signal.
SDL_Thread * t
The thread object.
int final_ir_len
MAX_SAMPLES + hrtf_length - 1.
#define NUM_PARTITIONS
Amount of max partitions to be used for overlap-add.
#define SH_MAX
#define MAX_INTERP_APROBES
Max AudioProbes that can be sampled at once.
PartitionTableChannel PartitionTable[2]
Type for two channels (stereo) for overlap-add.
fftwf_complex * PartitionTableChannel[95]
Type for one FFT partiton for overlap-add.
#define AUDIO_NUM_BANDS
The amount of bands to use for audio probe baking.
const float AUDIO_BAND_FREQ[]
Audio frequencies for each band for audio probe baking.
#define NUM_PARTITIONS_MAX
Amount of max partitions to be used for overlap-add for audio probes + 1 for the tail trick.
A ProbeVolume for AudioProbes.
Baked IR samples loaded in from binary into APVs from ProbeVolumes.
Simply stores the positions for audio probes during the bake.
Weights used for interpolating between audio probes.
Each ray's samples when baking AudioProbes, padded for GPU.
Scratch buffers and dimensions used for audio convolution FFTs.
The IR CONVOLVER_NODE used to process frames in the audio thread.
The data for the thread that prepares IRs by rotating then convolving them with an HRTF before it pre...
The ProbeVolumes for APVs and LPVs, controlled by OBBs.
bool is_occludable
If the AudioEmitter can be occluded and needs to go through the AudioPortal system.
ma_lpf_node lpf_node
The low pass filter for this emitter.
Vector adjacent_portals
int - Vector of AudioPortals that can be seen from this one.
uint32_t id
The static ID of the AudioEmitter inside of AUDIO_EMITTERS.
float current_distance
The current distance from listener.
float current_cutoff
The current low pass cutoff.
bool is_loop
If the AudioEmitter loops.
float current_volume
The current volume.
vec3 pos
The position of the AudioEmitter .
vec3 virtual_pos
The position that we spatialize the emitter at (for example: at the corner instead of behind the wall...
char path[256]
The path to the sound.
float base_volume
The starting volume.
vec3 pos
The position of the AudioPortal.
ma_sound sound_obj
The miniaudio sound obj.
bool is_loaded
If the emitter is loaded in miniaudio.
bool free
Indicates if this AudioEmitter is empty or can be replaced.
An AudioEmitter that plays audio possibily from a certain position or at a certain time.
AudioPortals used for determining paths to transmit sound when emitter and listener are occluded.
char buffer[600][256]
int selected_lighting_probe_volume_id
NKSlider aportal_pos[3]
DebugView current_debug_view
int ao_iterations
Controls how many iterations per lightmap iteration perform the AO check.
NKSlider apv_res[3]
NKSlider sensor_height
float rotation_angle
The current angle for rotation operations in the editor.
int selected_rprobe_file_id
float ao_threshold
Controls the distance threshold for AO detection.
int probe_iterations
The amount of iterations to bake each probe.
AABB lm_aabb
The AABB that sizes the current lightmap in world space.
NKSlider ao_threshold
NKSlider res_height
int audio_probe_iterations
The amount of iterations (sample rays) to bake per AudioProbe.
NKSlider texels_per_unit
int lm_iterations
The amount of iterations to bake a lightmap.
int selected_asset_instance_id
float texels_per_uv_unit
Controls the texel density of the uv lightmapper.
float DOF_sensor_height
int selected_audio_probe_volume_id
float reverb_wet
Controls the volume of the reverb signal.
int selected_audio_emitter_id
float DOF_max_blur_radius
NKSlider mfactor_enabled
int item_to_id[600]
int selected_fullscreen_option
float volume
Controls the engine volume.
NKSlider OBB_sliders[9]
NKSlider focal_length
float render_framerate_target
The target framerate for rendering and processing ui events (a cap).
bool lighting_probe_volume_overlay
int res_width
Tracks rendering dimensions in editor menu.
NKSlider probe_iterations
const char * ptrs[600]
bool wireframe_toggled
Shows wireframes around many structures: Lights, ReflectionProbes, AudioProbes, AudioPortals,...
NKSlider lm_iterations
PostprocessDView pp_dview
vec3 rotation_axis
The rotation axis for rotation operations in the editor.
NKSlider ao_iterations
int selected_asset_instance_mn_id
bool mfactor_enabled
Controls how many iterations per lightmap iteration perform the AO check.
NKSlider emitter_pos[3]
int current_fullscreen_option
NKSlider OBB_sliders[9]
SelectionMode SELMODE
bool asset_instance_menu_open
int selected_audio_portal_id
NKSlider blur_radius
bool audio_probe_volume_overlay
size_t undo_stack_max_byte_size
The maximum memory value for the Undo stack.
int audio_probe_bounces
The amount of bounces to accept per AudioProbe iteration.
float mfactor
Controls how many iterations per lightmap iteration perform the AO check.
int selected_material_mn_id
The structure used for some dropdown abstractions in the Editor UI.
Editor settings and engine global variables that can be changed through the editor.
Vector hull_faces
HullFaces that are generated after incremental_hull() that combine contiguous triangles into singular...
CollisionData cd
Tagged union for collision options.
vec3 old_vel
Last step's velocity.
Vector vertices
Points that initially copy the Mesh vertices but then are deduplicated and modified in incremental_hu...
mat3 inverse_world
PhysicsComponent.inverse_inertia transformed by rotation into world space for the current step.
size_t id
The ID in PHYSICS_COMPONENTS.
vec3 normal
The group's normal.
int rest_counter
The counter that decreases until at rest.
int count
The amount of valid contacts.
Vector faces
MeshFaces that initially copy the Mesh faces but then are modified in incremental_hull().
bool processed
Tracks if a Manifold has been processed this frame yet.
bool player_pc
If this is the Player PhysicsComponent.
vec3 vel
Velocity.
vec3 centroid
The center of the hull.
mat3 inverse_inertia
IIA (currently just a calculated box).
AABB aabb
The bounding box of the hull.
bool free
Tracks if a Manifold can be replaced.
PhysicsComponent * a
vec3 accel
Acceleration from this step + acceleration from last step * ACCEL_BETA.
vec3 tangent
The tangent used for frictional impulse resolution.
float mass
Mass of the component.
PhysicsType physics_type
Impulse resolution options.
vec3 a
The bottom of the capsule (based on AABB).
AABB aabb
Bounding box of the PC, determined based on Mesh or MeshNode.
PhysicsComponent * b
PhysicsComponent * pcA
Vector indices
size_t indices of each MeshFace that indexes into ConvexHull.faces.
vec3 angular_velocity
Rotational velocity.
vec3 ref_point
A point on the plane.
float deepest
Current deepest contact for a search.
vec3 * pts
Points to ConvexHull.vertices.
union CollisionData::@341211070342303276310035141141142214214320110321 data
PhysicsComponent * pcB
CollisionPoints contacts[4]
The collision contacts.
bool at_rest
If this component is at rest it does not update.
float d
Length of B-A.
float mu
The friction constant for the component.
HullFace * mfs
Points to ConvexHull.hull_faces.
float radius
The radius of the capsule.
Entity * ent
Which Entity this component belongs to.
size_t face_count
Stored from ConvexHull.hull_faces.count.
vec3 old_angular
Last step's angular velocity.
bool free
If this is an empty component.
vec3 b
The top of the capsule (based on AABB).
size_t count
Stored from ConvexHull.vertices.count.
vec3 a
Furthest point of A into B.
CollisionType type
vec3 center_of_mass
COM based on the AABB.
vec3 normal
The collision normal from B into A.
vec3 b
Furthest point of B into A.
float restitution
The restitution (bounce).
CollisionType
Defines collision types with different behaviors and mesh setup and validation.
PhysicsType
Defines physics types with different behaviors in impulse resolution.
@ COL_CAPSULE
A capsule is constructed via AABB dimensions and is used for collision tests.
@ COL_HULL
Incremental hull generates a ConvexHull which is used for collision tests.
@ COL_TRIANGLE
The triangle BVH is generated for this mesh and triangle tests are performed on it.
@ PHYSICS_GRAVITY_ONLY
Only gravity is applied and cannot be moved via external forces.
@ PHYSICS_NONE
Unused.
@ PHYSICS_NO_ROT
Angular velocity is disabled.
@ PHYSICS_FULL
All impulse resolution options applied.
The capsule data for collisions.
The tagged union for collision type, stored in PhysicsComponent.
Points that track collision data such as direction, penetration depth, and more to generate Manifolds...
Convex Hulls that are generated via incremental hull for non-static meshes.
Hull data that refers to ConvexHulls of Meshes.
Persistent Manifolds that track collisions and how to resolve them.
Entity Component used for physics resolution.
Groups of contiguous triangles with the same plane that are combined via jarvis marching.
uint32_t command_id[32]
float intensity
The intensity of the Light.
int fwd_shader
The corresponding forward rendering shader branch in DYNAMIC_SHADER.
size_t id
The ID inside of Globals.mesh_nodes.
vec3 pos
Position of light.
vec3 translation
int skin
The GLTFSkin it controls.
uint32_t layer
Which layer a DIRECTIONAL_LIGHT corresponds to in the SHADOW_MAP_FBO.
size_t spot_light_count
LightType light_type
The type of Light.
float normal_scale
Unused - Used to determine how much of the texture normal to use.
sampler2D emissive_tex
uint32_t instanceOffset
This tracks how many offsets were pushed in a frame and is used in the prefix sum.
char name[256]
The Material path.
Entity * ent
The Entity this MeshNode refers to (all children point to the same Entity as parent).
float lum
The luminosity for importance sampling.
PhysicsComponent * pc
The physics controller initialized based on data from this MeshNode.
size_t offset
Offset into the MAIN_VBO.
size_t directional_light_count
size_t local_id
The ID local to the original file structure.
bool override_transparent
If we are overriding transparency of this Material.
uint32_t skin_offset
The offset into the JOINT_SSBO, comes from DrawCommand.
vec3 dir
Direction for lights that are not POINT_LIGHTs.
vec3 normal
float inner_angle
Starting angle for SPOT_LIGHTs.
CollisionType collision_type
The type of collision to apply for the PhysicsComponent that may not have been created yet.
float surface_area
The surface area of the triangle.
float power
The power for importance sampling.
char name[256]
The name generated on loading from file.
bool sm_dirty
If a point light needs a new shadowmap.
vec3 center
bool skip_directional_uv_lighting
Skips directional Lights and rays go through them.
int tri
The MeshFace this corresponds to.
float outer_angle
Outer angle for SPOT_LIGHTs.
vec4 ka
Ambient.
size_t point_light_offset
size_t directional_light_offset
bool free
If the MeshNode can be replaced.
int children[128]
The children to this node, a global index into Globals.mesh_nodes.
uint32_t pad1
float cone_angle
Cone angle for SPOT_LIGHTs.
float penumbra
Penumbra (opening) for SPOT_LIGHTs.
mat4 local_matrix
float emissive_strength
vec4 ke
Emissive.
int mesh
The Mesh it references.
int parent
The parent to this node, a global index into Globals.mesh_nodes.
uint32_t pad0
bool active
If the MeshNode can be effected.
PhysicsType physics_mode
The type of physics to apply for the PhysicsComponent that may not have been created yet.
float radius
The radius of the Light.
int mesh
The MeshNode this corresponds to.
bool override_arm
If we override the ARM texture and bind a dummy instead.
int child_count
The amount of children.
sampler2D arm_tex
size_t spot_light_offset
AABB aabb
The AABB of the MeshNode and its children.
int asset_instance
The AssetInstance it belongs to.
sampler2D normal_tex
vec3 rgb
Color of the light.
UVMapping * uv_map
The mapping between MeshNodes and UVIslands for uv lightmapping.
uint32_t pad2
vec4 ks
Specular (unused).
bool static_mesh
If this mesh is static (DrawArrays) or dynamic (DrawElements), used to indicate Lightmap status.
uint32_t mesh_data_id[32]
float threshold
The threshold (how far a light reaches).
AABB area
The physical area of AREA_LIGHTs.
size_t count
Count of vertices pushed into the MAIN_VBO.
int gbuffer_shader
The corresponding gbuffer rendering shader branch in DEPTH_PRE_PASS_SHADER or DEPTH_PRE_PASS_SHADER_M...
int asset
The Asset it comes from.
uint32_t entity_id
Entity ID into ENTITIES.
float alpha_cutoff
Used to discard transparent Materials.
size_t point_light_count
float absorption_coefficients[6]
How much audio is absorbed when hitting this Material.
vec4 kd
Diffuse.
float scattering_coefficients[6]
How much audio specularly reflects when hitting this Material.
DrawArraysIndirect commands are used for static meshes (eg.
The CPU side structure for Lights.
The Materials parsed in from scene files that determine rendering pipeline setup, uploads,...
MeshNodes that describe the position of Meshes, GLTF nodes for GLTFAnimations, or hold references to ...
Oriented Bounding Boxes.
Definition dynamic.frag:14
The structure for ReflectionProbes padded for the GPU.
Vector hulls
The ConvexHulls generated if this Mesh is dynamic.
TriangleAdjacency * tri_adjacency
Adjacent triangles allocated per MeshFace.
size_t id
The ID into Globals.meshes.
size_t asset_id
The Asset ID into Globals.assets.
bool static_mesh
This Mesh is static and must create a BVH or if not it must perform incremental_hull.
size_t * bvh_indices
Indices for the BVH, sorted as the BVH is generated.
AABB aabb
The AABB of the mesh.
size_t count
The count pushed into MAIN_VBO.
Vector submeshes
The SubMeshes split via Materials.
Vector tri_aabbs
AABBs for each triangle inside of this Mesh.
char name[256]
The Mesh name assigned on load.
bool bvh_prim
This Mesh has a BVH computed.
Vector nodes
BVHNodes.
size_t offset
The offset into MAIN_VBO.
Vector tris
The MeshFaces.
Vector vertices
The Points.
A Mesh with geometry data that is either initialized as static or dynamic and split into SubMeshes.
float flux
The total light flux of this node.
int next
The pointer to the next node (either right child or parent's right child) for recursion-less traversa...
int index
The index of the node inside of the array.
int right
Right child.
int parent
Parent.
AABB aabb
The bounding box of all of this node's children.
int left
Left child.
float emissive_flux
The only-emissive flux.
Nodes for the acceleration structures of BVHs.
Definition types.h:14
Definition types.h:15
Definition types.h:16
Definition types.h:20
Definition types.h:21
Definition types.h:17
Definition types.h:18
Definition types.h:11
Definition types.h:12
Definition types.h:13