diff --git a/examples_dd3d/DebugDrawDemoScene.gd b/examples_dd3d/DebugDrawDemoScene.gd index 12776425..db7577c5 100644 --- a/examples_dd3d/DebugDrawDemoScene.gd +++ b/examples_dd3d/DebugDrawDemoScene.gd @@ -84,9 +84,6 @@ func _physics_process(delta: float) -> void: func main_update(delta: float) -> void: - if Input.is_action_just_pressed("ui_end"): - DebugDraw3D.regenerate_geometry_meshes() - DebugDraw3D.scoped_config().set_thickness(debug_thickness).set_center_brightness(debug_center_brightness) if false: #test var _s11 = DebugDraw3D.new_scoped_config().set_thickness(1) @@ -130,6 +127,10 @@ func main_update(delta: float) -> void: DebugDraw3D.config.freeze_3d_render = Input.is_key_pressed(KEY_DOWN) DebugDraw3D.config.visible_instance_bounds = Input.is_key_pressed(KEY_RIGHT) + # Regenerate meshes + if Input.is_action_just_pressed("ui_end"): + DebugDraw3D.regenerate_geometry_meshes() + # Some property toggles if _is_key_just_pressed(KEY_LEFT): DebugDraw3D.config.use_frustum_culling = !DebugDraw3D.config.use_frustum_culling diff --git a/examples_dd3d/DebugDrawDemoSceneCS.cs b/examples_dd3d/DebugDrawDemoSceneCS.cs index 30142f36..c07b1a5c 100644 --- a/examples_dd3d/DebugDrawDemoSceneCS.cs +++ b/examples_dd3d/DebugDrawDemoSceneCS.cs @@ -263,9 +263,6 @@ public override void _PhysicsProcess(double delta) void MainUpdate(double delta) { - if (Input.IsActionJustPressed("ui_end")) - DebugDraw3D.RegenerateGeometryMeshes(); - DebugDraw3D.ScopedConfig().SetThickness(debug_thickness); #pragma warning disable CS0162 // Unreachable code detected if (false) // #test @@ -312,6 +309,10 @@ void MainUpdate(double delta) DebugDraw3D.Config.Freeze3dRender = Input.IsKeyPressed(Key.Down); DebugDraw3D.Config.VisibleInstanceBounds = Input.IsKeyPressed(Key.Right); + // Regenerate meshes + if (Input.IsActionJustPressed("ui_end")) + DebugDraw3D.RegenerateGeometryMeshes(); + // Some property toggles if (_is_key_just_pressed(Key.Left)) DebugDraw3D.Config.UseFrustumCulling = !DebugDraw3D.Config.UseFrustumCulling; diff --git a/src/3d/debug_draw_3d.cpp b/src/3d/debug_draw_3d.cpp index bf1d1ade..924e59b6 100644 --- a/src/3d/debug_draw_3d.cpp +++ b/src/3d/debug_draw_3d.cpp @@ -292,12 +292,49 @@ Node *DebugDraw3D::get_root_node() { return root_node; } +Ref *DebugDraw3D::get_shared_meshes() { + LOCK_GUARD(datalock); + if (!shared_generated_meshes.size()) { + bool p_add_bevel = PS()->get_setting(root_settings_section + s_add_bevel_to_volumetric); + bool p_use_icosphere = PS()->get_setting(root_settings_section + s_use_icosphere); + bool p_use_icosphere_hd = PS()->get_setting(root_settings_section + s_use_icosphere_hd); + + shared_generated_meshes.resize((int)InstanceType::MAX); + + // WIREFRAME + + shared_generated_meshes[(int)InstanceType::CUBE] = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::CubeVertexes, GeometryGenerator::CubeIndexes); + shared_generated_meshes[(int)InstanceType::CUBE_CENTERED] = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::CenteredCubeVertexes, GeometryGenerator::CubeIndexes); + shared_generated_meshes[(int)InstanceType::ARROWHEAD] = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::ArrowheadVertexes, GeometryGenerator::ArrowheadIndexes); + shared_generated_meshes[(int)InstanceType::POSITION] = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::PositionVertexes, GeometryGenerator::PositionIndexes); + shared_generated_meshes[(int)InstanceType::SPHERE] = p_use_icosphere ? GeometryGenerator::CreateIcosphereLines(0.5f, 1) : GeometryGenerator::CreateSphereLines(8, 8, 0.5f, 2); + shared_generated_meshes[(int)InstanceType::SPHERE_HD] = p_use_icosphere_hd ? GeometryGenerator::CreateIcosphereLines(0.5f, 2) : GeometryGenerator::CreateSphereLines(16, 16, 0.5f, 2); + shared_generated_meshes[(int)InstanceType::CYLINDER] = GeometryGenerator::CreateCylinderLines(16, 1, 1, 2); + shared_generated_meshes[(int)InstanceType::CYLINDER_AB] = GeometryGenerator::RotatedMesh(GeometryGenerator::CreateCylinderLines(16, 1, 1, 2), Vector3_RIGHT, Math::deg_to_rad(90.f)); + + // VOLUMETRIC + + shared_generated_meshes[(int)InstanceType::LINE_VOLUMETRIC] = GeometryGenerator::ConvertWireframeToVolumetric(GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::LineVertexes), p_add_bevel); + shared_generated_meshes[(int)InstanceType::CUBE_VOLUMETRIC] = GeometryGenerator::ConvertWireframeToVolumetric(shared_generated_meshes[(int)InstanceType::CUBE], p_add_bevel); + shared_generated_meshes[(int)InstanceType::CUBE_CENTERED_VOLUMETRIC] = GeometryGenerator::ConvertWireframeToVolumetric(shared_generated_meshes[(int)InstanceType::CUBE_CENTERED], p_add_bevel); + shared_generated_meshes[(int)InstanceType::ARROWHEAD_VOLUMETRIC] = GeometryGenerator::CreateVolumetricArrowHead(.25f, 1.f, 1.f, p_add_bevel); + shared_generated_meshes[(int)InstanceType::POSITION_VOLUMETRIC] = GeometryGenerator::ConvertWireframeToVolumetric(shared_generated_meshes[(int)InstanceType::POSITION], p_add_bevel); + shared_generated_meshes[(int)InstanceType::SPHERE_VOLUMETRIC] = GeometryGenerator::ConvertWireframeToVolumetric(shared_generated_meshes[(int)InstanceType::SPHERE], false); + shared_generated_meshes[(int)InstanceType::SPHERE_HD_VOLUMETRIC] = GeometryGenerator::ConvertWireframeToVolumetric(shared_generated_meshes[(int)InstanceType::SPHERE_HD], false); + shared_generated_meshes[(int)InstanceType::CYLINDER_VOLUMETRIC] = GeometryGenerator::ConvertWireframeToVolumetric(shared_generated_meshes[(int)InstanceType::CYLINDER], false); + shared_generated_meshes[(int)InstanceType::CYLINDER_AB_VOLUMETRIC] = GeometryGenerator::ConvertWireframeToVolumetric(shared_generated_meshes[(int)InstanceType::CYLINDER_AB], false); + + // SOLID + + shared_generated_meshes[(int)InstanceType::BILLBOARD_SQUARE] = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_TRIANGLES, GeometryGenerator::CenteredSquareVertexes, GeometryGenerator::SquareBackwardsIndexes); + shared_generated_meshes[(int)InstanceType::PLANE] = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_TRIANGLES, GeometryGenerator::CenteredSquareVertexes, GeometryGenerator::SquareIndexes); + } + + return shared_generated_meshes.data(); +} + std::shared_ptr DebugDraw3D::create_debug_container() { - return std::make_shared( - this, - PS()->get_setting(root_settings_section + s_add_bevel_to_volumetric), - PS()->get_setting(root_settings_section + s_use_icosphere), - PS()->get_setting(root_settings_section + s_use_icosphere_hd)); + return std::make_shared(this); } std::shared_ptr DebugDraw3D::get_debug_container(Viewport *p_vp) { @@ -543,6 +580,10 @@ Ref DebugDraw3D::get_render_stats_for_world(Viewport *viewport void DebugDraw3D::regenerate_geometry_meshes() { #ifndef DISABLE_DEBUG_RENDERING LOCK_GUARD(datalock); + + // Force regenerate meshes + shared_generated_meshes.clear(); + for (auto &p : debug_containers) { Ref old_world = p.second->get_world(); diff --git a/src/3d/debug_draw_3d.h b/src/3d/debug_draw_3d.h index d08674b5..e30cfc6d 100644 --- a/src/3d/debug_draw_3d.h +++ b/src/3d/debug_draw_3d.h @@ -3,6 +3,7 @@ #include "common/colors.h" #include "common/i_scope_storage.h" #include "config_scope_3d.h" +#include "render_instances_enums.h" #include "utils/profiler.h" #include @@ -10,6 +11,7 @@ #include GODOT_WARNING_DISABLE() +#include #include #include #include @@ -26,9 +28,6 @@ class DebugDraw3DStats; #ifndef DISABLE_DEBUG_RENDERING class DebugGeometryContainer; struct DelayedRendererLine; - -enum class InstanceType : char; -enum class ConvertableInstanceType : char; #endif #ifndef DISABLE_DEBUG_RENDERING @@ -154,6 +153,8 @@ class DebugDraw3D : public Object, public IScopeStorage scoped_config_for_current_thread() override; // Meshes + /// Store meshes shared between many debug containers + std::vector > shared_generated_meshes; /// Store World3D id and debug container std::unordered_map > debug_containers; struct viewportToWorldCache { @@ -180,6 +181,7 @@ class DebugDraw3D : public Object, public IScopeStorage *get_shared_meshes(); std::shared_ptr create_debug_container(); std::shared_ptr get_debug_container(Viewport *p_vp); void _register_viewport_world_deferred(Viewport *p_vp, const uint64_t p_world_id); diff --git a/src/3d/debug_geometry_container.cpp b/src/3d/debug_geometry_container.cpp index 60f0417b..477322b5 100644 --- a/src/3d/debug_geometry_container.cpp +++ b/src/3d/debug_geometry_container.cpp @@ -16,7 +16,7 @@ GODOT_WARNING_DISABLE() GODOT_WARNING_RESTORE() using namespace godot; -DebugGeometryContainer::DebugGeometryContainer(class DebugDraw3D *p_root, const bool &p_add_bevel, const bool &p_use_icosphere, const bool &p_use_icosphere_hd) { +DebugGeometryContainer::DebugGeometryContainer(class DebugDraw3D *p_root) { ZoneScoped; owner = p_root; RenderingServer *rs = RenderingServer::get_singleton(); @@ -42,66 +42,33 @@ DebugGeometryContainer::DebugGeometryContainer(class DebugDraw3D *p_root, const // Generate geometry and create MMI's in RenderingServer { - auto array_mesh_cube = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::CubeVertexes, GeometryGenerator::CubeIndexes); - CreateMMI(InstanceType::CUBE, UsingShaderType::Wireframe, NAMEOF(mmi_cubes), array_mesh_cube); + auto *meshes = owner->get_shared_meshes(); - auto array_mesh_cube_center = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::CenteredCubeVertexes, GeometryGenerator::CubeIndexes); - CreateMMI(InstanceType::CUBE_CENTERED, UsingShaderType::Wireframe, NAMEOF(mmi_cubes_centered), array_mesh_cube_center); - - auto array_mesh_arrow_head = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::ArrowheadVertexes, GeometryGenerator::ArrowheadIndexes); - CreateMMI(InstanceType::ARROWHEAD, UsingShaderType::Wireframe, NAMEOF(mmi_arrowheads), array_mesh_arrow_head); - - auto array_mesh_pos = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::PositionVertexes, GeometryGenerator::PositionIndexes); - CreateMMI(InstanceType::POSITION, UsingShaderType::Wireframe, NAMEOF(mmi_positions), array_mesh_pos); - - auto array_mesh_sphere = p_use_icosphere ? GeometryGenerator::CreateIcosphereLines(0.5f, 1) : GeometryGenerator::CreateSphereLines(8, 8, 0.5f, 2); - CreateMMI(InstanceType::SPHERE, UsingShaderType::Wireframe, NAMEOF(mmi_spheres), array_mesh_sphere); - - auto array_mesh_sphere_hd = p_use_icosphere_hd ? GeometryGenerator::CreateIcosphereLines(0.5f, 2) : GeometryGenerator::CreateSphereLines(16, 16, 0.5f, 2); - CreateMMI(InstanceType::SPHERE_HD, UsingShaderType::Wireframe, NAMEOF(mmi_spheres_hd), array_mesh_sphere_hd); - - auto array_mesh_cylinder = GeometryGenerator::CreateCylinderLines(16, 1, 1, 2); - CreateMMI(InstanceType::CYLINDER, UsingShaderType::Wireframe, NAMEOF(mmi_cylinders), array_mesh_cylinder); - - auto array_mesh_cylinder_ab = GeometryGenerator::RotatedMesh(GeometryGenerator::CreateCylinderLines(16, 1, 1, 2), Vector3_RIGHT, Math::deg_to_rad(90.f)); - CreateMMI(InstanceType::CYLINDER_AB, UsingShaderType::Wireframe, NAMEOF(mmi_cylinders), array_mesh_cylinder_ab); + CreateMMI(InstanceType::CUBE, UsingShaderType::Wireframe, NAMEOF(mmi_cubes), meshes[(int)InstanceType::CUBE]); + CreateMMI(InstanceType::CUBE_CENTERED, UsingShaderType::Wireframe, NAMEOF(mmi_cubes_centered), meshes[(int)InstanceType::CUBE_CENTERED]); + CreateMMI(InstanceType::ARROWHEAD, UsingShaderType::Wireframe, NAMEOF(mmi_arrowheads), meshes[(int)InstanceType::ARROWHEAD]); + CreateMMI(InstanceType::POSITION, UsingShaderType::Wireframe, NAMEOF(mmi_positions), meshes[(int)InstanceType::POSITION]); + CreateMMI(InstanceType::SPHERE, UsingShaderType::Wireframe, NAMEOF(mmi_spheres), meshes[(int)InstanceType::SPHERE]); + CreateMMI(InstanceType::SPHERE_HD, UsingShaderType::Wireframe, NAMEOF(mmi_spheres_hd), meshes[(int)InstanceType::SPHERE_HD]); + CreateMMI(InstanceType::CYLINDER, UsingShaderType::Wireframe, NAMEOF(mmi_cylinders), meshes[(int)InstanceType::CYLINDER]); + CreateMMI(InstanceType::CYLINDER_AB, UsingShaderType::Wireframe, NAMEOF(mmi_cylinders), meshes[(int)InstanceType::CYLINDER_AB]); // VOLUMETRIC - auto array_mesh_line_volumetric = GeometryGenerator::ConvertWireframeToVolumetric(GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_LINES, GeometryGenerator::LineVertexes), p_add_bevel); - CreateMMI(InstanceType::LINE_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cubes_volumetric), array_mesh_line_volumetric); - - auto array_mesh_cube_volumetric = GeometryGenerator::ConvertWireframeToVolumetric(array_mesh_cube, p_add_bevel); - CreateMMI(InstanceType::CUBE_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cubes_volumetric), array_mesh_cube_volumetric); - - auto array_mesh_cube_centered_volumetric = GeometryGenerator::ConvertWireframeToVolumetric(array_mesh_cube_center, p_add_bevel); - CreateMMI(InstanceType::CUBE_CENTERED_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cubes_centered_volumetric), array_mesh_cube_centered_volumetric); - - auto array_mesh_arrow_head_volumetric = GeometryGenerator::CreateVolumetricArrowHead(.25f, 1.f, 1.f, p_add_bevel); - CreateMMI(InstanceType::ARROWHEAD_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_arrowheads_volumetric), array_mesh_arrow_head_volumetric); - - auto array_mesh_pos_volumetric = GeometryGenerator::ConvertWireframeToVolumetric(array_mesh_pos, p_add_bevel); - CreateMMI(InstanceType::POSITION_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_positions_volumetric), array_mesh_pos_volumetric); - - auto array_mesh_sphere_volumetric = GeometryGenerator::ConvertWireframeToVolumetric(array_mesh_sphere, false); - CreateMMI(InstanceType::SPHERE_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_spheres_volumetric), array_mesh_sphere_volumetric); - - auto array_mesh_sphere_hd_volumetric = GeometryGenerator::ConvertWireframeToVolumetric(array_mesh_sphere_hd, false); - CreateMMI(InstanceType::SPHERE_HD_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_spheres_hd_volumetric), array_mesh_sphere_hd_volumetric); - - auto array_mesh_cylinder_volumetric = GeometryGenerator::ConvertWireframeToVolumetric(array_mesh_cylinder, false); - CreateMMI(InstanceType::CYLINDER_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cylinders_volumetric), array_mesh_cylinder_volumetric); - - auto array_mesh_cylinder_ab_volumetric = GeometryGenerator::ConvertWireframeToVolumetric(array_mesh_cylinder_ab, false); - CreateMMI(InstanceType::CYLINDER_AB_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cylinders_volumetric), array_mesh_cylinder_ab_volumetric); + CreateMMI(InstanceType::LINE_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cubes_volumetric), meshes[(int)InstanceType::LINE_VOLUMETRIC]); + CreateMMI(InstanceType::CUBE_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cubes_volumetric), meshes[(int)InstanceType::CUBE_VOLUMETRIC]); + CreateMMI(InstanceType::CUBE_CENTERED_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cubes_centered_volumetric), meshes[(int)InstanceType::CUBE_CENTERED_VOLUMETRIC]); + CreateMMI(InstanceType::ARROWHEAD_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_arrowheads_volumetric), meshes[(int)InstanceType::ARROWHEAD_VOLUMETRIC]); + CreateMMI(InstanceType::POSITION_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_positions_volumetric), meshes[(int)InstanceType::POSITION_VOLUMETRIC]); + CreateMMI(InstanceType::SPHERE_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_spheres_volumetric), meshes[(int)InstanceType::SPHERE_VOLUMETRIC]); + CreateMMI(InstanceType::SPHERE_HD_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_spheres_hd_volumetric), meshes[(int)InstanceType::SPHERE_HD_VOLUMETRIC]); + CreateMMI(InstanceType::CYLINDER_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cylinders_volumetric), meshes[(int)InstanceType::CYLINDER_VOLUMETRIC]); + CreateMMI(InstanceType::CYLINDER_AB_VOLUMETRIC, UsingShaderType::Expandable, NAMEOF(mmi_cylinders_volumetric), meshes[(int)InstanceType::CYLINDER_AB_VOLUMETRIC]); // SOLID - auto array_mesh_billboard = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_TRIANGLES, GeometryGenerator::CenteredSquareVertexes, GeometryGenerator::SquareBackwardsIndexes); - CreateMMI(InstanceType::BILLBOARD_SQUARE, UsingShaderType::Billboard, NAMEOF(mmi_billboard_squares), array_mesh_billboard); - - auto array_mesh_plane = GeometryGenerator::CreateMeshNative(Mesh::PrimitiveType::PRIMITIVE_TRIANGLES, GeometryGenerator::CenteredSquareVertexes, GeometryGenerator::SquareIndexes); - CreateMMI(InstanceType::PLANE, UsingShaderType::Solid, NAMEOF(mmi_planes), array_mesh_plane); + CreateMMI(InstanceType::BILLBOARD_SQUARE, UsingShaderType::Billboard, NAMEOF(mmi_billboard_squares), meshes[(int)InstanceType::BILLBOARD_SQUARE]); + CreateMMI(InstanceType::PLANE, UsingShaderType::Solid, NAMEOF(mmi_planes), meshes[(int)InstanceType::PLANE]); set_render_layer_mask(1); } diff --git a/src/3d/debug_geometry_container.h b/src/3d/debug_geometry_container.h index 133f1544..1c8ea78c 100644 --- a/src/3d/debug_geometry_container.h +++ b/src/3d/debug_geometry_container.h @@ -57,7 +57,7 @@ class DebugGeometryContainer { void CreateMMI(InstanceType p_type, UsingShaderType p_shader, const String &p_name, Ref p_mesh); public: - DebugGeometryContainer(class DebugDraw3D *p_root, const bool &p_add_bevel, const bool &p_use_icosphere, const bool &p_use_icosphere_hd); + DebugGeometryContainer(class DebugDraw3D *p_root); ~DebugGeometryContainer(); void set_world(Ref p_new_world); diff --git a/src/3d/render_instances.h b/src/3d/render_instances.h index d51a09fd..4747881a 100644 --- a/src/3d/render_instances.h +++ b/src/3d/render_instances.h @@ -2,7 +2,8 @@ #ifndef DISABLE_DEBUG_RENDERING -#include "3d/config_scope_3d.h" +#include "config_scope_3d.h" +#include "render_instances_enums.h" #include "utils/math_utils.h" #include "utils/utils.h" @@ -21,57 +22,6 @@ class MultiMesh; class DebugDraw3DStats; class GeometryPool; -enum class GeometryType : char { - Wireframe, - Volumetric, - Solid, -}; - -enum class ConvertableInstanceType : char { - CUBE, - CUBE_CENTERED, - ARROWHEAD, - POSITION, - SPHERE, - CYLINDER, - CYLINDER_AB, -}; - -enum class InstanceType : char { - // Basic wireframe - CUBE, - CUBE_CENTERED, - ARROWHEAD, - POSITION, - SPHERE, - SPHERE_HD, - CYLINDER, - CYLINDER_AB, - - // Volumetric from wireframes - LINE_VOLUMETRIC, - CUBE_VOLUMETRIC, - CUBE_CENTERED_VOLUMETRIC, - ARROWHEAD_VOLUMETRIC, - POSITION_VOLUMETRIC, - SPHERE_VOLUMETRIC, - SPHERE_HD_VOLUMETRIC, - CYLINDER_VOLUMETRIC, - CYLINDER_AB_VOLUMETRIC, - - // Solid geometry - BILLBOARD_SQUARE, - PLANE, - - MAX, -}; - -enum class ProcessType : char { - PROCESS, - PHYSICS_PROCESS, - MAX, -}; - class GeometryPoolCullingData { public: std::vector > m_frustums; diff --git a/src/3d/render_instances_enums.h b/src/3d/render_instances_enums.h new file mode 100644 index 00000000..14042dfb --- /dev/null +++ b/src/3d/render_instances_enums.h @@ -0,0 +1,52 @@ +#pragma once + +enum class GeometryType : char { + Wireframe, + Volumetric, + Solid, +}; + +enum class ConvertableInstanceType : char { + CUBE, + CUBE_CENTERED, + ARROWHEAD, + POSITION, + SPHERE, + CYLINDER, + CYLINDER_AB, +}; + +enum class InstanceType : char { + // Basic wireframe + CUBE, + CUBE_CENTERED, + ARROWHEAD, + POSITION, + SPHERE, + SPHERE_HD, + CYLINDER, + CYLINDER_AB, + + // Volumetric from wireframes + LINE_VOLUMETRIC, + CUBE_VOLUMETRIC, + CUBE_CENTERED_VOLUMETRIC, + ARROWHEAD_VOLUMETRIC, + POSITION_VOLUMETRIC, + SPHERE_VOLUMETRIC, + SPHERE_HD_VOLUMETRIC, + CYLINDER_VOLUMETRIC, + CYLINDER_AB_VOLUMETRIC, + + // Solid geometry + BILLBOARD_SQUARE, + PLANE, + + MAX, +}; + +enum class ProcessType : char { + PROCESS, + PHYSICS_PROCESS, + MAX, +}; diff --git a/src/dev_debug_draw_3d_Library.vcxproj b/src/dev_debug_draw_3d_Library.vcxproj index 61800b3f..91b0e638 100644 --- a/src/dev_debug_draw_3d_Library.vcxproj +++ b/src/dev_debug_draw_3d_Library.vcxproj @@ -369,6 +369,7 @@ false + false diff --git a/src/dev_debug_draw_3d_Library.vcxproj.filters b/src/dev_debug_draw_3d_Library.vcxproj.filters index 681d31dd..5f95a140 100644 --- a/src/dev_debug_draw_3d_Library.vcxproj.filters +++ b/src/dev_debug_draw_3d_Library.vcxproj.filters @@ -145,6 +145,9 @@ common + + 3d +