添加命令行传入配置文件路径
parent
c02b33ecd2
commit
8ed2ff3307
|
@ -51,3 +51,5 @@ build/
|
||||||
|
|
||||||
*.mp4
|
*.mp4
|
||||||
/data/output
|
/data/output
|
||||||
|
*.glb
|
||||||
|
*.ktx
|
||||||
|
|
|
@ -27,8 +27,9 @@ const std::string getAssetPath()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
std::filesystem::path dataPath = VK_EXAMPLE_DATA_DIR;
|
||||||
return std::filesystem::path(VK_EXAMPLE_DATA_DIR);
|
std::string strDataPath = dataPath.generic_string() ;
|
||||||
|
return strDataPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -485,6 +485,7 @@ void VulkanExampleBase::initVulkan()
|
||||||
if (settings.selectedPhysicalDeviceIndex > gpuCount)
|
if (settings.selectedPhysicalDeviceIndex > gpuCount)
|
||||||
{
|
{
|
||||||
std::cerr << "wrong GPU selection,check selectedPhysicalDeviceIndex in config file,fallback to 0" << std::endl;
|
std::cerr << "wrong GPU selection,check selectedPhysicalDeviceIndex in config file,fallback to 0" << std::endl;
|
||||||
|
settings.selectedPhysicalDeviceIndex = 0;
|
||||||
selectedDevice = 0;
|
selectedDevice = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,8 +82,8 @@ public:
|
||||||
static std::vector<const char*> args;
|
static std::vector<const char*> args;
|
||||||
|
|
||||||
bool prepared = false;
|
bool prepared = false;
|
||||||
uint32_t width = 1280;
|
uint32_t width = 1920;
|
||||||
uint32_t height = 720;
|
uint32_t height = 1080;
|
||||||
float frameTimer = 1.0f;
|
float frameTimer = 1.0f;
|
||||||
Camera camera;
|
Camera camera;
|
||||||
glm::vec2 mousePos;
|
glm::vec2 mousePos;
|
||||||
|
@ -103,7 +103,7 @@ public:
|
||||||
|
|
||||||
struct Settings {
|
struct Settings {
|
||||||
uint32_t selectedPhysicalDeviceIndex = 7;
|
uint32_t selectedPhysicalDeviceIndex = 7;
|
||||||
bool validation = true; // 校验层开关
|
bool validation = false; // 校验层开关
|
||||||
bool fullscreen = false; // 全屏开关
|
bool fullscreen = false; // 全屏开关
|
||||||
bool vsync = false; // 垂直同步开关
|
bool vsync = false; // 垂直同步开关
|
||||||
bool multiSampling = false; // 多重采样
|
bool multiSampling = false; // 多重采样
|
||||||
|
@ -111,7 +111,7 @@ public:
|
||||||
bool headless = false; // 无头开关
|
bool headless = false; // 无头开关
|
||||||
bool outputPNGimage = false;
|
bool outputPNGimage = false;
|
||||||
bool enableSaveToImageSequeue = true; // 图片序列开关(暂时弃用)
|
bool enableSaveToImageSequeue = true; // 图片序列开关(暂时弃用)
|
||||||
uint32_t outputFrameCount = 50; // 图片序列结束帧
|
uint32_t outputFrameCount = 480; // 图片序列结束帧
|
||||||
bool takeScreenShot = false; // 截屏(暂时弃用)
|
bool takeScreenShot = false; // 截屏(暂时弃用)
|
||||||
uint32_t startFrameCount = 1; // 图片序列开始帧
|
uint32_t startFrameCount = 1; // 图片序列开始帧
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ PlumageRender::PlumageRender()
|
||||||
models.scene.loadFromFile(filename, vulkanDevice, queue);
|
models.scene.loadFromFile(filename, vulkanDevice, queue);
|
||||||
auto tFileLoad = std::chrono::duration<double, std::milli>(std::chrono::high_resolution_clock::now() - tStart).count();
|
auto tFileLoad = std::chrono::duration<double, std::milli>(std::chrono::high_resolution_clock::now() - tStart).count();
|
||||||
std::cout << "Loading took " << tFileLoad << " ms" << std::endl;
|
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 });
|
camera.setRotation({ 0.0f, 0.0f, 0.0f });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ public:
|
||||||
|
|
||||||
struct FilePath
|
struct FilePath
|
||||||
{ //model path
|
{ //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 modelVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.vert.spv";
|
||||||
std::string modelFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.frag.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 brdfVertShaderPath = getAssetPath() + "shaders/genbrdflut.vert.spv";
|
||||||
std::string brdfFragShaderPath = getAssetPath() + "shaders/genbrdflut.frag.spv";
|
std::string brdfFragShaderPath = getAssetPath() + "shaders/genbrdflut.frag.spv";
|
||||||
// environment map texture
|
// 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";
|
std::string emptyEnvmapFilePath = getAssetPath() + "textures/empty.ktx";
|
||||||
// pbr shader
|
// pbr shader
|
||||||
std::string pbrVertShaderPath = getAssetPath() + "shaders/pbr.vert.spv";
|
std::string pbrVertShaderPath = getAssetPath() + "shaders/pbr.vert.spv";
|
||||||
|
|
Loading…
Reference in New Issue