|
Untitled
|
#include <GL/glew.h>#include <assert.h>#include "SDL2/SDL_timer.h"#include "core/camera.h"#include "utilities/mathf.h"#include "load/init.h"#include "utilities/types.h"#include <float.h>#include <math.h>#include <stdio.h>#include <string.h>#include "ui/ui.h"#include "utilities/utilities.h"#include "render/render.h"#include "utilities/engine_utilities.h"#include "core/engine_types.h"#include "core/animation.h"#include "ui/fonts.h"Go to the source code of this file.
Data Structures | |
| struct | UIUIDPair |
Macros | |
| #define | MAX_MESHES_PER_PT_LIGHT_SHADOW 32 |
Functions | |
| void | bind_baking_ssbos () |
| Binds SSBOs required for baking. | |
| void | unbind_baking_ssbos () |
| Unbinds SSBOs required for baking. | |
| void | bind_render_ssbos () |
| Binds SSBOs required for rendering. | |
| size_t | fill_buffer_with_mesh_tri (Mesh *mesh, MainVertex *verts, size_t offset) |
| size_t | fill_vertex_buffer_mesh (Mesh *mesh, MainVertex *verts, size_t offset, size_t *lm_offset) |
| size_t | fill_index_buffer_mesh (Mesh *mesh, uint32_t *indices, size_t vertex_offset, size_t offset, size_t *lm_uv_offset) |
| size_t | calc_mesh_size (Mesh *m) |
| size_t | calc_mesh_index_size (Mesh *m) |
| void | add_mesh_to_buffer (Mesh *m, VertexLayout *layout) |
| Adds a single Mesh to the MAIN_VBO. | |
| size_t | allocate_lightmap_ssbo () |
| void | add_all_meshes_to_buffer (VertexLayout *layout) |
| Adds all Meshes that have valid MeshNodes. | |
| void | aabb_to_vertices (DebugVertex *out, AABB *aabb, vec3 offset) |
| Transfers an AABB to DebufVertex for a wireframe (GL_LINES). | |
| void | render_mesh_aabbs_from_root (MeshNode *mn) |
| Adds Mesh AABBs for each MeshNode child recursively to DEBUG_LINES. | |
| void | obb_to_vertices (DebugVertex *out, OBB *obb) |
| void | copy_light_to_gpu_light (LightGPU *lgpu, Light *l) |
| Transfers a Light to a LightGPU. | |
| void | upload_lights () |
| Uploads all current Lights inside of Globals.lights to the GPU in a triple buffered LIGHT_SSBO. | |
| void | determine_light_visibility_per_mesh () |
| void | upload_joint_matrices () |
| void | update_node_global (MeshNode *nodes, int idx, mat4 parent) |
| void | update_scene_nodes () |
| void | update_skin_matrices () |
| void | upload_material_data () |
| Uploads Material data to the GPU as MaterialGPU. | |
| void | get_view_planes (vec4 planes[6], Camera *cam) |
| bool | aabb_in_frustum (vec3 min, vec3 max, vec4 planes[6]) |
| void | determine_mesh_visibility (Camera *camera, size_t *meshes_frame, size_t *meshes_frame_cnt) |
| void | populate_draw_commands (DrawCommand *dcs, int *draw_command_cnt) |
| int | compare_draw_commands (const void *a, const void *b) |
| void | create_and_sort_draw_commands (int *dc_cnt, DrawCommand *dcs) |
| Creates all DrawCommands based on unique SubMeshes and sorts them via DrawCommand.sort_key. | |
| float | compute_ui_scale (int base_w, int base_h, int target_w, int target_h) |
| void | add_text_box (Vector *tvs, Vector *tis, TextBox *tb, int current_box) |
| Adds a TextBox to a vertex and index buffer, to be uploaded to TEXT_VBO and TEXT_EBO. | |
| void | add_all_text_boxes_to_draw_buffer () |
| Adds all TextBoxes to TEXT_VBO and iterates through each character to push indices to TEXT_EBO. | |
| void | GPU_upload_singular_text_box (UIContainer *cs, TextBox *tb, int *TC) |
| int | compare_uid_pair (const void *a, const void *b) |
| void | GPU_upload_singular_element (UIContainer *cs, UIElement *el, int *ui_el_count, int *el_count) |
| void | upload_parent_container (UIElement *el, UIContainer *cs, UIElement *els, int *el_count, size_t offset) |
| void | GPU_upload_ui_elements () |
| void | bind_dynamic_shader (int shader, bool probe_bake) |
| void | bind_material (Material *mat) |
| void | upload_instance_data (int *draw_calls, int *in_off, int dc_counts[MAX_DRAW_COMMANDS], int dc_off[MAX_DRAW_COMMANDS], int *draw_command_cnt, DrawCommand *dcs, MeshNodeSSBO *mn_data, uint8_t *instance_ptr, int current_frame_offset) |
| void | draw_arrays_elements (ShaderProgram *s, int start_arr, size_t start_array_offset, uint32_t array_count, int start_ele, size_t start_element_offset, uint32_t element_count) |
| void | write_point_light_shadows () |
| void | upload_instances () |
| void | render_all_draw_commands (bool probe_bake) |
| void | determine_closest_rprobes () |
| void | render_to_cubemap_face (Camera *rprobe_cam, GLuint render_fbo, int render_width, int render_height, bool probe_bake) |
| Uploads per-frame data to GPU and renders main render pass to a target FBO (omits Text, UI, and postprocessing that occurs after). | |
| int | find_depth (BVHNode *nodes, BVHNode *node, int depth) |
| void | render_tree (BVHNode *nodes, BVHNode *node, mat4 tr, DebugVertex *points, int *count, int depth, int max_depth, vec3 start_color, vec3 end_color) |
| void | render_bvh (BVHNode *nodes, int node_count, mat4 tr) |
| void | render_probe_volume (ProbeVolume *pv, bool audio) |
| void | render () |
| The main render pass. | |
| void bind_baking_ssbos | ( | ) |
Binds SSBOs required for baking.
Definition at line 31 of file render.c.
References bind_baking_ssbos(), MESH_BVH_SSBO, MESH_SSBO, PROBE_SSBO, RPROBE_SSBO, SCENE_BVH_SSBO, TRI_SSBO, and VERTEX_SSBO.
Referenced by bake_audio_probe_volume(), bake_lighting_probe_volume(), bake_lightmap(), and bind_baking_ssbos().
| void unbind_baking_ssbos | ( | ) |
Unbinds SSBOs required for baking.
Definition at line 42 of file render.c.
References GLOBAL_INSTANCE_SSBO, INDIRECT_ARRAYS_COMMAND_BUFFER, INDIRECT_ELEMENTS_COMMAND_BUFFER, INSTANCE_SSBO, JOINT_SSBO, RPROBE_SSBO, TEXT_BOX_SSBO, and unbind_baking_ssbos().
Referenced by bake_audio_probe_volume(), bake_lighting_probe_volume(), bake_lightmap(), and unbind_baking_ssbos().
| void bind_render_ssbos | ( | ) |
Binds SSBOs required for rendering.
Definition at line 56 of file render.c.
References bind_render_ssbos(), CLUSTER_AABB_SSBO, CLUSTER_SSBO, GLOBAL_INSTANCE_SSBO, GLOBAL_LIGHT_INDICES_SSBO, INDIRECT_ARRAYS_COMMAND_BUFFER, INDIRECT_ELEMENTS_COMMAND_BUFFER, INSTANCE_SSBO, JOINT_SSBO, LIGHTMAP_SSBO, MATERIAL_SSBO, MESH_LIGHT_SSBO, MESH_NODE_SSBO, RPROBE_SSBO, TEXT_BOX_SSBO, and UI_SSBO.
Referenced by bind_render_ssbos(), and init().
| size_t fill_buffer_with_mesh_tri | ( | Mesh * | mesh, |
| MainVertex * | verts, | ||
| size_t | offset ) |
Definition at line 80 of file render.c.
References Vector::buffer, CAST_VEC, MeshNode::count, Vector::count, fill_buffer_with_mesh_tri(), MeshNode::free, GLOBALS, Mesh::id, MeshFace::indices, LightmapData::islands, MainVertex::joint_indices, Point::joints, LIGHTMAP_DATA, SceneData::lightmap_data, Globals::mesh_nodes, MainVertex::normal, Point::normal, MeshNode::offset, MainVertex::pos, Point::pos, Globals::scene_data, Mesh::static_mesh, MainVertex::tangent, Point::tangent, Mesh::tri_adjacency, Mesh::tris, LightmapGPU::uv, MainVertex::uv, Point::uv, uv, UVMapping::uv_island, MeshNode::uv_map, LightmapSSBO::uvs, UVIsland::uvs, Mesh::vertices, MainVertex::weights, and Point::weights.
Referenced by fill_buffer_with_mesh_tri().
| size_t fill_vertex_buffer_mesh | ( | Mesh * | mesh, |
| MainVertex * | verts, | ||
| size_t | offset, | ||
| size_t * | lm_offset ) |
Definition at line 156 of file render.c.
References Vector::buffer, CAST_VEC, Vector::count, SubMesh::draw_offset, fill_vertex_buffer_mesh(), SubMesh::first_index, MeshNode::free, GLOBALS, Mesh::id, SubMesh::index_count, MeshFace::indices, LightmapData::islands, MainVertex::joint_indices, Point::joints, LIGHTMAP_DATA, SceneData::lightmap_data, SubMesh::lm_offset, Globals::mesh_nodes, MainVertex::normal, Point::normal, MainVertex::pos, Point::pos, Globals::scene_data, Mesh::static_mesh, Mesh::submeshes, MainVertex::tangent, Point::tangent, Mesh::tri_adjacency, Mesh::tris, LightmapGPU::uv, MainVertex::uv, Point::uv, uv, UVMapping::uv_island, MeshNode::uv_map, LightmapSSBO::uvs, UVIsland::uvs, Mesh::vertices, MainVertex::weights, and Point::weights.
Referenced by add_mesh_to_buffer(), and fill_vertex_buffer_mesh().
| size_t fill_index_buffer_mesh | ( | Mesh * | mesh, |
| uint32_t * | indices, | ||
| size_t | vertex_offset, | ||
| size_t | offset, | ||
| size_t * | lm_uv_offset ) |
Definition at line 258 of file render.c.
References Vector::buffer, CAST_VEC, Vector::count, SubMesh::draw_offset, fill_index_buffer_mesh(), SubMesh::first_index, SubMesh::index_count, MeshFace::indices, SubMesh::lm_offset, Mesh::static_mesh, Mesh::submeshes, Mesh::tri_adjacency, Mesh::tris, and Mesh::vertices.
Referenced by add_mesh_to_buffer(), and fill_index_buffer_mesh().
| size_t calc_mesh_size | ( | Mesh * | m | ) |
Definition at line 299 of file render.c.
References calc_mesh_size(), CAST_VEC, Vector::count, MeshNode::free, GLOBALS, Mesh::id, Globals::mesh_nodes, Mesh::static_mesh, Mesh::tris, and Mesh::vertices.
Referenced by add_mesh_to_buffer(), and calc_mesh_size().
| size_t calc_mesh_index_size | ( | Mesh * | m | ) |
Definition at line 325 of file render.c.
References calc_mesh_index_size(), CAST_VEC, Vector::count, GLOBALS, Globals::mesh_nodes, Mesh::static_mesh, and Mesh::tris.
Referenced by add_mesh_to_buffer(), and calc_mesh_index_size().
| void add_mesh_to_buffer | ( | Mesh * | m, |
| VertexLayout * | layout ) |
Adds a single Mesh to the MAIN_VBO.
| m | The Mesh to add. |
| layout | The VertexLayout whose offset and counts during Mesh addition. |
Definition at line 343 of file render.c.
References add_mesh_to_buffer(), calc_mesh_index_size(), calc_mesh_size(), CAST_VEC, Mesh::count, Vector::count, fill_index_buffer_mesh(), fill_vertex_buffer_mesh(), GLOBALS, Mesh::id, index_offset, layout(), Globals::meshes, Mesh::offset, Mesh::tris, vector_expand(), visize, and vsize.
Referenced by add_all_meshes_to_buffer(), and add_mesh_to_buffer().
| size_t allocate_lightmap_ssbo | ( | ) |
Definition at line 407 of file render.c.
References allocate_lightmap_ssbo(), CAST_VEC, Vector::count, MeshNode::free, GLOBALS, LIGHTMAP_DATA, MeshNode::mesh, Globals::mesh_nodes, Globals::meshes, Mesh::static_mesh, Mesh::tris, and LightmapSSBO::uvs.
Referenced by add_all_meshes_to_buffer(), and allocate_lightmap_ssbo().
| void add_all_meshes_to_buffer | ( | VertexLayout * | layout | ) |
Adds all Meshes that have valid MeshNodes.
| layout | The layout to use (MAIN_VAO). @critial Decide if we should upload ALL Meshes instead of just MeshNodes here so that we can separate the two. |
Definition at line 441 of file render.c.
References add_all_meshes_to_buffer(), add_mesh_to_buffer(), allocate_lightmap_ssbo(), CAST_VEC, Vector::count, MeshNode::free, GLOBALS, init_vector(), layout(), LIGHTMAP_DATA, LIGHTMAP_SSBO, MeshNode::mesh, Globals::mesh_nodes, Globals::meshes, LightmapSSBO::uvs, and Mesh::vertices.
Referenced by add_all_meshes_to_buffer(), execute_globals_undo(), LM_allocate_empty_mns(), LM_regenerate_texels(), load_lightmap_from_binary(), main(), render_light_menu(), render_main_menu(), and scene_load().
| void aabb_to_vertices | ( | DebugVertex * | out, |
| AABB * | aabb, | ||
| vec3 | offset ) |
Transfers an AABB to DebufVertex for a wireframe (GL_LINES).
| out | The outgoing vertices. |
| aabb | The input AABB. |
| offset | The offset in world space. |
Definition at line 475 of file render.c.
References aabb_to_vertices(), AABB::center, DebugVertex::pos, and vec3_add().
Referenced by aabb_to_vertices(), ray_traverse_scene_bvh(), render(), render_mesh_aabbs_from_root(), render_probe_volume(), render_tree(), and update_physics_components().
| void render_mesh_aabbs_from_root | ( | MeshNode * | mn | ) |
Adds Mesh AABBs for each MeshNode child recursively to DEBUG_LINES.
| mn | The MeshNode root. |
Definition at line 517 of file render.c.
References Mesh::aabb, aabb_to_vertices(), CAST_VEC, MeshNode::child_count, MeshNode::children, DebugVertex::color, DEBUG_LINE_COUNT, DEBUG_LINES, MeshNode::global_matrix, GLOBALS, MeshNode::mesh, Globals::mesh_nodes, Globals::meshes, render_mesh_aabbs_from_root(), and transform_aabb_by_model_matrix().
Referenced by render_mesh_aabbs_from_root(), and update_physics_components().
| void obb_to_vertices | ( | DebugVertex * | out, |
| OBB * | obb ) |
Definition at line 546 of file render.c.
References mat3::a0, mat3::a1, mat3::a2, mat3::b0, mat3::b1, mat3::b2, mat3::c0, mat3::c1, mat3::c2, OBB::center, OBB::extents, obb_to_vertices(), DebugVertex::pos, OBB::rot, vec3_add(), vec3_scale(), vec3::x, vec3::y, and vec3::z.
Referenced by obb_to_vertices(), and render_probe_volume().
Transfers a Light to a LightGPU.
| l | The light to copy from. |
| lgpu | The target GPU light. |
Definition at line 602 of file render.c.
References LightGPU::area, Light::cone_angle, copy_light_to_gpu_light(), LightGPU::cos_diff, Light::dir, LightGPU::dir, Light::entity_id, LightGPU::entity_id, Light::inner_angle, LightGPU::inner_angle, Light::intensity, LightGPU::intensity, Light::layer, LightGPU::layer, Light::light_type, LightGPU::light_type, Light::mesh, LightGPU::mesh, Light::outer_angle, LightGPU::outer_angle, LightGPU::outer_cos, Light::penumbra, Light::pos, LightGPU::pos, Light::radius, LightGPU::radius, Light::rgb, LightGPU::rgb, Light::surface_area, Light::threshold, Light::tri, and LightGPU::tri.
Referenced by copy_light_to_gpu_light(), upload_bake_lights_gpu(), and upload_lights().
| void upload_lights | ( | ) |
Uploads all current Lights inside of Globals.lights to the GPU in a triple buffered LIGHT_SSBO.
Definition at line 634 of file render.c.
References CAST_VEC, copy_light_to_gpu_light(), Vector::count, current_frame, GLOBALS, gpu_light_count, GPU_LIGHTS, LIGHT_SSBO, light_ssbo_ptr, light_ssbo_size, Globals::lights, and upload_lights().
Referenced by execute_globals_undo(), main(), render_light_menu(), render_main_menu(), render_to_cubemap_face(), scene_load(), scene_load_volumes(), and upload_lights().
| void determine_light_visibility_per_mesh | ( | ) |
Definition at line 658 of file render.c.
References CAST_VEC, Vector::count, current_frame, determine_light_visibility_per_mesh(), DIRECTIONAL_LIGHT, MeshNode::directional_light_count, MeshNode::directional_light_offset, MeshNode::free, GLOBALS, Light::intensity, Light::light_type, Globals::lights, MAX_DIRECTIONAL_LIGHTS, MAX_LIGHTS_PER_MESH, MeshNode::mesh, Globals::mesh_light_indices, MESH_LIGHT_SSBO, mesh_light_ssbo_ptr, mesh_light_ssbo_size, Globals::mesh_nodes, Globals::meshes, MINIMUM_LIGHT_VISIBILITY_DIST, POINT_LIGHT, MeshNode::point_light_count, MeshNode::point_light_offset, Light::pos, SPOT_LIGHT, MeshNode::spot_light_count, MeshNode::spot_light_offset, MeshNode::translation, vec3_length(), and vec3_sub().
Referenced by determine_light_visibility_per_mesh(), and render_to_cubemap_face().
| void upload_joint_matrices | ( | ) |
Definition at line 763 of file render.c.
References ASSET_INSTANCES, CAST_VEC, current_frame, GLTFSkin::final_mat, AssetInstance::free, GLOBALS, GLTFSkin::joint_count, joint_mat_count, JOINT_MATS, JOINT_SSBO, joint_ssbo_ptr, joint_ssbo_size, mat4_identity(), MAX_ASSET_INSTANCES, AssetInstance::skin_count, AssetInstance::skin_indices, Globals::skins, GLTFSkin::ssbo_offset, and upload_joint_matrices().
Referenced by render_to_cubemap_face(), and upload_joint_matrices().
Definition at line 796 of file render.c.
References compose_trs_from_mesh_node(), m4_mul(), n, and update_node_global().
Referenced by update_node_global(), and update_scene_nodes().
| void update_scene_nodes | ( | ) |
Definition at line 810 of file render.c.
References ASSET_INSTANCES, CAST_VEC, MeshNode::child_count, MeshNode::children, compose_trs_from_mesh_node(), AssetInstance::free, MeshNode::global_matrix, GLOBALS, MeshNode::local_matrix, mat4_identity(), MAX_ASSET_INSTANCES, Globals::mesh_nodes, n, AssetInstance::node_count, AssetInstance::node_indices, MeshNode::parent, update_node_global(), and update_scene_nodes().
Referenced by render_to_cubemap_face(), and update_scene_nodes().
| void update_skin_matrices | ( | ) |
Definition at line 831 of file render.c.
References ASSET_INSTANCES, CAST_VEC, GLTFSkin::final_mat, AssetInstance::free, MeshNode::global_matrix, GLOBALS, GLTFSkin::inverse_bind, GLTFSkin::joint_count, GLTFSkin::joints, m4_mul(), MAX_ASSET_INSTANCES, Globals::mesh_nodes, AssetInstance::node_indices, AssetInstance::skin_count, AssetInstance::skin_indices, Globals::skins, and update_skin_matrices().
Referenced by render_to_cubemap_face(), and update_skin_matrices().
| void upload_material_data | ( | ) |
Uploads Material data to the GPU as MaterialGPU.
Definition at line 854 of file render.c.
References Material::absorption_coefficients, MaterialGPU::absorption_coefficients, MaterialGPU::albedo_handle, Material::alpha_cutoff, MaterialGPU::alpha_cutoff, Material::alpha_mode, MaterialGPU::alpha_mode, MaterialGPU::ambient, Material::ao_strength, MaterialGPU::ao_strength, MaterialGPU::arm_handle, Material::arm_tex, AUDIO_NUM_BANDS, CAST_VEC, Vector::count, DEFAULT_ARM, DEFAULT_DIFFUSE, DEFAULT_EMISSIVE, DEFAULT_NORMAL, MaterialGPU::diffuse, Material::diffuse_tex, Material::double_sided, MaterialGPU::double_sided, MaterialGPU::emissive, MaterialGPU::emissive_handle, Material::emissive_strength, MaterialGPU::emissive_strength, Material::emissive_tex, GLOBALS, Image::handle, Globals::images, Material::ka, Material::kd, Material::ke, Material::ks, MATERIAL_DATA, MATERIAL_SSBO, Globals::materials, MaterialData::materials, Material::metallic, MaterialGPU::metallic, MaterialGPU::normal_handle, Material::normal_scale, MaterialGPU::normal_scale, Material::normal_tex, Material::override_arm, Material::roughness, MaterialGPU::roughness, Material::scattering_coefficients, MaterialGPU::scattering_coefficients, MaterialGPU::specular, and upload_material_data().
Referenced by execute_globals_undo(), main(), render_light_menu(), render_main_menu(), render_material_menu(), scene_load(), scene_load_volumes(), and upload_material_data().
Definition at line 941 of file render.c.
References mat4::a0, mat4::a1, mat4::a2, mat4::a3, mat4::b0, mat4::b1, mat4::b2, mat4::b3, mat4::c0, mat4::c1, mat4::c2, mat4::c3, cam, Camera::cam_data, mat4::d0, mat4::d1, mat4::d2, mat4::d3, get_view_planes(), m4_mul(), planes, CamData::proj, vec4_add(), vec4_sub(), CamData::view, vec4::w, vec4::x, vec4::y, and vec4::z.
Referenced by determine_mesh_visibility(), get_view_planes(), and render_to_cubemap_face().
| void determine_mesh_visibility | ( | Camera * | camera, |
| size_t * | meshes_frame, | ||
| size_t * | meshes_frame_cnt ) |
Definition at line 1008 of file render.c.
References Mesh::aabb, CAST_VEC, Vector::count, determine_mesh_visibility(), MeshNode::free, get_view_planes(), MeshNode::global_matrix, GLOBALS, AABB::max_x, AABB::max_y, AABB::max_z, MeshNode::mesh, Globals::mesh_nodes, Globals::meshes, AABB::min_x, AABB::min_y, AABB::min_z, planes, and transform_aabb_by_model_matrix().
Referenced by determine_mesh_visibility().
| void populate_draw_commands | ( | DrawCommand * | dcs, |
| int * | draw_command_cnt ) |
Definition at line 1033 of file render.c.
References CAST_VEC, Vector::count, DrawCommand::directional_light_count, MeshNode::directional_light_count, DrawCommand::directional_light_offset, MeshNode::directional_light_offset, SubMesh::draw_offset, MeshNode::free, DrawCommand::fwd_shader, Material::fwd_shader, DrawCommand::gbuffer_shader, Material::gbuffer_shader, MeshNode::global_matrix, GLOBALS, Mesh::id, MeshNode::id, DrawCommand::index_count, SubMesh::index_count, Material::kd, DrawCommand::lm_offset, SubMesh::lm_offset, DrawCommand::material, material, SubMesh::material, Globals::materials, DrawCommand::matrix, MeshNode::mesh, DrawCommand::mesh_id, Globals::mesh_nodes, Globals::meshes, DrawCommand::mn_id, DrawCommand::opaque, Material::override_transparent, DrawCommand::point_light_count, MeshNode::point_light_count, DrawCommand::point_light_offset, MeshNode::point_light_offset, populate_draw_commands(), MeshNode::skin, DrawCommand::skin_offset, Globals::skins, DrawCommand::sm_id, DrawCommand::sort_key, DrawCommand::spot_light_count, MeshNode::spot_light_count, DrawCommand::spot_light_offset, MeshNode::spot_light_offset, GLTFSkin::ssbo_offset, DrawCommand::start_index, DrawCommand::static_mesh, Mesh::static_mesh, Mesh::submeshes, and vec4::w.
Referenced by create_and_sort_draw_commands(), and populate_draw_commands().
| int compare_draw_commands | ( | const void * | a, |
| const void * | b ) |
Definition at line 1121 of file render.c.
References compare_draw_commands(), and DrawCommand::sort_key.
Referenced by compare_draw_commands(), and create_and_sort_draw_commands().
| void create_and_sort_draw_commands | ( | int * | dc_cnt, |
| DrawCommand * | dcs ) |
Creates all DrawCommands based on unique SubMeshes and sorts them via DrawCommand.sort_key.
| dc_cnt | The output count of DrawCommands. |
| dcs | The output DrawCommands. |
Definition at line 1132 of file render.c.
References compare_draw_commands(), create_and_sort_draw_commands(), and populate_draw_commands().
Referenced by create_and_sort_draw_commands(), and render_to_cubemap_face().
| float compute_ui_scale | ( | int | base_w, |
| int | base_h, | ||
| int | target_w, | ||
| int | target_h ) |
Definition at line 1148 of file render.c.
References compute_ui_scale().
Referenced by compute_ui_scale(), GPU_upload_singular_element(), and GPU_upload_singular_text_box().
Adds a TextBox to a vertex and index buffer, to be uploaded to TEXT_VBO and TEXT_EBO.
| tvs | The out vertex Vector. |
| tis | The out index Vector. |
| tb | The TextBox to upload. |
| current_box | The index within the entire buffer, meaning a running count through each individual UIMenus. |
Definition at line 1154 of file render.c.
References add_text_box(), CAST_VEC, TextBox::color, Vector::count, TextBox::fill, TextBox::font_id, FONTS, Font::glyph_count, Font::glyphs, Glyph::height, TextBox::start, TextBox::text, TextBox::text_size, Glyph::u0, Glyph::u1, Glyph::v0, Glyph::v1, vector_expand(), Glyph::width, vec2::x, Glyph::xadvance, Glyph::xoffset, vec2::y, and Glyph::yoffset.
Referenced by add_all_text_boxes_to_draw_buffer(), and add_text_box().
| void add_all_text_boxes_to_draw_buffer | ( | ) |
Adds all TextBoxes to TEXT_VBO and iterates through each character to push indices to TEXT_EBO.
Definition at line 1220 of file render.c.
References add_all_text_boxes_to_draw_buffer(), add_text_box(), Vector::buffer, CAST_VEC, Vector::count, init_vector(), MAX_TEXT_BOXES, MENUS, UIMenu::text_boxes, TEXT_EBO, TEXT_INDEX_COUNT, and TEXT_VBO.
Referenced by add_all_text_boxes_to_draw_buffer(), execute_text_box_undo(), execute_ui_element_undo(), main(), render_text_menu(), render_ui_menu(), scene_load(), and update_performance_overlay().
| void GPU_upload_singular_text_box | ( | UIContainer * | cs, |
| TextBox * | tb, | ||
| int * | TC ) |
Definition at line 1260 of file render.c.
References TextBox::angle, TextBoxGPU::color, compose_2d_transform(), compute_ui_scale(), EDITOR_SETTINGS, TextBoxGPU::fill, GPU_upload_singular_text_box(), TextBox::h, TextBox::hovered, TextBoxGPU::hovered, mat4_mul_point(), MAX, TextBox::menu, MIN, TextBoxGPU::model, MOUSE_X, MOUSE_Y, TextBox::scale, SCREEN_HEIGHT, SCREEN_WIDTH, EditorSettings::selected_text_id, EditorSettings::selected_ui_menu_id, TextBox::shadow, TextBoxGPU::shadow, TextBox::shadow_dir, TextBoxGPU::shadow_dir, TextBox::shadow_dist, TextBoxGPU::shadow_dist, TextBox::state, TextBoxGPU::state, TB_GPU, TEXT_HEIGHT, TEXT_WIDTH, TextBox::translation, UI_SCALE_HEIGHT, UI_SCALE_WIDTH, TextBox::uID, UISTATE_SELECTED, TextBox::visible, TextBoxGPU::visible, TextBox::w, vec2::x, vec3::x, vec2::y, and vec3::y.
Referenced by GPU_upload_singular_text_box(), and GPU_upload_ui_elements().
| int compare_uid_pair | ( | const void * | a, |
| const void * | b ) |
Definition at line 1343 of file render.c.
References compare_uid_pair(), and UIUIDPair::layer.
Referenced by compare_uid_pair(), and GPU_upload_ui_elements().
| void GPU_upload_singular_element | ( | UIContainer * | cs, |
| UIElement * | el, | ||
| int * | ui_el_count, | ||
| int * | el_count ) |
Definition at line 1361 of file render.c.
References UIElement::angle, UIElement::center, UIElement::color, UIElementGPU::color, compose_2d_transform(), compute_ui_scale(), UIElement::container, container_is_valid(), EDITOR_SETTINGS, UIElement::fill, UIElementGPU::fill, GPU_upload_singular_element(), UIElement::layer, UIUIDPair::layer, UIContainer::mask, UIElementGPU::masked, UIElement::menu, UIElementGPU::model, MOUSE_X, MOUSE_Y, UIContainer::padding, UIElementGPU::padding, UIElement::parent_container, UIElementGPU::pos, UIElement::radius, UIElementGPU::radius, UIElement::scale, UIElementGPU::scale, SCREEN_HEIGHT, SCREEN_WIDTH, EditorSettings::selected_ui_element_id, EditorSettings::selected_ui_menu_id, UIElement::shadow, UIElementGPU::shadow, UIElement::shadow_dir, UIElementGPU::shadow_dir, UIElement::shadow_dist, UIElementGPU::shadow_dist, UIElement::size, UIElementGPU::size, UIElement::state, UIElementGPU::state, TEXT_HEIGHT, TEXT_WIDTH, UIElement::translation, UIElementGPU::translation, UIElement::type, UIElementGPU::type, ui_element_count, UI_GPU, UI_SCALE_HEIGHT, UI_SCALE_WIDTH, UI_UIDS, UIElement::uID, UIUIDPair::uid, UISTATE_SELECTED, vec2_sub(), UIElement::visible, UIElementGPU::visible, vec2::x, and vec2::y.
Referenced by GPU_upload_singular_element(), GPU_upload_ui_elements(), and upload_parent_container().
| void upload_parent_container | ( | UIElement * | el, |
| UIContainer * | cs, | ||
| UIElement * | els, | ||
| int * | el_count, | ||
| size_t | offset ) |
Definition at line 1436 of file render.c.
References UIElementGPU::container_id, container_ids, container_is_valid(), UIContainer::element, GPU_upload_singular_element(), UIElement::menu, UIElement::parent_container, ui_element_count, UI_GPU, and upload_parent_container().
Referenced by GPU_upload_ui_elements(), and upload_parent_container().
| void GPU_upload_ui_elements | ( | ) |
Definition at line 1463 of file render.c.
References CAST_VEC, compare_uid_pair(), TextBoxGPU::container_id, UIElementGPU::container_id, container_ids, container_ids_cap, container_is_valid(), UIMenu::containers, Vector::count, current_frame, EDITOR_SETTINGS, UIMenu::elements, TextBox::free, UIElement::free, GPU_upload_singular_element(), GPU_upload_singular_text_box(), GPU_upload_ui_elements(), TextBoxGPU::mask, UIContainer::mask, MAX_UI_CONTAINERS, MAX_UI_ELEMENTS, TextBox::menu, UIElement::menu, MENUS, TextBox::parent_container, UIElement::parent_container, PERFORMANCE_OVERLAY_MENU, TB_GPU, TEXT_BOX_SSBO, text_box_ssbo_ptr, text_box_ssbo_size, UIMenu::text_boxes, EditorSettings::UI, ui_element_count, UI_GPU, ui_instance_vbo_ptr, ui_instance_vbo_size, UI_SSBO, ui_ssbo_ptr, ui_ssbo_size, UI_UID_OUT, UI_UIDS, UIUIDPair::uid, and upload_parent_container().
Referenced by GPU_upload_ui_elements(), and render().
| void bind_dynamic_shader | ( | int | shader, |
| bool | probe_bake ) |
Definition at line 1589 of file render.c.
References bind_dynamic_shader(), BRDF_LUT, CAST_VEC, Framebuffer::depth_texture, DIRECTIONAL_MAP_TEXTURE, DUMMY_LIGHTMAP, DYNAMIC_SHADER, EDITOR_SETTINGS, FBM_TEXTURE, GLOBALS, GRID_X, GRID_Y, GRID_Z, GLTexture::i, Globals::images, LPV_TEXTURE, Globals::materials, POINT_LIGHT_SHADOWS_FBO, probe_bake, Globals::probe_spacing, Globals::probe_tex_size, PROBE_VOLUME_DEPTH_PADDED, RENDER_HEIGHT, RENDER_WIDTH, RPROBE_CUBE_MAP_ARRAY, SHADOW_MAP_FBO, SKYBOX, EditorSettings::SSAO, SSAO_BLUR_FBO, SSR_FBO, Framebuffer::texture, time, VIEW_FAR, VIEW_NEAR, Globals::world_min, ivec3::x, vec3::x, ivec3::y, vec3::y, ivec3::z, and vec3::z.
Referenced by bind_dynamic_shader(), and render_all_draw_commands().
| void bind_material | ( | Material * | mat | ) |
Definition at line 1662 of file render.c.
References Material::arm_tex, bind_material(), CAST_VEC, DEFAULT_ARM, DEFAULT_DIFFUSE, DEFAULT_NORMAL, Material::diffuse_tex, DYNAMIC_SHADER, Material::fwd_shader, GLOBALS, Image::i, Globals::images, and Material::normal_tex.
Referenced by bind_material().
| void upload_instance_data | ( | int * | draw_calls, |
| int * | in_off, | ||
| int | dc_counts[MAX_DRAW_COMMANDS], | ||
| int | dc_off[MAX_DRAW_COMMANDS], | ||
| int * | draw_command_cnt, | ||
| DrawCommand * | dcs, | ||
| MeshNodeSSBO * | mn_data, | ||
| uint8_t * | instance_ptr, | ||
| int | current_frame_offset ) |
Definition at line 1732 of file render.c.
References Mesh::aabb, array_offset, DrawCommand::array_offset, arrays_indirect, DrawArraysIndirectCommand::baseInstance, DrawElementsIndirectCommand::baseInstance, DrawElementsIndirectCommand::baseVertex, CAST_VEC, AABB::center, MeshNodeDataGPU::center, MeshNode::command_id, DrawArraysIndirectCommand::count, DrawElementsIndirectCommand::count, MeshNodeDataGPU::count, current_frame, DrawCommand::element_offset, element_offset, elements_indirect, AABB::extents, MeshNodeDataGPU::extents, DrawArraysIndirectCommand::first, MeshNodeDataGPU::first, DrawElementsIndirectCommand::firstIndex, DrawCommand::fwd_shader, GLOBALS, DrawCommand::index_count, INDIRECT_ARRAYS_COMMAND_BUFFER, indirect_arrays_ptr, INDIRECT_ELEMENTS_COMMAND_BUFFER, indirect_elements_ptr, MeshNodeDataGPU::instance_count, DrawArraysIndirectCommand::instanceCount, DrawElementsIndirectCommand::instanceCount, DrawCommand::lm_offset, MeshNodeDataGPU::lm_offset, DrawCommand::material, MeshNodeDataGPU::material, MeshNodeDataGPU::max, MAX_DRAW_COMMANDS, MAX_INSTANCES, AABB::max_x, AABB::max_y, AABB::max_z, MeshNode::mesh_data_id, DrawCommand::mesh_id, MESH_NODE_SSBO, mesh_node_ssbo_ptr, mesh_node_ssbo_size, Globals::mesh_nodes, Globals::meshes, MeshNodeDataGPU::min, AABB::min_x, AABB::min_y, AABB::min_z, DrawCommand::mn_id, MeshNodeSSBO::mns, DrawCommand::skin_offset, MeshNode::skin_offset, DrawCommand::sm_id, DrawCommand::start_index, DrawCommand::static_mesh, Mesh::static_mesh, MeshNodeDataGPU::static_mesh, transform_count, upload_instance_data(), vec3::x, vec3::y, and vec3::z.
Referenced by render_to_cubemap_face(), and upload_instance_data().
| void draw_arrays_elements | ( | ShaderProgram * | s, |
| int | start_arr, | ||
| size_t | start_array_offset, | ||
| uint32_t | array_count, | ||
| int | start_ele, | ||
| size_t | start_element_offset, | ||
| uint32_t | element_count ) |
Definition at line 1836 of file render.c.
References array_offset, draw_arrays_elements(), INDIRECT_ARRAYS_COMMAND_BUFFER_OUT, INDIRECT_ELEMENTS_COMMAND_BUFFER_OUT, and ShaderProgram::program.
Referenced by draw_arrays_elements(), render_all_draw_commands(), render_to_cubemap_face(), and write_point_light_shadows().
| void write_point_light_shadows | ( | ) |
Definition at line 1863 of file render.c.
References array_offset, Camera::cam_data, CamData::cam_pos, CAST_VEC, compute_camera_basis(), Vector::count, CULL_POINT_LIGHT_SHADOWS_SHADER, Framebuffer::depth_texture, draw_arrays_elements(), element_offset, ELEMENTS_PREFIX_SHADER, Framebuffer::fbo, Camera::forward, GLOBALS, Framebuffer::h, GLTexture::i, INDIRECT_ARRAYS_COMMAND_BUFFER, INDIRECT_ARRAYS_COMMAND_BUFFER_OUT, INDIRECT_ELEMENTS_COMMAND_BUFFER, INDIRECT_ELEMENTS_COMMAND_BUFFER_OUT, INDIRECT_PREFIX_SHADER, INSTANCE_VBO, Light::light_type, Globals::lights, Uniform::location, m4_mul(), M_PI, MAIN_EBO, MAIN_VAO, MAIN_VBO, make_look_at(), make_projection(), master_frame, Globals::mesh_nodes, Globals::meshes, Camera::pitch, POINT_LIGHT, POINT_LIGHT_SHADOW_SHADER, POINT_LIGHT_SHADOWS_FBO, Light::pos, ShaderProgram::program, CamData::proj, Light::radius, Light::sm_dirty, transform_count, ShaderProgram::uniforms, vec3_add(), vec3_to_vec4(), CamData::view, view, Framebuffer::w, write_point_light_shadows(), vec3::x, vec3::y, Camera::yaw, and vec3::z.
Referenced by render_to_cubemap_face(), and write_point_light_shadows().
| void upload_instances | ( | ) |
Definition at line 1996 of file render.c.
References BUFFER_FRAMES, CAST_VEC, MeshNode::command_id, TransformGPU::command_id, current_frame, MeshNode::directional_light_count, MeshNode::directional_light_offset, TransformGPU::directional_lights, draw_command_count, DRAW_COMMANDS, dynamic_count, MeshNode::free, MeshNode::global_matrix, GLOBALS, INSTANCE_SSBO, instance_ssbo_ptr, instance_ssbo_size, mat4_identity(), DrawCommand::material, TransformGPU::material, Globals::materials, MeshNode::mesh, MeshNode::mesh_data_id, Globals::mesh_nodes, Globals::meshes, DrawCommand::mn_id, TransformGPU::mn_id, MeshNode::skin, MeshNode::skin_offset, TransformGPU::skin_offset, Globals::skins, DrawCommand::sm_id, MeshNode::spot_light_count, MeshNode::spot_light_offset, TransformGPU::spot_lights, static_count, Mesh::static_mesh, Mesh::submeshes, TransformGPU::tr, transform_count, transforms, and upload_instances().
Referenced by render_to_cubemap_face(), and upload_instances().
| void render_all_draw_commands | ( | bool | probe_bake | ) |
Definition at line 2089 of file render.c.
References DrawCommand::array_offset, bind_dynamic_shader(), CAST_VEC, EditorSettings::current_debug_view, draw_arrays_elements(), draw_command_count, DRAW_COMMANDS, DVIEW_DEFAULT, DYNAMIC_SHADER, EDITOR_SETTINGS, DrawCommand::element_offset, DrawCommand::fwd_shader, GLOBALS, Globals::images, INSTANCE_VBO, SceneData::lightmap_data, MAIN_EBO, MAIN_VAO, MAIN_VBO, Globals::materials, DrawCommand::opaque, probe_bake, render_all_draw_commands(), Globals::scene_data, DrawCommand::static_mesh, and LightmapData::texture_id.
Referenced by render_all_draw_commands(), and render_to_cubemap_face().
| void determine_closest_rprobes | ( | ) |
Definition at line 2231 of file render.c.
References ReflectionProbe::aabb, CAM_POS, CAST_VEC, AABB::center, Vector::count, determine_closest_rprobes(), GLOBALS, MAX_RPROBES_PER_FRAME, RProbeUBO::probe_count, RProbeUBO::probe_indices, SceneData::reflection_probes, RPROBE_UBO_DATA, Globals::scene_data, RProbeUBO::Align16::val, vec3_length(), and vec3_sub().
Referenced by determine_closest_rprobes(), and render_to_cubemap_face().
| void render_to_cubemap_face | ( | Camera * | rprobe_cam, |
| GLuint | render_fbo, | ||
| int | render_width, | ||
| int | render_height, | ||
| bool | probe_bake ) |
Uploads per-frame data to GPU and renders main render pass to a target FBO (omits Text, UI, and postprocessing that occurs after).
| rprobe_cam | The Camera to upload for the CAM_UBO. |
| render_fbo | The main target FBO. |
| render_width | The width of the target FBO. |
| probe_bake | If this is baking ReflectionProbes. This flag controls if ReflectionProbes are sampled so that there is no accumulation. |
Definition at line 2278 of file render.c.
References mat3::a0, mat3::a1, mat3::a2, array_offset, DrawCommand::array_offset, OBBGPU::axis_x, OBBGPU::axis_y, OBBGPU::axis_z, mat3::b0, mat3::b1, mat3::b2, EditorSettings::BLOOM, BLOOM_DOWNSCALE_SHADER, BLOOM_PYRAMID, bloom_queries, BLOOM_SHADER, BLOOM_UPSCALE_SHADER, BOKEH_FBO, BOKEH_SHADER, BUFFER_FRAMES, mat3::c0, mat3::c1, mat3::c2, Camera::cam_data, CAM_UBO, cam_ubo_padded, cam_ubo_ptr, CAST_VEC, OBB::center, OBBGPU::center, COC_FBO, COC_SHADER, Vector::count, create_and_sort_draw_commands(), CULL_CLUSTERS_SHADER, CULL_DRAW_CALLS_SHADER, cull_queries, cur_history, current_frame, current_query_frame, DEPTH_DOWNSAMPLE_FBO, DEPTH_DOWNSAMPLE_SHADER, DEPTH_PRE_PASS_SHADER, DEPTH_PRE_PASS_SHADER_MSAA, Framebuffer::depth_texture, determine_closest_rprobes(), determine_light_visibility_per_mesh(), DIRECTIONAL_LIGHT_COUNT, EditorSettings::DOF, EditorSettings::DOF_focal_length, EditorSettings::DOF_fstop, DOF_HEIGHT, EditorSettings::DOF_max_blur_radius, dof_queries, EditorSettings::DOF_sensor_height, DOF_WIDTH, draw_arrays_elements(), draw_call_count, draw_command_count, draw_command_counts, draw_command_offsets, DRAW_COMMANDS, draw_dirty, EDITOR_SETTINGS, DrawCommand::element_offset, element_offset, ELEMENTS_PREFIX_SHADER, OBB::extents, OBBGPU::extents, Framebuffer::fbo, FOCAL_DISTANCE_SHADER, EditorSettings::FULL_GBUFFER, DrawCommand::fwd_shader, GALBEDO, GBUFFER_FBO, gbuffer_queries, GBUFFER_RESOLVE_FBO, DrawCommand::gbuffer_shader, get_view_planes(), GEXTRA, GLOBAL_INSTANCE_SSBO, GLOBALS, GNORMAL, GPOMDEPTH, GRID_X, GRID_Y, GRID_Z, GVEL, Framebuffer::h, GLTexture::i, INDIRECT_ARRAYS_COMMAND_BUFFER, INDIRECT_ARRAYS_COMMAND_BUFFER_OUT, INDIRECT_ELEMENTS_COMMAND_BUFFER, INDIRECT_ELEMENTS_COMMAND_BUFFER_OUT, INDIRECT_PREFIX_SHADER, instance_offset, INSTANCE_VBO, instance_vbo_ptr, JITTER_OFFSET, LIGHT_CAM, LIGHT_CAM_UBO, light_cam_ubo_padded, light_cam_ubo_ptr, SceneData::lighting_probe_volumes, Globals::lights, Globals::lights_dirty, OBBGPU::loaded, SceneData::LOADED_LIGHTING_PV, SceneData::LOADED_LIGHTING_PV_FLAG, Uniform::location, LPV_SLOTS, MAIN_EBO, MAIN_FBO, MAIN_RESOLVE_FBO, MAIN_VAO, MAIN_VBO, MAX_LIGHTS_PER_CLUSTER, mesh_node_data_gpu, Globals::mesh_nodes, Globals::meshes, EditorSettings::MSAA, ProbeVolume::obb, ProbeVolumeUBO::obb, DrawCommand::opaque, pl_queries, planes, probe_bake, PROBE_VOLUME_UBO, probe_volume_ubo_padded, probe_volume_ubo_ptr, ShaderProgram::program, CamData::proj, ShadowmapUBO::proj, LPV::pv_id, render_all_draw_commands(), RENDER_HEIGHT, render_queries, render_to_cubemap_face(), RENDER_WIDTH, OBB::rot, RPROBE_UBO, RPROBE_UBO_DATA, rprobe_ubo_padded, rprobe_ubo_ptr, Globals::scene_data, SHADOW_MAP_FBO, SHADOW_MAP_SHADER, SHADOWMAP_FRAME_DATA, SKY_SHADER, SKY_VAO, SKY_VBO, SKYBOX, sm_queries, EditorSettings::SSAO, SSAO_BLUR_FBO, SSAO_BLUR_SHADER, SSAO_FBO, SSAO_HEIGHT, SSAO_NOISE_TEXTURE, ssao_queries, SSAO_SHADER, SSAO_WIDTH, EditorSettings::SSR, SSR_FBO, SSR_HEIGHT, SSR_HISTORY_SHADER, ssr_queries, SSR_SHADER, SSR_WIDTH, DrawCommand::static_mesh, EditorSettings::TAA, TAA_FBO, taa_queries, Framebuffer::texture, time, time_since_last_render, transform_count, ShaderProgram::uniforms, update_scene_nodes(), update_skin_matrices(), upload_instance_data(), upload_instances(), upload_joint_matrices(), upload_lights(), CamData::view, ShadowmapUBO::view, VIEW_FAR, VIEW_NEAR, Framebuffer::w, write_point_light_shadows(), vec2::x, and vec2::y.
Referenced by bake_reflection_probes(), render(), and render_to_cubemap_face().
Definition at line 2915 of file render.c.
References find_depth(), BVHNode::left, MAX, and BVHNode::right.
Referenced by find_depth(), and render_bvh().
| void render_tree | ( | BVHNode * | nodes, |
| BVHNode * | node, | ||
| mat4 | tr, | ||
| DebugVertex * | points, | ||
| int * | count, | ||
| int | depth, | ||
| int | max_depth, | ||
| vec3 | start_color, | ||
| vec3 | end_color ) |
Definition at line 2931 of file render.c.
References BVHNode::aabb, aabb_to_vertices(), DebugVertex::color, BVHNode::left, render_tree(), BVHNode::right, transform_aabb_by_model_matrix(), and vec3_lerp().
Referenced by render_bvh(), and render_tree().
Definition at line 2960 of file render.c.
References find_depth(), render_bvh(), render_tree(), and WIREFRAME_VBO.
Referenced by render_bvh().
| void render_probe_volume | ( | ProbeVolume * | pv, |
| bool | audio ) |
Definition at line 2979 of file render.c.
References mat3::a0, mat3::a1, mat3::a2, aabb_to_vertices(), EditorSettings::audio_probe_volume_overlay, mat3::b0, mat3::b1, mat3::b2, mat3::c0, mat3::c1, mat3::c2, AABB::center, OBB::center, color, DebugVertex::color, DEBUG_CURRENT_APROBE, DEBUG_LINE_COUNT, DEBUG_LINES, DEBUG_LINES_MAX, EDITOR_APROBE_SIZE, EDITOR_SETTINGS, AABB::extents, OBB::extents, EditorSettings::lighting_probe_volume_overlay, ProbeVolume::obb, obb_to_vertices(), render_probe_volume(), ProbeVolume::resolution, OBB::rot, vec3_add(), vec3_scale(), ivec3::x, vec3::x, ivec3::y, vec3::y, ivec3::z, and vec3::z.
Referenced by render(), and render_probe_volume().
| void render | ( | ) |
The main render pass.
Calls render_to_cubemap_face() and then renders wireframes, text, ui, and postprocessing.
Definition at line 3057 of file render.c.
References ReflectionProbe::aabb, aabb_to_vertices(), EditorSettings::ACES, animation_length(), AUDIO_EMITTERS, EditorSettings::audio_menu_open, Globals::audio_portals, SceneData::audio_probe_volumes, EditorSettings::BLOOM, BLOOM_PYRAMID, BOKEH_FBO, BUFFER_FRAMES, SceneData::bvh_nodes, cam, ReflectionProbe::capture_pos, CAST_VEC, AABB::center, COC_FBO, DebugVertex::color, COLOR_GRADE_LUT, Vector::count, cur_history, current_frame, current_query_frame, DEBUG_LINE_COUNT, DEBUG_LINES, DEBUG_LINES_MAX, Framebuffer::depth_texture, EditorSettings::DOF, EditorSettings::DOF_focal_length, EditorSettings::DOF_fstop, EditorSettings::DOF_max_blur_radius, EditorSettings::DOF_sensor_height, EDITOR_APORTAL_SIZE, EDITOR_AUDIO_EMITTER_SIZE, EDITOR_LIGHT_SIZE, EDITOR_SETTINGS, AABB::extents, FBM_TEXTURE, Framebuffer::fbo, find_animation(), FONTS, frame_time, GBUFFER_RESOLVE_FBO, GLOBALS, GPU_upload_ui_elements(), GVEL, Framebuffer::h, HISTORY_TEXTURE, Mesh::hulls, GLTexture::i, Image::i, Globals::images, LightmapData::islands, Skeleton::left_hip_pos, SceneData::lighting_probe_volumes, SceneData::lightmap_data, Globals::lights, Uniform::location, EditorSettings::LUT, MAIN_FBO, main_queries, MAIN_RESOLVE_FBO, make_ortho(), master_frame, MAX_AUDIO_EMITTERS, MAX_UI_ELEMENTS, EditorSettings::MBLUR, Player::mesh, EditorSettings::mesh_node_menu_open, Globals::mesh_nodes, Globals::meshes, EditorSettings::MSAA, EditorSettings::NOISE, Skeleton::p_left, Skeleton::p_right, perm(), play_animation(), player, AudioEmitter::pos, AudioPortal::pos, DebugVertex::pos, Light::pos, POSTPROCESS_SHADER, PP_ACES, PP_BLOOM, PP_DOF, EditorSettings::pp_dview, PP_LUT, PP_MBLUR, PP_NOISE, PP_SHADER_VERSIONS, PPDVIEW_DEFAULT, ShaderProgram::program, Skeleton::q_left, Skeleton::q_right, SceneData::reflection_probes, render(), RENDER_FENCE, EditorSettings::render_framerate_target, RENDER_HEIGHT, render_probe_volume(), render_to_cubemap_face(), RENDER_WIDTH, Light::rgb, Skeleton::right_hip_pos, EditorSettings::rotation_axis, Globals::scene_data, SCREEN_HEIGHT, SCREEN_WIDTH, EditorSettings::selected_mn_id, Player::skeleton, SSR_FBO, EditorSettings::TAA, TAA_FBO, TEXT_EBO, TEXT_FBO, TEXT_INDEX_COUNT, TEXT_SHADER, TEXT_VAO, TEXT_VBO, Font::texture, Framebuffer::texture, LightmapData::texture_id, time, MeshNode::translation, ui_element_count, UI_SHADER, UI_VAO, ShaderProgram::uniforms, vec3_add(), vec3_sub(), Framebuffer::w, WIREFRAME_SHADER, EditorSettings::wireframe_toggled, WIREFRAME_VAO, and WIREFRAME_VBO.
| int master_frame = 0 |
Definition at line 21 of file render.c.
Referenced by render(), update_camera(), and write_point_light_shadows().
| int cur_history = 0 |
Definition at line 22 of file render.c.
Referenced by render(), and render_to_cubemap_face().
| int current_frame = 0 |
Definition at line 25 of file render.c.
Referenced by bake_reflection_probes(), determine_light_visibility_per_mesh(), GPU_upload_ui_elements(), main(), render(), render_to_cubemap_face(), upload_bake_lights_gpu(), upload_instance_data(), upload_instances(), upload_joint_matrices(), and upload_lights().
| size_t meshes_in_frame[MAX_MESH_NODES] |
| size_t shadow_meshes_in_frame[MAX_MESH_NODES] |
| size_t vsize = 0 |
Definition at line 340 of file render.c.
Referenced by add_mesh_to_buffer().
| size_t visize = 0 |
Definition at line 341 of file render.c.
Referenced by add_mesh_to_buffer().
| LightGPU GPU_LIGHTS[MAX_LIGHTS] |
Definition at line 599 of file render.c.
Referenced by upload_lights().
| int gpu_light_count = 0 |
Definition at line 600 of file render.c.
Referenced by upload_lights().
| mat4 JOINT_MATS[MAX_JOINT_MATRICES] |
Definition at line 761 of file render.c.
Referenced by upload_joint_matrices().
| int joint_mat_count = 0 |
Definition at line 762 of file render.c.
Referenced by upload_joint_matrices().
| TextBoxGPU TB_GPU[MAX_TEXT_BOXES] |
Definition at line 1144 of file render.c.
Referenced by GPU_upload_singular_text_box(), and GPU_upload_ui_elements().
| UIElementGPU UI_GPU[MAX_UI_ELEMENTS] = {0} |
Definition at line 1334 of file render.c.
Referenced by GPU_upload_singular_element(), GPU_upload_ui_elements(), and upload_parent_container().
| UIUIDPair UI_UIDS[MAX_UI_ELEMENTS] = {0} |
Definition at line 1357 of file render.c.
Referenced by GPU_upload_singular_element(), and GPU_upload_ui_elements().
| uint32_t UI_UID_OUT[MAX_UI_ELEMENTS] = {0} |
Definition at line 1358 of file render.c.
Referenced by GPU_upload_ui_elements().
| int ui_element_count = 0 |
Definition at line 1359 of file render.c.
Referenced by GPU_upload_singular_element(), GPU_upload_ui_elements(), render(), and upload_parent_container().
| int* container_ids = NULL |
Definition at line 1432 of file render.c.
Referenced by GPU_upload_ui_elements(), and upload_parent_container().
| size_t container_ids_cap = 0 |
Definition at line 1433 of file render.c.
Referenced by GPU_upload_ui_elements().
| InstanceData instance_matrices[MAX_INSTANCES] |
| int draw_command_offsets[MAX_DRAW_COMMANDS] |
Definition at line 1710 of file render.c.
Referenced by render_to_cubemap_face().
| int draw_command_counts[MAX_DRAW_COMMANDS] |
Definition at line 1711 of file render.c.
Referenced by render_to_cubemap_face().
| int draw_call_count = 0 |
Definition at line 1712 of file render.c.
Referenced by render_to_cubemap_face().
| int instance_offset = 0 |
Definition at line 1713 of file render.c.
Referenced by render_to_cubemap_face().
| InstanceData shadow_instance_matrices[MAX_INSTANCES] |
| int shadow_draw_command_offsets[MAX_DRAW_COMMANDS] |
| int shadow_draw_command_counts[MAX_DRAW_COMMANDS] |
| MeshNodeSSBO mesh_node_data_gpu |
Definition at line 1721 of file render.c.
Referenced by render_to_cubemap_face().
| DrawArraysIndirectCommand arrays_indirect[MAX_MESH_NODES] |
Definition at line 1724 of file render.c.
Referenced by upload_instance_data().
| int array_offset = 0 |
Definition at line 1725 of file render.c.
Referenced by draw_arrays_elements(), render_to_cubemap_face(), upload_instance_data(), and write_point_light_shadows().
| DrawElementsIndirectCommand elements_indirect[MAX_MESH_NODES] |
Definition at line 1726 of file render.c.
Referenced by upload_instance_data().
| int element_offset = 0 |
Definition at line 1727 of file render.c.
Referenced by render_to_cubemap_face(), upload_instance_data(), and write_point_light_shadows().
| TransformGPU transforms[MAX_MESH_NODES *MAX_INSTANCES] |
Definition at line 1728 of file render.c.
Referenced by upload_instances().
| int transform_count = 0 |
Definition at line 1729 of file render.c.
Referenced by render_to_cubemap_face(), upload_instance_data(), upload_instances(), and write_point_light_shadows().
| int static_count = 0 |
Definition at line 1730 of file render.c.
Referenced by upload_instances().
| int dynamic_count = 0 |
Definition at line 1731 of file render.c.
Referenced by upload_instances().
| RProbeUBO RPROBE_UBO_DATA |
Definition at line 2229 of file render.c.
Referenced by determine_closest_rprobes(), and render_to_cubemap_face().
| ShadowmapUBO SHADOWMAP_FRAME_DATA |
Definition at line 2276 of file render.c.
Referenced by render_to_cubemap_face().