plumageRender/base/renderConfig.h

120 lines
3.9 KiB
C++

#pragma once
#include <filesystem>
#include <fstream>
#include <iostream>
#include <glm/glm.hpp>
#include <json.hpp>
#include <vulkan/vulkan.h>
#include <VulkanTools.h>
namespace PlumageConfig
{
class PlumageConfiguration
{
public:
struct Settings {
uint32_t width = 1280;
uint32_t height = 720;
bool validation = true; // 校验层开关
bool fullscreen = false; // 全屏开关
bool vsync = false; // 垂直同步开关
bool multiSampling = false; // 多重采样
VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_4_BIT; // 多重采样倍率
bool rotateModel = true; // 模型自旋转
uint32_t modelRotateSpeed = 2;
bool headless = false; // 无头开关
bool outputPNGimage = false;
//bool enableSaveToImageSequeue = true; // 图片序列开关(暂时弃用)
uint32_t startFrameIndex = 1; // 图片序列开始帧
uint32_t endFrameIndex = 50; // 图片序列结束帧
uint32_t videoFrameRate = 25; // 视频帧率
uint32_t selectedPhysicalDeviceIndex = 0;
float fovX;
float fovY;
float cX;
float cY;
glm::vec3 bottomCenter;
glm::vec3 bottomNormal;
}settings;
struct FilePath
{ //model path
std::string glTFModelFilePath = getAssetPath() + "models/DamagedHelmet/DamagedHelmet.gltf";
std::string modelVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.vert.spv";
std::string modelFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.frag.spv";
//ui
std::string uiVertShaderPath = getAssetPath() + "shaders/ui.vert.spv";
std::string uiFragShaderPath = getAssetPath() + "shaders/ui.frag.spv";
// skybox path
std::string skyboxModleFilePath = getAssetPath() + "models/cube.gltf";
std::string skyboxVertShaderPath = getAssetPath() + "shaders/skybox.vert.spv";
std::string skyboxFragShaderPath = getAssetPath() + "shaders/skybox.frag.spv";
std::string iblTexturesFilePath = getAssetPath() + "textures/hdr/gcanyon_cube.ktx";
//tonemapping
std::string tonemappingVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/genbrdflut.vert.spv";
std::string tonemappingEnableFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/tonemapping_enable.frag.spv";
std::string tonemappingDisableFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/tonemapping_disable.frag.spv";
// cube map
std::string irradianceFragShaderPath = getAssetPath() + "shaders/irradiancecube.frag.spv";
std::string filterVertShaderPath = getAssetPath() + "shaders/filtercube.vert.spv";
std::string prefilterEnvmapFragShaderPath = getAssetPath() + "shaders/prefilterenvmap.frag.spv";
//brdf cube map
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 emptyEnvmapFilePath = getAssetPath() + "textures/empty.ktx";
// pbr shader
std::string pbrVertShaderPath = getAssetPath() + "shaders/pbr.vert.spv";
std::string pbrFragShaderPath = getAssetPath() + "shaders/pbr_khr.frag.spv";
//ttf file path
std::string ttfFilePath = getAssetPath() + "/data/Roboto-Medium.ttf";
// output file path
std::string imageOutputPath = getAssetPath() + "output/imageSequence";
std::string videoOutputPath = getAssetPath() + "output/video";
std::string totalImageOutputPath;
std::string deviceSpecFilePath;
// script file path
std::string image2videoBatFilePath = getAssetPath() + "script/image2video.bat";
std::string image2videoShFilePath = getAssetPath() + "script/image2video.sh";
// 配置文件路径,命令行传入后保存在这
std::string configFilePath = getAssetPath() + "config/config.json";
} filePath;
void writrConfigurationToJson();
void readConfigurationToJson(std::string configFilePath);
PlumageConfiguration();
~PlumageConfiguration();
private:
};
}