13#include "SDL2/SDL_mutex.h"
14#include "SDL2/SDL_thread.h"
16#include "nuklear/nuklear.h"
18#include "nuklear/nuklear_sdl_gl3.h"
19#include "miniaudio/miniaudio.h"
21#include "uthash/uthash.h"
37#define MAX_AUDIO_EMITTERS 1024
38#define MAX_AUDIO_EMITTERS_PER_ENTITY 24
68#define PI 3.14159265358979323846
72#define VIEW_FAR 1000.0
80#define MAX_INTERP_APROBES 4
81#define SAMPLE_RATE 48000
83#define IR_SAMPLE_RATE 48000
84#define EDC_SAMPLE_RATE 48000
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
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};
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
116#define MINIMUM_LIGHT_VISIBILITY_DIST 0.01
117#define MAX_LIGHTS_PER_MESH 4
120#define MAX_DRAW_COMMANDS 512
122#define MAX_DIRECTIONAL_LIGHTS 4
124#define MAX_ENTITY_STATES 256
126#define DEFAULT_TEXTURES 5
129#define MAX_UI_MENU_NAMES 128
140 #define EDITOR_LIGHT_SIZE 0.5f
142 #define EDITOR_RPROBE_SIZE 0.5f
144 #define EDITOR_AUDIO_EMITTER_SIZE 0.5f
146 #define EDITOR_APROBE_SIZE 0.1f
148 #define EDITOR_APORTAL_SIZE 0.2f
153#define PERFORMANCE_OVERLAY_TEXT_BOX_COUNT 13
155#define BUFFER_FRAMES 3
157#define UBERSHADER_VERSIONS 17
158#define GBUFFER_VERSIONS 1
160#define MAX_PLAYER_CONTACTS 10
167#define LIGHTMAP_WIDTH 2048
168#define LIGHTMAP_HEIGHT 2048
170#define RPROBE_WIDTH 128
171#define RPROBE_HEIGHT 128
173#define DEFAULT_POINT_LIGHT_SHADOWS_SIZE 128
175#define DEFAULT_SHADOW_MAP_SIZE 2048
177#define FBM_TEXTURE_SIZE 128
182#define MAX_POINT_LIGHT_SHADOWS_CMA 16
186#define MAX_RPROBE_MIPS 1
188#define MAX_RPROBES_PER_FRAME 4
190#define SSAO_KERNEL_SIZE 16
192#define ACCEL_BETA 0.005f
203#define TOTAL_CLUSTERS (GRID_X * GRID_Y * GRID_Z)
204#define MAX_LIGHTS_PER_CLUSTER 12
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)
265 "DVIEW_ORIGINAL_NORMAL",
268 "DVIEW_LM_IRRADIANCE",
269 "DVIEW_LM_DIRECTIONAL",
407#define PARTITION_BUFFERS 4
660 MENU_MAIN,
MENU_MN,
MENU_MATERIAL,
MENU_LIGHT,
MENU_ENT,
MENU_TEXT,
MENU_UI,
MENU_AUDIO,
MENU_LPROBE,
MENU_AINST,
MENU_MAX
1258typedef struct Render
1370#define MAX_RPROBES 256
1542#define MAX_TEX_LABELS 600
1543#define LABEL_LEN 256
2229#define MAX_KEYFRAMES 64
2256#define MAX_TRACKS 64
2357#define MAX_NODE_CHILDREN 128
2735#define MAX_ANIMATION_INDICES 256
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
3005#define MAX_PORTALS 256
Camera cam
This is currently the player cam.
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.
uint8_t static_mesh
If it is a static mesh.
PerformanceQueryTypes
Performance query types used to profile the render loop.
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).
vec3 pos
Currently anchors the Skeleton.
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.
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.
vec3 p_right
The current right foot position.
uint16_t spot_light_offset
ivec4 joint_indices
The indices for each joint matrix (skeletal animations).
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.
vec2 LightmapUV[3]
The lightmap UVs stored on UVIslands per MeshFace.
size_t mesh_data_id
The MeshNodeDataGPU this is assigned to.
bool on_ground
If the camera is on the ground.
size_t faces_count
The amount of faces.
#define MAX_EPA_HORIZON_COUNTS
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.
Vector mesh_nodes
MeshNodes.
bool free
Indicates an empty slot in ASSET_INSTANCES.
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.
uint32_t tri_idx
Local: The bvh index for this MeshFace.
AnimationInterpolation interpolation
LightType
Enum for types of Lights.
#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.
#define MAX_MESHES
Maximum Meshes in a scene (used for SSBO sizing).
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.
mat4 tr
The Transform's matrix.
int tri_id
The ID of the MeshFace.
DepthMode
The depth modes for initializing depth textures.
AnimationKeyframe kf[64]
The AnimationKeyframes for this track.
GLint min_filter
Refer to OpenGL texture loading.
uint8_t material
The Material ID into Globals.materials.
int i
The index into the array of whatever is being traversed.
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.
union Entity::@176104171171243366236114066074167027016130272210 as
mat4 matrix
The transformation matrix of the MeshNode.
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.
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.
size_t horizon_edges_count
The amount of horizon edges.
#define PROBE_VOLUME_WIDTH
uint32_t uID
The ID in the TEXT_BOX_SSBO.
uint32_t mn_id
The MeshNode this belongs to.
GLRenderbuffer renderbuffers[6]
The renderbuffers bound to this fbo.
PostprocessToggles
Postprocess options.
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.
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.
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.
vec3 p_left
The current left foot position.
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.
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.
int width
Width of the atlas.
float g
The g score: current score of the path.
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.
bool LOADED_AUDIO_PV_FLAG[4]
Flags that indicate if the slot is loaded.
#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.
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.
LegIK right_leg
Right leg.
uint32_t command_id
The DrawCommand this refers to.
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.
char geom_path[256]
Path to geometry shader.
bool sprinting
Currently unused flag for sprinting.
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.
AnimationTargetType
Animation targets based on type to cast.
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.
#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.
int mesh_node
The MeshNode this island belongs to.
GLTFAnimation * animations
int parent
The index of the parent of this neighbor.
int asset_id
The Asset ID in Globals.assets.
int kf_count
The amount of AnimationKeyframes.
vec3 normal
The normal of the island.
AABB aabb
The AABB over each MeshNode via Asset.
int w
The width of the rect in pixels.
SelectionMode
The selection mode for the editor.
@ SELMODE_TEXTBOX
TextBox.
@ SELMODE_ASSETINSTANCE
AssetInstance.
@ SELMODE_RPROBE
ReflectionProbe.
@ SELMODE_APV
Audio ProbeVolume (APV).
@ 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.
mat4 * inverse_bind
The inverse_bind that is computed on load_gltf().
uint16_t spot_light_count
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_ASSET_INSTANCE
vec3 world_min
Unused but uploaded to main shader.
vec3 rotation
Current rotation of the spring.
AABB aabb
AABB over each MeshNode for this Asset.
int cubemap_idx
Which cubemap this is linked to.
Globals GLOBALS
Engine Globals.
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.
bool keyboard_locked
If the keyboard is unlocked to register text events in the editor UI.
int * joints
The joints for skeletal animating.
AnimationPath
What an GLTFAnimationChannel is targeting.
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.
Vector reflection_probes
ReflectionProbes in the scene.
#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
int h
The height of the rect in piexles.
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.
APV LOADED_AUDIO_PV[4]
Load slots for Audio ProbeVolumes.
mat4 unjittered_proj
The projection matrix without TAA jittering.
FullscreenOptions
Fullscreen options.
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.
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.
vec3 q_right
The current knee position for right leg.
Camera LIGHT_CAM[4]
DIRECTIONAL_LIGHT Cameras for shadowmaps
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.
float upper_leg_length
Upper leg length.
char vert_path[256]
Path to vertex shader (or compute shader).
uint32_t state
The current UIState.
const char * PPDVIEW_NAMES[]
Postprocess debug view names used for choosing.
bool free
If the Entity is empty.
float radius
The radius of the Player body.
MeshFace faces[1024]
The faces of the current polyhedron.
struct RProbeUBO::Align16 probe_indices[4]
struct AssetInstance * instance
The AssetInstance that spawned this Entity.
int texture_count
The amount of GLTextures bound.
MaterialGPU materials[256]
const ivec3 DEFAULT_APV_RES
When APVs are spawned, they use this.
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.
uint64_t sort_key
The key that is sorted in create_and_sort_draw_commands().
MSAASampleOptions
MSAA options handled in render_main_menu().
@ MSAA_SAMPLE_OPTIONS_MAX
GLint mag_filter
Refer to OpenGL texture loading.
size_t node_count
The amount of MeshNodes in this instance.
size_t material
The Material.
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.
GLTexture texture[6]
The textures bound to this fbo.
vec2 uv
The texture coordinates for the actual face's GLTexture.
uint16_t point_light_offset
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.
bool stepping_off_ledge
If the leg is over air.
size_t id
The ID in ASSET_INSTANCES.
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.
Entity * ent
The pointer to the Entity.
Vector materials
Materials.
DebugView
Enum for debug views that are ubershader branches.
uint32_t visibility[512 *1024]
#define MAX_ANIMATION_INDICES
The maximum amount of animation indices per GLTFSkin.
mat4 unjittered_inv_proj
The inverse projection matrix without TAA jittering.
mat4 * final_mat
The transformation after update_skin_matrices().
GLuint64 handle
The handle for the bindless texture.
uint32_t sm_id
The SubMesh.
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.
size_t current_index_offset
bool sample_cubemap
Unused - was used to toggle skybox sampling.
GLuint i
The handle for the texture.
float hip_height
Height from ground to hip.
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.
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 skin_offset
The GLTFSkin matrix offset for this transform.
vec3 target_pos
Target position for the current step.
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.
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).
float scattering_coefficients[6]
uint32_t element_offset
The offset into INDIRECT_ELEMENTS_COMMAND_BUFFER.
int ibm_accessor
Which GLTFAccessor this refers to.
char path[256]
The path to the Asset.
AnimationInterpolation
Types of Animation interpolation.
vec3 pos
Position of the spring.
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).
EntityType
Types of Entity used for Filters.
size_t uv_idx
The UV slot on the UVIsland.
uint32_t index_count
How many indices in this SubMesh.
GBufferTextureNames
Gbuffer textures.
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
uvec3 indices
Unused - the indices of each point.
mat4 proj
The projection matrix.
size_t horizon_counts_count
The amount of horizon counts.
Camera * cam
Player Camera.
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.
bool valid
If this mapping is valid.
int padding
How much padding to avoid light leaking.
float duration
The duration of the entire step.
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.
char path[256]
The path to the Image.
vec3 target
Where the spring wants to move to based on Skeleton positions, before velocity is integrated.
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.
uint16_t point_light_count
char name[256]
Modifiable name of the scene.
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 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.
bool noclip
Enables flying (but not collisions).
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.
Spring pelvis
Pelvis Spring (target based on leg positions).
LightmapRect rect
The rect that this island allocates.
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.
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.
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.
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 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.
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.
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.
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.
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 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.
int selected_lighting_probe_volume_id
DebugView current_debug_view
int ao_iterations
Controls how many iterations per lightmap iteration perform the AO check.
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.
int audio_probe_iterations
The amount of iterations (sample rays) to bake per AudioProbe.
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.
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
int selected_fullscreen_option
float volume
Controls the engine volume.
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
int selected_ui_action_id
bool wireframe_toggled
Shows wireframes around many structures: Lights, ReflectionProbes, AudioProbes, AudioPortals,...
int selected_gltf_file_id
int selected_ui_element_id
PostprocessDView pp_dview
vec3 rotation_axis
The rotation axis for rotation operations in the editor.
int selected_asset_instance_mn_id
bool mfactor_enabled
Controls how many iterations per lightmap iteration perform the AO check.
int current_fullscreen_option
bool asset_instance_menu_open
int selected_audio_portal_id
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.
NKSlider sliderscrollscale
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 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.
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.
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
CollisionPoints contacts[4]
The collision contacts.
bool at_rest
If this component is at rest it does not update.
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.
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_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.
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.
int skin
The GLTFSkin it controls.
uint32_t layer
Which layer a DIRECTIONAL_LIGHT corresponds to in the SHADOW_MAP_FBO.
LightType light_type
The type of Light.
float normal_scale
Unused - Used to determine how much of the texture normal to use.
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.
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.
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.
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.
float cone_angle
Cone angle for SPOT_LIGHTs.
float penumbra
Penumbra (opening) for SPOT_LIGHTs.
int mesh
The Mesh it references.
int parent
The parent to this node, a global index into Globals.mesh_nodes.
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.
AABB aabb
The AABB of the MeshNode and its children.
int asset_instance
The AssetInstance it belongs to.
vec3 rgb
Color of the light.
UVMapping * uv_map
The mapping between MeshNodes and UVIslands for uv lightmapping.
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.
float absorption_coefficients[6]
How much audio is absorbed when hitting this Material.
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 ...
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.
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.
AABB aabb
The bounding box of all of this node's children.
float emissive_flux
The only-emissive flux.
Nodes for the acceleration structures of BVHs.