Skip to content

Commit e6ec1e8

Browse files
committed
v1.3.9
1 parent 5000986 commit e6ec1e8

File tree

9 files changed

+190
-10
lines changed

9 files changed

+190
-10
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
*.app
3333

3434
/\.vs/
35-
/out/
35+
*out/
3636
*_data/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div id="toc">
55
<ul style="list-style: none;">
66
<summary>
7-
<h1>PBR Visualiser 1.3.8</h1>
7+
<h1>PBR Visualiser 1.3.9</h1>
88
</summary>
99
</ul>
1010
</div>

cmake/CPM.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
set(CPM_DOWNLOAD_VERSION 0.40.5)
1+
set(CPM_DOWNLOAD_VERSION 0.40.8)
22

33
set(CPM_SOURCE_CACHE "${CMAKE_SOURCE_DIR}/out/thirdparty")
44
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")

res/build_resources/imgui.ini

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
[Window][Debug##Default]
2+
Pos=60,60
3+
Size=400,400
4+
Collapsed=0
5+
6+
[Window][PBR VISUALISER]
7+
Pos=18,8
8+
Size=402,1000
9+
Collapsed=0
10+
11+
[Window][Camera]
12+
Pos=1500,44
13+
Size=368,137
14+
Collapsed=0
15+
DockId=0x00000002,0
16+
17+
[Window][Skybox]
18+
Pos=1500,183
19+
Size=368,564
20+
Collapsed=0
21+
DockId=0x00000003,0
22+
23+
[Window][Choose HDR image]
24+
Pos=60,60
25+
Size=740,410
26+
Collapsed=0
27+
28+
[Window][Choose Albedo image]
29+
Pos=616,174
30+
Size=740,410
31+
Collapsed=0
32+
33+
[Window][Choose Normal image]
34+
Pos=517,132
35+
Size=740,410
36+
Collapsed=0
37+
38+
[Window][Choose Metallic image]
39+
Pos=514,171
40+
Size=740,410
41+
Collapsed=0
42+
43+
[Window][Choose Displacement image]
44+
Pos=547,131
45+
Size=740,410
46+
Collapsed=0
47+
48+
[Window][Choose Roughness image]
49+
Pos=477,200
50+
Size=740,410
51+
Collapsed=0
52+
53+
[Window][Choose AO image]
54+
Pos=471,211
55+
Size=740,410
56+
Collapsed=0
57+
58+
[Window][Screenshot Saved]
59+
Pos=851,396
60+
Size=300,88
61+
Collapsed=0
62+
63+
[Window][Choose 3D Object File]
64+
Pos=60,60
65+
Size=740,410
66+
Collapsed=0
67+
68+
[Window][Help Window]
69+
Pos=718,351
70+
Size=542,290
71+
Collapsed=0
72+
73+
[Window][Skybox Faces Loader Window]
74+
Pos=727,210
75+
Size=521,488
76+
Collapsed=0
77+
78+
[Window][Error Loading Image Right]
79+
Pos=759,446
80+
Size=500,88
81+
Collapsed=0
82+
83+
[Window][Error Loading Image Bottom]
84+
Pos=726,394
85+
Size=500,88
86+
Collapsed=0
87+
88+
[Window][Error Loading Image Left]
89+
Pos=731,449
90+
Size=441,88
91+
Collapsed=0
92+
93+
[Window][Error Loading Image Top]
94+
Pos=710,464
95+
Size=500,88
96+
Collapsed=0
97+
98+
[Window][Error Loading Image Albedo]
99+
Pos=710,496
100+
Size=500,88
101+
Collapsed=0
102+
103+
[Window][Model Loaded]
104+
Pos=847,502
105+
Size=300,71
106+
Collapsed=0
107+
108+
[Docking][Data]
109+
DockNode ID=0x00000001 Pos=1500,44 Size=368,703 Split=Y
110+
DockNode ID=0x00000002 Parent=0x00000001 SizeRef=304,114 Selected=0xAA49D574
111+
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=304,470 Selected=0x450B616F
112+

src/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ include(${CMAKE_SOURCE_DIR}/cmake/pack_shaders.cmake)
66
generate_key(6 SHADERS_KEY)
77

88
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/icon.png ${CMAKE_CURRENT_BINARY_DIR}/icon.png COPYONLY)
9+
if (WINDOW_APP)
10+
configure_file(${CMAKE_SOURCE_DIR}/res/build_resources/imgui.ini ${CMAKE_CURRENT_BINARY_DIR}/imgui.ini COPYONLY)
11+
endif()
912

1013
# Add source files
1114
file(GLOB_RECURSE SOURCE_FILES
@@ -56,6 +59,14 @@ if(WINDOW_APP)
5659
target_compile_definitions(${PROJECT_NAME} PRIVATE WINDOW_APP)
5760
endif()
5861

62+
if(WIN32)
63+
target_compile_definitions(${PROJECT_NAME} PRIVATE _WIN32)
64+
elseif(APPLE)
65+
target_compile_definitions(${PROJECT_NAME} PRIVATE __APPLE__)
66+
elseif(UNIX)
67+
target_compile_definitions(${PROJECT_NAME} PRIVATE __linux__)
68+
endif()
69+
5970
target_precompile_headers(${PROJECT_NAME} PUBLIC ${PRECOMPILE_HEADERS_FILE})
6071

6172
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
@@ -90,6 +101,10 @@ if(WINDOW_APP)
90101
tiny_file_dialogs)
91102
endif()
92103

104+
if(APPLE)
105+
target_link_libraries(${PROJECT_NAME} PUBLIC "-framework CoreFoundation")
106+
endif()
107+
93108
# Shader Packing
94109
file(GLOB SHADER_FILES ${CMAKE_SOURCE_DIR}/res/shader/*)
95110

src/main.cpp

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// / ___/ _ / , _/ | |/ / (_-</ // / _ `/ / (_-</ -_) __/
55
// /_/ /____/_/|_| |___/_/___/\_,_/\_,_/_/_/___/\__/_/
66
//
7-
// Version: 1.3.8
7+
// Version: 1.3.9
88
// Author: Marceli Antosik (Muppetsg2)
9-
// Last Update: 29.03.2025
9+
// Last Update: 22.04.2025
1010

1111
extern "C" {
1212
_declspec(dllexport) unsigned long NvOptimusEnablement = 1;
@@ -115,6 +115,7 @@ static void FramebufferSizeCallback(GLFWwindow* window, int width, int height)
115115
}
116116

117117
bool init();
118+
std::string get_executable_path();
118119
void drawBanner();
119120
void render();
120121
GLuint LoadDefaultWhiteTexture();
@@ -243,7 +244,7 @@ static const std::vector<std::string> skyboxPaths =
243244

244245
int main(int argc, char** argv)
245246
{
246-
exeDirPath = std::filesystem::absolute(argv[0]).parent_path().string();
247+
exeDirPath = get_executable_path();
247248

248249
ShadersExtractor::Init(exeDirPath + "\\shaders.dat");
249250

@@ -498,6 +499,39 @@ bool init()
498499
return true;
499500
}
500501

502+
std::string get_executable_path() {
503+
#if defined(_WIN32)
504+
char buffer[MAX_PATH];
505+
GetModuleFileNameA(NULL, buffer, MAX_PATH);
506+
return std::filesystem::path(buffer).parent_path().string();
507+
508+
#elif defined(__APPLE__)
509+
char buffer[4096];
510+
uint32_t size = sizeof(buffer);
511+
if (_NSGetExecutablePath(buffer, &size) == 0) {
512+
return std::filesystem::weakly_canonical(buffer).parent_path().string();
513+
}
514+
else {
515+
printf("Error: _NSGetExecutablePath(): Buffer too small for executable path");
516+
exit(EXIT_FAILURE);
517+
}
518+
519+
#elif defined(__linux__)
520+
char buffer[4096];
521+
ssize_t count = readlink("/proc/self/exe", buffer, sizeof(buffer));
522+
if (count != -1) {
523+
return std::filesystem::weakly_canonical(std::string(buffer, count)).parent_path().string();
524+
}
525+
else {
526+
printf("Error: readlink(): Cannot read /proc/self/exe");
527+
exit(EXIT_FAILURE);
528+
}
529+
530+
#else
531+
#error "Unsupported platform"
532+
#endif
533+
}
534+
501535
void drawBanner()
502536
{
503537
spdlog::set_pattern("%v");

src/pch.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@
6464
#include <iostream>
6565
#endif
6666

67+
// PLATFORM DEPENDANT
68+
#if defined(_WIN32)
69+
#include <windows.h>
70+
#elif defined(__APPLE__)
71+
#include <mach-o/dyld.h>
72+
#elif defined(__linux__)
73+
#include <unistd.h>
74+
#endif
75+
6776
// PROGRAM INFO
6877
#include <Config.h>
6978
#include <version.h>

src/version.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
#define PBR_VISUALISER_VER_MAJOR 1
44
#define PBR_VISUALISER_VER_MINOR 3
5-
#define PBR_VISUALISER_VER_PATCH 8
5+
#define PBR_VISUALISER_VER_PATCH 9
66

7-
#define PBR_VISUALISER_LAST_UPDATE "29.03.2025"
7+
#define PBR_VISUALISER_LAST_UPDATE "22.04.2025"
88

99
#define PBR_VISUALISER_TO_STRING_VERSION(major, minor, patch) std::format("{}.{}.{}", major, minor, patch)
1010
#define PBR_VISUALISER_TO_INT_VERSION(major, minor, patch) (major * 10000 + minor * 100 + patch)
@@ -17,6 +17,16 @@
1717
// \___/_//_/\_,_/_//_/\_, /\__/_/\___/\_, /
1818
// /___/ /___/
1919
//
20+
// --- 1.3.9 ---
21+
// - added better support for finding the path of a program's executable file
22+
// - updated CMake project global settings and c++ version settings
23+
// - repaired ignoring out folder in gitignore
24+
// - improved caching of libraries downloaded using CPM
25+
// - added file with default PBR_Visualiser ImGui windows setup to res folder
26+
// - updated imgui version in window build
27+
// - updated spdlog version
28+
// - updated CPM version
29+
//
2030
// --- 1.3.8 ---
2131
// - added fbx 3d model loading using OpenFBX library in window build
2232
// - fixed behaviour when loading 3d model is canceled in window build

thirdparty/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ CPMAddPackage(
3030
GIT_REPOSITORY https://github.com/g-truc/gli.git
3131
GIT_TAG master
3232
)
33-
CPMAddPackage("gh:gabime/spdlog@1.15.1")
33+
CPMAddPackage("gh:gabime/spdlog@1.15.2")
3434

3535
if(WINDOW_APP)
3636
# cgltf https://github.com/jkuhlmann/cgltf
@@ -62,7 +62,7 @@ if(WINDOW_APP)
6262
add_library(tiny_file_dialogs STATIC ${tiny_file_dialogs_SOURCE_DIR}/tinyfiledialogs.c)
6363

6464
CPMAddPackage("gh:freetype/freetype#VER-2-13-3")
65-
CPMAddPackage("gh:ocornut/imgui@1.91.8-docking")
65+
CPMAddPackage("gh:ocornut/imgui@1.91.9b-docking")
6666

6767
set(imgui_SOURCE_DIR ${imgui_SOURCE_DIR} CACHE INTERNAL "")
6868
add_library(imgui STATIC ${imgui_SOURCE_DIR}/imgui.cpp

0 commit comments

Comments
 (0)