Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MetaParser, RHI, some render bugfixes #276

Merged
merged 44 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0963f91
Refactor Editor Framework
May 16, 2022
86c4445
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 16, 2022
b340e38
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 16, 2022
dfd4dee
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 16, 2022
03fdd40
Fix naming typo, filed to field
May 16, 2022
a6e9f78
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 20, 2022
896e8d5
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 20, 2022
25b3a4d
editor input refactor
May 20, 2022
90dc3e8
fix editor mac build
May 20, 2022
d0f39bf
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 21, 2022
9bb2b5d
Refactor rendering architecture
kwbm May 21, 2022
d0c27a9
Fix Linux Compile Error and Warnings
hyv1001 May 22, 2022
9629029
Fix Linux Compile Error
hyv1001 May 22, 2022
6093dc1
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 22, 2022
01a2da7
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 22, 2022
41c30f1
Fix render system problem when reloading current level
kwbm May 24, 2022
49bc01c
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 24, 2022
07895f6
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 24, 2022
c01bea5
Move camera update info in camera component tick to swap data context…
kwbm May 26, 2022
c41cd80
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 29, 2022
8e4df34
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 29, 2022
4ad44bc
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 30, 2022
73641e5
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 30, 2022
ba87186
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev May 31, 2022
a6cae86
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev Jun 1, 2022
f5f7879
Jolt optimization
Jun 1, 2022
1d61cef
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev Jun 1, 2022
7c33667
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev Jun 2, 2022
3a45a71
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev Jun 9, 2022
fcc87a4
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev Jun 16, 2022
a480614
Feature/add mustache support
keke-ship Jun 16, 2022
81e2ab2
Update README.md
Jun 16, 2022
42699ed
rename
Jun 20, 2022
53c4f53
replace robot texture
Ol6rin Jun 20, 2022
3d52af3
fix compile error on Ubuntu.
hyv1001 Jun 24, 2022
e89a2c5
add .gitlab
miman-booming Jun 24, 2022
7faac3d
rename folder name
keke-ship Jun 24, 2022
5a1a739
Update .gitlab/.gitlab-ci.yml file
Jun 25, 2022
6a815d1
fix JoltPhysics macOS std::aligned_alloc compile error
Ol6rin Jun 28, 2022
5c3245c
fix editor ui creator bug
Jun 28, 2022
0a92669
change editor function name
Jun 29, 2022
8da7c7a
Fix motor
Jun 29, 2022
6cdcc4b
Update README.md
BoomingTechDev Jun 29, 2022
efafc3a
Merge branch 'BoomingTech:main' into upstream
BoomingTechDev Jun 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .gitlab/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.job_rules_template: &job_rules
stage: build
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"
&& $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"
&& $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "upstream"'

build_in_mac:
tags:
- mac
- shell
<<: *job_rules
script:
- ./build_macos.sh release

build_in_ubuntu:
image: cmake:3.23 # you can build it with Dockerfile offered in this project
tags:
- ubuntu
- docker
<<: *job_rules
script:
- ./build_linux.sh release

build_in_windows:
tags:
- windows
- shell
<<: *job_rules
script:
- ./build_windows.bat

15 changes: 15 additions & 0 deletions .gitlab/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ubuntu:20.04
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive TZ=Asia/Shanghai apt install -y \
libxrandr-dev libxrender-dev libxinerama-dev libxcursor-dev \
libxi-dev libglvnd-dev libvulkan-dev clang libc++-dev libglew-dev \
libglfw3-dev vulkan-validationlayers mesa-vulkan-drivers wget \
build-essential libssl-dev
RUN cd && wget https://cmake.org/files/v3.23/cmake-3.23.1.tar.gz \
&& tar xf cmake-3.23.1.tar.gz \
&& cd cmake-3.23.1 \
&& ./bootstrap \
&& make \
&& make install \
&& ln -s /usr/local/bin/cmake /usr/bin/cmake

6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)

project(Pilot VERSION 0.1.0)
project(Piccolo VERSION 0.1.0)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -16,8 +16,8 @@ if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
)
endif()

set(PILOT_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_INSTALL_PREFIX "${PILOT_ROOT_DIR}/bin")
set(PICCOLO_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_INSTALL_PREFIX "${PICCOLO_ROOT_DIR}/bin")
set(BINARY_ROOT_DIR "${CMAKE_INSTALL_PREFIX}/")


Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

| Build Type | Status |
| :---------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| **Build Windows** | [![Build Windows](https://github.com/BoomingTech/Pilot/actions/workflows/build_windows.yml/badge.svg)](https://github.com/BoomingTech/Pilot/actions/workflows/build_windows.yml) |
| **Build Linux** | [![Build Linux](https://github.com/BoomingTech/Pilot/actions/workflows/build_linux.yml/badge.svg)](https://github.com/BoomingTech/Pilot/actions/workflows/build_linux.yml) |
| **Build macOS** | [![Build macOS](https://github.com/BoomingTech/Pilot/actions/workflows/build_macos.yml/badge.svg)](https://github.com/BoomingTech/Pilot/actions/workflows/build_macos.yml) |
| **Build Windows** | [![Build Windows](https://github.com/BoomingTech/Piccolo/actions/workflows/build_windows.yml/badge.svg)](https://github.com/BoomingTech/Piccolo/actions/workflows/build_windows.yml) |
| **Build Linux** | [![Build Linux](https://github.com/BoomingTech/Piccolo/actions/workflows/build_linux.yml/badge.svg)](https://github.com/BoomingTech/Piccolo/actions/workflows/build_linux.yml) |
| **Build macOS** | [![Build macOS](https://github.com/BoomingTech/Piccolo/actions/workflows/build_macos.yml/badge.svg)](https://github.com/BoomingTech/Piccolo/actions/workflows/build_macos.yml) |

## Prerequisites

Expand Down Expand Up @@ -96,3 +96,14 @@ For Windows:
cmake -DCMAKE_TRY_COMPILE_TARGET_TYPE="STATIC_LIBRARY" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S . -B compile_db_temp -G "Unix Makefiles"
copy compile_db_temp\compile_commands.json .
```

### Using Physics Debug Renderer
Currently Physics Debug Renderer is only available on Windows. You can use the following command to generate the solution with the debugger project.

``` powershell
cmake -S . -B build -DENABLE_PHYSICS_DEBUG_RENDERER=ON
```

Note:
1. Please clean the build directory before regenerating the solution. We've encountered building problems in regenerating directly with previous CMakeCache.
2. Physics Debug Renderer will run when you start PiccoloEditor. We've synced the camera position between both scenes. But the initial camera mode in Physics Debug Renderer is wrong. Scrolling down the mouse wheel once will change the camera of Physics Debug Renderer to the correct mode.
2 changes: 1 addition & 1 deletion cmake/ShaderCompile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function(compile_shader SHADERS TARGET_NAME SHADER_INCLUDE_FOLDER GENERATED_DIR
add_custom_command(
OUTPUT ${CPP_FILE}
COMMAND ${CMAKE_COMMAND} -DPATH=${SPV_FILE} -DHEADER="${CPP_FILE}"
-DGLOBAL="${GLOBAL_SHADER_VAR}" -P "${PILOT_ROOT_DIR}/cmake/GenerateShaderCPPFile.cmake"
-DGLOBAL="${GLOBAL_SHADER_VAR}" -P "${PICCOLO_ROOT_DIR}/cmake/GenerateShaderCPPFile.cmake"
DEPENDS ${SPV_FILE}
WORKING_DIRECTORY "${working_dir}")

Expand Down
2 changes: 1 addition & 1 deletion engine/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
generated/
!bin/
bin/
12 changes: 12 additions & 0 deletions engine/3rdparty/JoltPhysics/Jolt/Core/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ JPH_SUPPRESS_WARNINGS_STD_BEGIN
JPH_SUPPRESS_WARNINGS_STD_END
#include <stdlib.h>

#if defined(__APPLE__)
#include <AvailabilityMacros.h>
#endif

JPH_NAMESPACE_BEGIN

void *AlignedAlloc(size_t inSize, size_t inAlignment)
Expand All @@ -19,6 +23,14 @@ void *AlignedAlloc(size_t inSize, size_t inAlignment)
return _aligned_malloc(inSize, inAlignment);
#elif defined(JPH_PLATFORM_ANDROID)
return memalign(inAlignment, AlignUp(inSize, inAlignment));
#elif defined(__APPLE__) && (defined(MAC_OS_X_VERSION_10_16)) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16
// For C++14, usr/include/malloc/_malloc.h declares aligned_alloc()) only
// with the MacOSX11.0 SDK in Xcode 12 (which is what adds
// MAC_OS_X_VERSION_10_16), even though the function is marked
// availabe for 10.15. That's why the preprocessor checks for 10.16 but
// the __builtin_available checks for 10.15.
// People who use C++17 could call aligned_alloc with the 10.15 SDK already.
return aligned_alloc(inAlignment, AlignUp(inSize, inAlignment));
#else
return std::aligned_alloc(inAlignment, AlignUp(inSize, inAlignment));
#endif
Expand Down
20 changes: 11 additions & 9 deletions engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

set(ENGINE_ROOT_DIR "${PILOT_ROOT_DIR}/engine")
set(ENGINE_ROOT_DIR "${PICCOLO_ROOT_DIR}/engine")
set(THIRD_PARTY_DIR "${ENGINE_ROOT_DIR}/3rdparty")
set(ENGINE_ASSET_DIR "/asset")

Expand All @@ -22,42 +22,44 @@ endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options("/MP")
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT PilotEditor)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT PiccoloEditor)
endif()

set(vulkan_include ${THIRD_PARTY_DIR}/VulkanSDK/include)

if(WIN32)
set(vulkan_lib ${THIRD_PARTY_DIR}/VulkanSDK/lib/Win32/vulkan-1.lib)
set(glslangValidator_executable ${THIRD_PARTY_DIR}/VulkanSDK/bin/Win32/glslangValidator.exe)
add_compile_definitions("PILOT_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/Win32")
add_compile_definitions("PICCOLO_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/Win32")
elseif(UNIX)
if(APPLE)
set(vulkan_lib ${THIRD_PARTY_DIR}/VulkanSDK/lib/MacOS/libvulkan.1.dylib)
set(glslangValidator_executable ${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS/glslangValidator)
add_compile_definitions("PILOT_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS")
add_compile_definitions("PILOT_VK_ICD_FILENAMES=${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS/MoltenVK_icd.json")
add_compile_definitions("PICCOLO_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS")
add_compile_definitions("PICCOLO_VK_ICD_FILENAMES=${THIRD_PARTY_DIR}/VulkanSDK/bin/MacOS/MoltenVK_icd.json")
else()
set(vulkan_lib ${THIRD_PARTY_DIR}/VulkanSDK/lib/Linux/libvulkan.so.1)
set(glslangValidator_executable ${THIRD_PARTY_DIR}/VulkanSDK/bin/Linux/glslangValidator)
add_compile_definitions("PILOT_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/Linux")
add_compile_definitions("PICCOLO_VK_LAYER_PATH=${THIRD_PARTY_DIR}/VulkanSDK/bin/Linux")
endif()
else()
message(FATAL_ERROR "Unknown Platform")
endif()


set(SHADER_COMPILE_TARGET PilotShaderCompile)
set(SHADER_COMPILE_TARGET PiccoloShaderCompile)
add_subdirectory(shader)

add_subdirectory(3rdparty)

add_subdirectory(source/runtime)
add_subdirectory(source/editor)
add_subdirectory(source/meta_parser)
#add_subdirectory(source/test)

set(CODEGEN_TARGET "PilotPreCompile")
set(CODEGEN_TARGET "PiccoloPreCompile")
include(source/precompile/precompile.cmake)
set_target_properties("${CODEGEN_TARGET}" PROPERTIES FOLDER "Engine" )

add_dependencies(PilotRuntime "${CODEGEN_TARGET}")
add_dependencies(PiccoloRuntime "${CODEGEN_TARGET}")
add_dependencies("${CODEGEN_TARGET}" "PiccoloParser")
6 changes: 5 additions & 1 deletion engine/asset/level/1-1.level.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"gravity": 15,
"gravity": {
"x": 0,
"y": 0,
"z": -15
},
"character_name": "Player",
"objects": [
{
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion engine/asset/objects/character/player/player.object.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
},
"$typeName": "PhysicsControllerConfig"
},
"jump_height": 0,
"jump_height": 1,
"max_move_speed_ratio": 1,
"max_sprint_speed_ratio": 2,
"move_acceleration": 2,
Expand Down
Loading