添加命令行传入配置文件路径

main-headless
ink-soul 2024-04-17 18:34:48 +08:00
parent c02b33ecd2
commit 8ed2ff3307
6 changed files with 13 additions and 9 deletions

2
.gitignore vendored
View File

@ -51,3 +51,5 @@ build/
*.mp4
/data/output
*.glb
*.ktx

View File

@ -27,8 +27,9 @@ const std::string getAssetPath()
}
else
{
return std::filesystem::path(VK_EXAMPLE_DATA_DIR);
std::filesystem::path dataPath = VK_EXAMPLE_DATA_DIR;
std::string strDataPath = dataPath.generic_string() ;
return strDataPath;
}
#endif

View File

@ -485,6 +485,7 @@ void VulkanExampleBase::initVulkan()
if (settings.selectedPhysicalDeviceIndex > gpuCount)
{
std::cerr << "wrong GPU selection,check selectedPhysicalDeviceIndex in config file,fallback to 0" << std::endl;
settings.selectedPhysicalDeviceIndex = 0;
selectedDevice = 0;
}

View File

@ -82,8 +82,8 @@ public:
static std::vector<const char*> args;
bool prepared = false;
uint32_t width = 1280;
uint32_t height = 720;
uint32_t width = 1920;
uint32_t height = 1080;
float frameTimer = 1.0f;
Camera camera;
glm::vec2 mousePos;
@ -103,7 +103,7 @@ public:
struct Settings {
uint32_t selectedPhysicalDeviceIndex = 7;
bool validation = true; // 校验层开关
bool validation = false; // 校验层开关
bool fullscreen = false; // 全屏开关
bool vsync = false; // 垂直同步开关
bool multiSampling = false; // 多重采样
@ -111,7 +111,7 @@ public:
bool headless = false; // 无头开关
bool outputPNGimage = false;
bool enableSaveToImageSequeue = true; // 图片序列开关(暂时弃用)
uint32_t outputFrameCount = 50; // 图片序列结束帧
uint32_t outputFrameCount = 480; // 图片序列结束帧
bool takeScreenShot = false; // 截屏(暂时弃用)
uint32_t startFrameCount = 1; // 图片序列开始帧

View File

@ -203,7 +203,7 @@ PlumageRender::PlumageRender()
models.scene.loadFromFile(filename, vulkanDevice, queue);
auto tFileLoad = std::chrono::duration<double, std::milli>(std::chrono::high_resolution_clock::now() - tStart).count();
std::cout << "Loading took " << tFileLoad << " ms" << std::endl;
camera.setPosition({ 0.0f, 0.0f, -6.0f });
camera.setPosition({ 0.0f, 0.5f, -6.0f });
camera.setRotation({ 0.0f, 0.0f, 0.0f });
}

View File

@ -129,7 +129,7 @@ public:
struct FilePath
{ //model path
std::string glTFModelFilePath = getAssetPath() + "models/DamagedHelmet/DamagedHelmet.gltf";
std::string glTFModelFilePath = getAssetPath() + "models/free_porsche_911_carrera_4s.glb";
std::string modelVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.vert.spv";
std::string modelFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.frag.spv";
@ -159,7 +159,7 @@ public:
std::string brdfVertShaderPath = getAssetPath() + "shaders/genbrdflut.vert.spv";
std::string brdfFragShaderPath = getAssetPath() + "shaders/genbrdflut.frag.spv";
// environment map texture
std::string envMapFilePath = getAssetPath() + "environments/metro_noord_4k_hdr16f_cube.ktx";
std::string envMapFilePath = getAssetPath() + "environments/7_4k_hdr16f_cube.ktx";
std::string emptyEnvmapFilePath = getAssetPath() + "textures/empty.ktx";
// pbr shader
std::string pbrVertShaderPath = getAssetPath() + "shaders/pbr.vert.spv";