Skip to content

Commit 9a044b3

Browse files
BoomingTechDevZhanweiDangTECH-RE-徐泽远Ol6rinTECH-CE-刘沐寒
authored
Merge internal dev fetaures and bug fix (#377)
* Glm2 chaos math * 渲染结果无法跟随imgui窗口移动的bug * Glm2 chaos math * 渲染结果无法跟随imgui窗口移动的bug * Gpu particle system * Particle presentation * toggle free camera mode * Fix particle local variable usage * update rhi * add debugdraw * Remove legacy physics system * Fix wrong debug draw frame buffer count * Fix macos crash * resolve merge conflict Co-authored-by: TECH-RE-党占威 <zhanwei.dang@boomingtech.com> Co-authored-by: TECH-RE-徐泽远 <zeyuan.xu@boominggames.com> Co-authored-by: muhan.liu <muhan.liu@boomingtech.com> Co-authored-by: TECH-CE-刘沐寒 <muhan.liu@boominggames.com> Co-authored-by: TECH-RE-王坤 <kun.wang@boomingtech.com> Co-authored-by: TECH-RE-叶佳伟 <jiawei.ye@boomingtech.com> Co-authored-by: liangliang.ma <liangliang.ma@boomingtech.com>
1 parent 3183f4b commit 9a044b3

File tree

101 files changed

+15076
-7758
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+15076
-7758
lines changed

build_windows.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
@echo off
22

33
cmake -S . -B build
4-
cmake --build build --config Release
4+
cmake --build build --config Release
5+
6+
pause

engine/3rdparty/vulkanmemoryallocator/include/vk_mem_alloc.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ extern "C" {
256256
// see: https://clang.llvm.org/docs/AttributeReference.html#nullable
257257
#ifndef VMA_NULLABLE
258258
#ifdef __clang__
259-
#define VMA_NULLABLE _Nullable
259+
#define VMA_NULLABLE
260260
#else
261261
#define VMA_NULLABLE
262262
#endif
@@ -266,7 +266,7 @@ extern "C" {
266266
// see: https://clang.llvm.org/docs/AttributeReference.html#nonnull
267267
#ifndef VMA_NOT_NULL
268268
#ifdef __clang__
269-
#define VMA_NOT_NULL _Nonnull
269+
#define VMA_NOT_NULL
270270
#else
271271
#define VMA_NOT_NULL
272272
#endif
@@ -13902,6 +13902,10 @@ bool VmaDefragmentationContext_T::ComputeDefragmentation_Extensive(VmaBlockVecto
1390213902
}
1390313903
break;
1390413904
}
13905+
case StateExtensive::Operation::Cleanup:
13906+
{
13907+
break;
13908+
}
1390513909
}
1390613910

1390713911
if (vectorState.operation == StateExtensive::Operation::Cleanup)

engine/shader/glsl/combine_ui.frag

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ void main()
1919
// Gamma correct
2020
// TODO: select the VK_FORMAT_B8G8R8A8_SRGB surface format,
2121
// there is no need to do gamma correction in the fragment shader
22-
ui_color = vec4(pow(ui_color.r, 1.0 / 2.2), pow(ui_color.g, 1.0 / 2.2), pow(ui_color.b, 1.0 / 2.2), pow(ui_color.a, 1.0 / 2.2));
23-
24-
out_color = scene_color + ui_color;
22+
if(ui_color.r<1e-6&&ui_color.g<1e-6&&ui_color.a<1e-6)
23+
{
24+
ui_color = vec4(pow(ui_color.r, 1.0 / 2.2), pow(ui_color.g, 1.0 / 2.2), pow(ui_color.b, 1.0 / 2.2), pow(ui_color.a, 1.0 / 2.2));
25+
out_color = scene_color;
26+
}
27+
else
28+
{
29+
ui_color = vec4(pow(ui_color.r, 1.0 / 2.2), pow(ui_color.g, 1.0 / 2.2), pow(ui_color.b, 1.0 / 2.2), pow(ui_color.a, 1.0 / 2.2));
30+
out_color = ui_color;
31+
}
2532
}

engine/shader/glsl/debugdraw.frag

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#version 450
2+
3+
#extension GL_GOOGLE_include_directive :enable
4+
layout(location = 0) in vec4 fragColor;
5+
layout(location = 1) in vec2 fragTexCoord;
6+
7+
layout(location = 0) out vec4 outColor;
8+
9+
layout(set = 0, binding = 2) uniform sampler2D texSampler;
10+
11+
12+
void main(){
13+
outColor = fragColor;
14+
if(fragTexCoord.x >= 0.0f && fragTexCoord.y >= 0.0f)
15+
{
16+
vec4 tex = texture(texSampler, fragTexCoord);
17+
float xi = tex.r;
18+
outColor = vec4(fragColor.r*xi,fragColor.g*xi,fragColor.b*xi,fragColor.a*xi);
19+
}
20+
}

engine/shader/glsl/debugdraw.vert

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#version 450
2+
3+
#extension GL_GOOGLE_include_directive :enable
4+
#include "constants.h"
5+
6+
layout(location = 0) in vec3 inPosition;
7+
layout(location = 1) in vec4 inColor;
8+
layout(location = 2) in vec2 texcoord;
9+
10+
layout(set = 0, binding = 0) uniform UniformBufferObject {
11+
mat4 proj_view_matrix;
12+
} ubo;
13+
14+
layout(set = 0, binding = 1) uniform UniformDynamicBufferObject {
15+
mat4 model;
16+
vec4 color;
17+
} dynamic_ubo;
18+
19+
layout(location = 0) out vec4 fragColor;
20+
layout(location = 1) out vec2 fragTexCoord;
21+
22+
void main() {
23+
if(texcoord.x<0)
24+
{
25+
gl_Position = ubo.proj_view_matrix * dynamic_ubo.model * vec4(inPosition,1.0);
26+
}
27+
else
28+
{
29+
gl_Position = vec4(inPosition,1.0);
30+
}
31+
32+
gl_PointSize = 2;
33+
34+
if(dynamic_ubo.color.a>0.000001)
35+
{
36+
fragColor = dynamic_ubo.color;
37+
}
38+
else
39+
{
40+
fragColor = inColor;
41+
}
42+
fragTexCoord = texcoord;
43+
}

engine/source/editor/source/editor_ui.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "runtime/function/render/render_camera.h"
2424
#include "runtime/function/render/render_system.h"
2525
#include "runtime/function/render/window_system.h"
26+
#include "runtime/function/render/render_debug_config.h"
2627

2728
#include <imgui.h>
2829
#include <imgui_internal.h>
@@ -336,6 +337,38 @@ namespace Piccolo
336337
{
337338
g_runtime_global_context.m_world_manager->saveCurrentLevel();
338339
}
340+
if (ImGui::BeginMenu("Debug"))
341+
{
342+
if (ImGui::BeginMenu("Animation"))
343+
{
344+
if (ImGui::MenuItem(g_runtime_global_context.m_render_debug_config->animation.show_skeleton ? "off skeleton" : "show skeleton"))
345+
{
346+
g_runtime_global_context.m_render_debug_config->animation.show_skeleton = !g_runtime_global_context.m_render_debug_config->animation.show_skeleton;
347+
}
348+
if (ImGui::MenuItem(g_runtime_global_context.m_render_debug_config->animation.show_bone_name ? "off bone name" : "show bone name"))
349+
{
350+
g_runtime_global_context.m_render_debug_config->animation.show_bone_name = !g_runtime_global_context.m_render_debug_config->animation.show_bone_name;
351+
}
352+
ImGui::EndMenu();
353+
}
354+
if (ImGui::BeginMenu("Camera"))
355+
{
356+
if (ImGui::MenuItem(g_runtime_global_context.m_render_debug_config->camera.show_runtime_info ? "off runtime info" : "show runtime info"))
357+
{
358+
g_runtime_global_context.m_render_debug_config->camera.show_runtime_info = !g_runtime_global_context.m_render_debug_config->camera.show_runtime_info;
359+
}
360+
ImGui::EndMenu();
361+
}
362+
if (ImGui::BeginMenu("Game Object"))
363+
{
364+
if (ImGui::MenuItem(g_runtime_global_context.m_render_debug_config->gameObject.show_bounding_box ? "off bounding box" : "show bounding box"))
365+
{
366+
g_runtime_global_context.m_render_debug_config->gameObject.show_bounding_box = !g_runtime_global_context.m_render_debug_config->gameObject.show_bounding_box;
367+
}
368+
ImGui::EndMenu();
369+
}
370+
ImGui::EndMenu();
371+
}
339372
if (ImGui::MenuItem("Exit"))
340373
{
341374
g_editor_global_context.m_engine_runtime->shutdownEngine();

engine/source/runtime/engine.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "runtime/function/physics/physics_manager.h"
1111
#include "runtime/function/render/render_system.h"
1212
#include "runtime/function/render/window_system.h"
13+
#include "runtime/function/render/debugdraw/debug_draw_manager.h"
1314

1415
namespace Piccolo
1516
{
@@ -73,7 +74,7 @@ namespace Piccolo
7374
// exchange data between logic and render contexts
7475
g_runtime_global_context.m_render_system->swapLogicRenderData();
7576

76-
rendererTick();
77+
rendererTick(delta_time);
7778

7879
#ifdef ENABLE_PHYSICS_DEBUG_RENDERER
7980
g_runtime_global_context.m_physics_manager->renderPhysicsWorld(delta_time);
@@ -95,9 +96,9 @@ namespace Piccolo
9596
g_runtime_global_context.m_input_system->tick();
9697
}
9798

98-
bool PiccoloEngine::rendererTick()
99+
bool PiccoloEngine::rendererTick(float delta_time)
99100
{
100-
g_runtime_global_context.m_render_system->tick();
101+
g_runtime_global_context.m_render_system->tick(delta_time);
101102
return true;
102103
}
103104

engine/source/runtime/engine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Piccolo
3232

3333
protected:
3434
void logicalTick(float delta_time);
35-
bool rendererTick();
35+
bool rendererTick(float delta_time);
3636

3737
void calculateFPS(float delta_time);
3838

engine/source/runtime/function/animation/skeleton.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,14 @@ namespace Piccolo
154154
}
155155
return animation_result;
156156
}
157+
158+
const Bone* Skeleton::getBones() const
159+
{
160+
return m_bones;
161+
}
162+
163+
int32_t Skeleton::getBonesCount() const
164+
{
165+
return m_bone_count;
166+
}
157167
} // namespace Piccolo

engine/source/runtime/function/animation/skeleton.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ namespace Piccolo
2323
void applyAnimation(const BlendStateWithClipData& blend_state);
2424
AnimationResult outputAnimationResult();
2525
void resetSkeleton();
26+
const Bone* getBones() const;
27+
int32_t getBonesCount() const;
2628
};
2729
} // namespace Piccolo

0 commit comments

Comments
 (0)