Compare commits

..

4 Commits

Author SHA1 Message Date
zhh b6d8ca428f Fix Skybox Init Directory 2026-08-22 19:23:47 +09:00
zhh 9f15aaa9e6 Init commit 2026-08-17 14:52:49 +09:00
zhh 709ffc074f Merge remote-tracking branch 'origin/main' 2026-08-17 14:48:20 +09:00
zhh c4e6216bb5 Init commit 2026-08-17 14:48:02 +09:00
11 changed files with 29 additions and 9 deletions
+1
View File
@@ -38,3 +38,4 @@ CMakeLocalPath.cmake
# Folders # Folders
camke-build-debug/ camke-build-debug/
.idea/ .idea/
build/
+2
View File
@@ -4,3 +4,5 @@
Please check `core/include/render_type_def.h` for the buffer order convention in HLSL to write a shader Please check `core/include/render_type_def.h` for the buffer order convention in HLSL to write a shader
When CMAKE is called for the first time, the library path file will be generated in the root directory. Please configure the directory of qt6.10 yourself. In addition, the dependent assimp is uploaded to this repository because its size is relatively small. When CMAKE is called for the first time, the library path file will be generated in the root directory. Please configure the directory of qt6.10 yourself. In addition, the dependent assimp is uploaded to this repository because its size is relatively small.
CRT must be vc143 version. If you ve compiled but cant run successfully, please use the vs2022/MSVC14.44's crt dll.
Binary file not shown.

After

Width:  |  Height:  |  Size: 602 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 KiB

+2
View File
@@ -47,10 +47,12 @@ add_library(${TG_RENDER} SHARED
) )
target_compile_definitions(${TG_RENDER} target_compile_definitions(${TG_RENDER}
PRIVATE PRIVATE
RENDER_SHARED_LIB RENDER_SHARED_LIB
RENDER_DLL_OUTPUT RENDER_DLL_OUTPUT
PROJECT_ROOT="${PROJECT_SOURCE_DIR}"
) )
target_link_libraries(${TG_RENDER} target_link_libraries(${TG_RENDER}
+4 -2
View File
@@ -78,8 +78,10 @@ Renderer::Renderer(Graphic &graphic) : m_graphic(graphic) {
} }
// [新增] 默认尝试读取 C:/temp。文件不存在时不阻止引擎启动,PBR 会使用旧环境项回退。 // [新增] 默认尝试读取 C:/temp。文件不存在时不阻止引擎启动,PBR 会使用旧环境项回退。
if (!LoadEnvironmentCubeDirectory(L"C:/temp")) { std::filesystem::path cubeDir = std::filesystem::path{StatesRender::S_GetExeDir()} / std::filesystem::path{L"assets/skybox"};
OutputDebugStringW(L"未加载默认 TextureCube。请在 C:/temp 放置 " // if (!LoadEnvironmentCubeDirectory(L"C:/temp")) {
if (!LoadEnvironmentCubeDirectory(cubeDir)) {
OutputDebugStringW(L"未加载默认 TextureCube。请在根目录下的assets/skybox/目录放置 "
L"posx/negx/posy/negy/posz/negz 六张同尺寸正方形图片。\n"); L"posx/negx/posy/negy/posz/negz 六张同尺寸正方形图片。\n");
} }
} }
+19 -6
View File
@@ -4,10 +4,19 @@
#include <filesystem> #include <filesystem>
namespace { namespace {
std::filesystem::path tempPath_defaultShader{L"I:/source/render/assets/shaders/_this_is_fuckin_default_shader.hlsl"}; std::filesystem::path project_src_root{PROJECT_ROOT};
std::filesystem::path tempPath_defaultPBRShader{L"I:/source/render/assets/shaders/pbr_forward.hlsl"}; std::filesystem::path tempPath_defaultShader =
std::filesystem::path tempPath_shadowDepth{L"I:/source/render/assets/shaders/shadow_depth_vs.hlsl"}; project_src_root / std::filesystem::path{L"assets/shaders/_this_is_fuckin_default_shader.hlsl"};
std::filesystem::path tempPath_PbrWithIbl{L"I:/source/render/assets/shaders/pbr_forward_ibl.hlsl"}; std::filesystem::path tempPath_defaultPBRShader =
project_src_root / std::filesystem::path{L"assets/shaders/pbr_forward.hlsl"};
std::filesystem::path tempPath_shadowDepth =
project_src_root / std::filesystem::path{L"assets/shaders/shadow_depth_vs.hlsl"};
std::filesystem::path tempPath_PbrWithIbl =
project_src_root / std::filesystem::path{L"assets/shaders/pbr_forward_ibl.hlsl"};
// std::filesystem::path tempPath_defaultShader{L"I:/source/render/assets/shaders/_this_is_fuckin_default_shader.hlsl"};
// std::filesystem::path tempPath_defaultPBRShader{L"I:/source/render/assets/shaders/pbr_forward.hlsl"};
// std::filesystem::path tempPath_shadowDepth{L"I:/source/render/assets/shaders/shadow_depth_vs.hlsl"};
// std::filesystem::path tempPath_PbrWithIbl{L"I:/source/render/assets/shaders/pbr_forward_ibl.hlsl"};
} }
@@ -45,16 +54,18 @@ const std::wstring &StatesRender::S_GetExeDir() {
const std::filesystem::path &StatesRender::S_GetDefaultShaderPath() { const std::filesystem::path &StatesRender::S_GetDefaultShaderPath() {
// DEBUG MODE // DEBUG MODE
#ifdef _DEBUG
return tempPath_PbrWithIbl; return tempPath_PbrWithIbl;
return tempPath_defaultPBRShader; return tempPath_defaultPBRShader;
return tempPath_defaultShader; return tempPath_defaultShader;
#endif
// 正确的 // 正确的
static std::filesystem::path shaderpath = []()-> std::filesystem::path { static std::filesystem::path shaderpath = []()-> std::filesystem::path {
std::filesystem::path rootdir{S_GetExeDir()}; std::filesystem::path rootdir{S_GetExeDir()};
std::filesystem::path _shaderpath = rootdir / L"assets/shaders/_this_is_fuckin_default_shader.hlsl"; std::filesystem::path _shaderpath = rootdir / L"assets/shaders/pbr_forward_ibl.hlsl";
if (!std::filesystem::exists(_shaderpath)) { if (!std::filesystem::exists(_shaderpath)) {
MessageBoxW(nullptr, L"exe目录下找不到assets/shaders/_default_shader.hlsl", L"StatesRender.cpp",MB_OK); MessageBoxW(nullptr, L"exe目录下找不到assets/shaders/pbr_forward_ibl.hlsl", L"StatesRender.cpp",MB_OK);
throw std::runtime_error{"default shader does not exist"}; throw std::runtime_error{"default shader does not exist"};
} }
return _shaderpath; return _shaderpath;
@@ -66,7 +77,9 @@ const std::filesystem::path &StatesRender::S_GetDefaultShaderPath() {
const std::filesystem::path &StatesRender::S_GetShadowDepthShaderPath() { const std::filesystem::path &StatesRender::S_GetShadowDepthShaderPath() {
// DEBUG MODE // DEBUG MODE
#ifdef _DEBUG
return tempPath_shadowDepth; return tempPath_shadowDepth;
#endif
// 正确的 // 正确的