plumageRender/base/renderConfig.h

156 lines
5.1 KiB
C
Raw Normal View History

2024-04-16 18:04:26 +08:00
#pragma once
#include <filesystem>
#include <fstream>
#include <iostream>
2024-04-17 11:26:38 +08:00
#include <glm/glm.hpp>
2024-04-16 18:04:26 +08:00
2024-04-18 18:26:07 +08:00
#include <toml/toml.hpp>
2024-04-16 18:04:26 +08:00
#include <vulkan/vulkan.h>
#include <VulkanTools.h>
namespace PlumageConfig
{
2024-04-19 18:08:16 +08:00
2024-04-16 18:04:26 +08:00
class PlumageConfiguration
{
public:
2024-04-17 11:26:38 +08:00
2024-04-16 18:04:26 +08:00
struct Settings {
2024-04-18 18:26:07 +08:00
2024-04-16 18:04:26 +08:00
bool validation = true; // У<><D0A3><EFBFBD><EFBFBD><E3BFAA>
2024-04-18 18:26:07 +08:00
//bool fullscreen = false; // ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-04-16 18:04:26 +08:00
bool vsync = false; // <20><>ֱͬ<D6B1><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-04-17 12:03:02 +08:00
bool headless = false; // <20><>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
bool outputPNGimage = false;
2024-04-18 18:26:07 +08:00
bool debugMode = true;
bool cleanUpImageSequece = true; // ͼƬ<CDBC><C6AC><EFBFBD>п<EFBFBD><D0BF>أ<EFBFBD><D8A3><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ã<EFBFBD>
2024-04-17 12:03:02 +08:00
2024-04-18 18:26:07 +08:00
uint32_t width = 1280;
uint32_t height = 720;
2024-04-16 18:04:26 +08:00
bool multiSampling = false; // <20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>
2024-04-17 11:26:38 +08:00
VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_4_BIT; // <20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool rotateModel = true; // ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת
2024-04-18 18:26:07 +08:00
float modelRotateSpeed = 2.0f; // <20><><EFBFBD><EFBFBD>ת<EFBFBD>ٶ<EFBFBD>
2024-04-17 11:26:38 +08:00
uint32_t startFrameIndex = 1; // ͼƬ<CDBC><C6AC><EFBFBD>п<EFBFBD>ʼ֡
uint32_t endFrameIndex = 50; // ͼƬ<CDBC><C6AC><EFBFBD>н<EFBFBD><D0BD><EFBFBD>֡
uint32_t videoFrameRate = 25; // <20><>Ƶ֡<C6B5><D6A1>
2024-04-18 18:26:07 +08:00
uint32_t selectedPhysicalDeviceIndex = 7;
2024-04-22 18:19:55 +08:00
float fX = 565.5f;
float fY = 516.3f;
2024-04-17 12:03:02 +08:00
float fovX = 1.f;
float fovY = 1.f;
2024-04-22 18:19:55 +08:00
float cX = 328.2f;
float cY = 238.8f;
int calibrationWidth = 640.0f;
int calibrationHeight = 480.0f;
2024-04-19 18:08:16 +08:00
glm::vec3 bottomCenter = { 0.f,0.f,-6.f };
//std::vector<float> bottomCenter = { 0.f,0.f,-6.f };
glm::vec3 bottomNormal = { 0.f,1.0f,0.f };
std::vector<glm::vec3> cameraTracks = { {0.f,0.f,-6.f},{1.f,0.f,-3.f} };
std::vector<glm::mat3> cameraAngle = { {{0.f,0.f,0.f},{45.f,0.f,0.f},{0.f,0.f,0.f}},{{0.f,0.f,0.f},{45.f,0.f,0.f},{0.f,0.f,0.f}} };
2024-04-17 11:26:38 +08:00
}settings;
2024-04-19 18:08:16 +08:00
2024-04-18 18:26:07 +08:00
struct RenderSettings
{
uint32_t width = 1280;
uint32_t height = 720;
bool multiSampling = false; // <20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>
uint32_t sampleCount = VK_SAMPLE_COUNT_4_BIT; // <20><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
bool rotateModel = true; // ģ<><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת
float modelRotateSpeed = 2.0f; // <20><><EFBFBD><EFBFBD>ת<EFBFBD>ٶ<EFBFBD>
uint32_t startFrameIndex = 1; // ͼƬ<CDBC><C6AC><EFBFBD>п<EFBFBD>ʼ֡
uint32_t endFrameIndex = 50; // ͼƬ<CDBC><C6AC><EFBFBD>н<EFBFBD><D0BD><EFBFBD>֡
uint32_t videoFrameRate = 25; // <20><>Ƶ֡<C6B5><D6A1>
uint32_t selectedPhysicalDeviceIndex = 7;
};
2024-04-16 18:04:26 +08:00
struct FilePath
{ //model path
2024-04-18 18:26:07 +08:00
std::string glTFModelFilePath = getAssetPath() + "models/DamagedHelmet/DamagedHelmet.gltf";
2024-04-16 18:04:26 +08:00
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
2024-04-18 18:26:07 +08:00
std::string skyboxModelFilePath = getAssetPath() + "models/cube.gltf";
2024-04-16 18:04:26 +08:00
std::string skyboxVertShaderPath = getAssetPath() + "shaders/skybox.vert.spv";
std::string skyboxFragShaderPath = getAssetPath() + "shaders/skybox.frag.spv";
2024-04-18 18:26:07 +08:00
//std::string iblTexturesFilePath = getAssetPath() + "textures/hdr/gcanyon_cube.ktx";
2024-04-16 18:04:26 +08:00
//tonemapping
2024-04-17 12:03:02 +08:00
std::string tonemappingVertShaderPath = getAssetPath() + "shaders/genbrdflut.vert.spv";
std::string tonemappingEnableFragShaderPath = getAssetPath() + "shaders/tonemapping_enable.frag.spv";
std::string tonemappingDisableFragShaderPath = getAssetPath() + "shaders/tonemapping_disable.frag.spv";
2024-04-16 18:04:26 +08:00
// 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
2024-04-18 18:26:07 +08:00
std::string envMapFilePath = getAssetPath() + "environments/brown_photostudio_02_4k_hdr16f_cube.ktx";
2024-04-16 18:04:26 +08:00
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";
2024-04-18 18:26:07 +08:00
std::string hdr2ktxBatFilePath = getAssetPath() + "script/hdr2ktxBatFilePath.bat";
std::string hdr2ktxShFilePath = getAssetPath() + "script/hdr2ktxShFilePath.sh";
2024-04-17 11:26:38 +08:00
// <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD>󱣴<EFBFBD><F3B1A3B4><EFBFBD><EFBFBD><EFBFBD>
2024-04-19 18:08:16 +08:00
//std::string configFilePath = getAssetPath() + "config/guanzi.toml";
2024-04-22 18:19:55 +08:00
std::string configFilePath = getAssetPath() + "config/yukino_traj1_matrix.toml";
2024-04-16 18:04:26 +08:00
} filePath;
2024-04-17 11:26:38 +08:00
2024-04-16 18:04:26 +08:00
void writrConfigurationToJson();
2024-04-19 18:08:16 +08:00
void readConfigurationFromToml(std::string configFilePath,Settings& settings);
2024-04-18 18:26:07 +08:00
void convertIntToVkSampleCount(uint32_t sampleCount);
2024-04-16 18:04:26 +08:00
2024-04-17 11:26:38 +08:00
PlumageConfiguration();
~PlumageConfiguration();
2024-04-16 18:04:26 +08:00
private:
};
2024-04-17 11:26:38 +08:00
2024-04-16 18:04:26 +08:00
}