完成部分结构体向类的重构
parent
d915ac5dd2
commit
d2d9db4aff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -39,8 +39,8 @@ out/
|
||||||
.vs/
|
.vs/
|
||||||
vulkan_asset_pack_gltf.zip
|
vulkan_asset_pack_gltf.zip
|
||||||
*.zip
|
*.zip
|
||||||
.cache/
|
.cache
|
||||||
/.cache
|
|
||||||
# vscode build file
|
# vscode build file
|
||||||
build/
|
build/
|
||||||
|
|
||||||
|
|
@ -58,3 +58,5 @@ build/
|
||||||
data/output/video/device0/result.mp4
|
data/output/video/device0/result.mp4
|
||||||
|
|
||||||
*.idx
|
*.idx
|
||||||
|
|
||||||
|
/.cache
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include "configFilePath.h"
|
#include "configFilePath.h"
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
|
||||||
std::string getAssetPath()
|
std::string ConfigFilePath::getAssetPath() const
|
||||||
{
|
{
|
||||||
if (_access("./../data/", 0) != -1)
|
if (_access("./../data/", 0) != -1)
|
||||||
{
|
{
|
||||||
|
|
@ -25,283 +25,283 @@ std::string getAssetPath()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Getter method definitions
|
// Getter method definitions
|
||||||
const std::string &ConfigFilePath::getGlTFModelFilePath() const
|
const std::string ConfigFilePath::getGlTFModelFilePath() const
|
||||||
{
|
{
|
||||||
return glTFModelFilePath;
|
return getAssetPath() + glTFModelFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getModelVertShaderPath() const
|
const std::string ConfigFilePath::getModelVertShaderPath() const
|
||||||
{
|
{
|
||||||
return modelVertShaderPath;
|
return getAssetPath() + modelVertShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getModelFragShaderPath() const
|
const std::string ConfigFilePath::getModelFragShaderPath() const
|
||||||
{
|
{
|
||||||
return modelFragShaderPath;
|
return getAssetPath() + modelFragShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getUiVertShaderPath() const
|
const std::string ConfigFilePath::getUiVertShaderPath() const
|
||||||
{
|
{
|
||||||
return uiVertShaderPath;
|
return getAssetPath() + uiVertShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getUiFragShaderPath() const
|
const std::string ConfigFilePath::getUiFragShaderPath() const
|
||||||
{
|
{
|
||||||
return uiFragShaderPath;
|
return getAssetPath() + uiFragShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getSkyboxModleFilePath() const
|
const std::string ConfigFilePath::getSkyboxModleFilePath() const
|
||||||
{
|
{
|
||||||
return skyboxModleFilePath;
|
return getAssetPath() + skyboxModleFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getSkyboxVertShaderPath() const
|
const std::string ConfigFilePath::getSkyboxVertShaderPath() const
|
||||||
{
|
{
|
||||||
return skyboxVertShaderPath;
|
return getAssetPath() + skyboxVertShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getSkyboxFragShaderPath() const
|
const std::string ConfigFilePath::getSkyboxFragShaderPath() const
|
||||||
{
|
{
|
||||||
return skyboxFragShaderPath;
|
return getAssetPath() + skyboxFragShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getIblTexturesFilePath() const
|
const std::string ConfigFilePath::getIblTexturesFilePath() const
|
||||||
{
|
{
|
||||||
return iblTexturesFilePath;
|
return getAssetPath() + iblTexturesFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getTonemappingVertShaderPath() const
|
const std::string ConfigFilePath::getTonemappingVertShaderPath() const
|
||||||
{
|
{
|
||||||
return tonemappingVertShaderPath;
|
return getAssetPath() + tonemappingVertShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getTonemappingEnableFragShaderPath() const
|
const std::string ConfigFilePath::getTonemappingEnableFragShaderPath() const
|
||||||
{
|
{
|
||||||
return tonemappingEnableFragShaderPath;
|
return getAssetPath() + tonemappingEnableFragShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getTonemappingDisableFragShaderPath() const
|
const std::string ConfigFilePath::getTonemappingDisableFragShaderPath() const
|
||||||
{
|
{
|
||||||
return tonemappingDisableFragShaderPath;
|
return getAssetPath() + tonemappingDisableFragShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getIrradianceFragShaderPath() const
|
const std::string ConfigFilePath::getIrradianceFragShaderPath() const
|
||||||
{
|
{
|
||||||
return irradianceFragShaderPath;
|
return getAssetPath() + irradianceFragShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getFilterVertShaderPath() const
|
const std::string ConfigFilePath::getFilterVertShaderPath() const
|
||||||
{
|
{
|
||||||
return filterVertShaderPath;
|
return getAssetPath() + filterVertShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getPrefilterEnvmapFragShaderPath() const
|
const std::string ConfigFilePath::getPrefilterEnvmapFragShaderPath() const
|
||||||
{
|
{
|
||||||
return prefilterEnvmapFragShaderPath;
|
return getAssetPath() + prefilterEnvmapFragShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getBrdfVertShaderPath() const
|
const std::string ConfigFilePath::getBrdfVertShaderPath() const
|
||||||
{
|
{
|
||||||
return brdfVertShaderPath;
|
return getAssetPath() + brdfVertShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getBrdfFragShaderPath() const
|
const std::string ConfigFilePath::getBrdfFragShaderPath() const
|
||||||
{
|
{
|
||||||
return brdfFragShaderPath;
|
return getAssetPath() + brdfFragShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getEnvMapFilePath() const
|
const std::string ConfigFilePath::getEnvMapFilePath() const
|
||||||
{
|
{
|
||||||
return envMapFilePath;
|
return getAssetPath() + envMapFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getEmptyEnvmapFilePath() const
|
const std::string ConfigFilePath::getEmptyEnvmapFilePath() const
|
||||||
{
|
{
|
||||||
return emptyEnvmapFilePath;
|
return getAssetPath() + emptyEnvmapFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getPbrVertShaderPath() const
|
const std::string ConfigFilePath::getPbrVertShaderPath() const
|
||||||
{
|
{
|
||||||
return pbrVertShaderPath;
|
return getAssetPath() + pbrVertShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getPbrFragShaderPath() const
|
const std::string ConfigFilePath::getPbrFragShaderPath() const
|
||||||
{
|
{
|
||||||
return pbrFragShaderPath;
|
return getAssetPath() + pbrFragShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getTtfFilePath() const
|
const std::string ConfigFilePath::getTtfFilePath() const
|
||||||
{
|
{
|
||||||
return ttfFilePath;
|
return getAssetPath() + ttfFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getImageOutputPath() const
|
const std::string ConfigFilePath::getImageOutputPath() const
|
||||||
{
|
{
|
||||||
return imageOutputPath;
|
return getAssetPath() + imageOutputPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getVideoOutputPath() const
|
const std::string ConfigFilePath::getVideoOutputPath() const
|
||||||
{
|
{
|
||||||
return videoOutputPath;
|
return getAssetPath() + videoOutputPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getTotalImageOutputPath() const
|
const std::string ConfigFilePath::getTotalImageOutputPath() const
|
||||||
{
|
{
|
||||||
return totalImageOutputPath;
|
return getAssetPath() + totalImageOutputPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getDeviceSpecFilePath() const
|
const std::string ConfigFilePath::getDeviceSpecFilePath() const
|
||||||
{
|
{
|
||||||
return deviceSpecFilePath;
|
return getAssetPath() + deviceSpecFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getImage2videoBatFilePath() const
|
const std::string ConfigFilePath::getImage2videoBatFilePath() const
|
||||||
{
|
{
|
||||||
return image2videoBatFilePath;
|
return getAssetPath() + image2videoBatFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string &ConfigFilePath::getImage2videoShFilePath() const
|
const std::string ConfigFilePath::getImage2videoShFilePath() const
|
||||||
{
|
{
|
||||||
return image2videoShFilePath;
|
return getAssetPath() + image2videoShFilePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setter method definitions
|
// Setter method definitions
|
||||||
void ConfigFilePath::setGlTFModelFilePath(const std::string &path)
|
void ConfigFilePath::setGlTFModelFilePath(const std::string path)
|
||||||
{
|
{
|
||||||
glTFModelFilePath = path;
|
glTFModelFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setModelVertShaderPath(const std::string &path)
|
void ConfigFilePath::setModelVertShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
modelVertShaderPath = path;
|
modelVertShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setModelFragShaderPath(const std::string &path)
|
void ConfigFilePath::setModelFragShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
modelFragShaderPath = path;
|
modelFragShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setUiVertShaderPath(const std::string &path)
|
void ConfigFilePath::setUiVertShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
uiVertShaderPath = path;
|
uiVertShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setUiFragShaderPath(const std::string &path)
|
void ConfigFilePath::setUiFragShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
uiFragShaderPath = path;
|
uiFragShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setSkyboxModleFilePath(const std::string &path)
|
void ConfigFilePath::setSkyboxModleFilePath(const std::string path)
|
||||||
{
|
{
|
||||||
skyboxModleFilePath = path;
|
skyboxModleFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setSkyboxVertShaderPath(const std::string &path)
|
void ConfigFilePath::setSkyboxVertShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
skyboxVertShaderPath = path;
|
skyboxVertShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setSkyboxFragShaderPath(const std::string &path)
|
void ConfigFilePath::setSkyboxFragShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
skyboxFragShaderPath = path;
|
skyboxFragShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setIblTexturesFilePath(const std::string &path)
|
void ConfigFilePath::setIblTexturesFilePath(const std::string path)
|
||||||
{
|
{
|
||||||
iblTexturesFilePath = path;
|
iblTexturesFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setTonemappingVertShaderPath(const std::string &path)
|
void ConfigFilePath::setTonemappingVertShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
tonemappingVertShaderPath = path;
|
tonemappingVertShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setTonemappingEnableFragShaderPath(const std::string &path)
|
void ConfigFilePath::setTonemappingEnableFragShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
tonemappingEnableFragShaderPath = path;
|
tonemappingEnableFragShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setTonemappingDisableFragShaderPath(const std::string &path)
|
void ConfigFilePath::setTonemappingDisableFragShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
tonemappingDisableFragShaderPath = path;
|
tonemappingDisableFragShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setIrradianceFragShaderPath(const std::string &path)
|
void ConfigFilePath::setIrradianceFragShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
irradianceFragShaderPath = path;
|
irradianceFragShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setFilterVertShaderPath(const std::string &path)
|
void ConfigFilePath::setFilterVertShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
filterVertShaderPath = path;
|
filterVertShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setPrefilterEnvmapFragShaderPath(const std::string &path)
|
void ConfigFilePath::setPrefilterEnvmapFragShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
prefilterEnvmapFragShaderPath = path;
|
prefilterEnvmapFragShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setBrdfVertShaderPath(const std::string &path)
|
void ConfigFilePath::setBrdfVertShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
brdfVertShaderPath = path;
|
brdfVertShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setBrdfFragShaderPath(const std::string &path)
|
void ConfigFilePath::setBrdfFragShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
brdfFragShaderPath = path;
|
brdfFragShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setEnvMapFilePath(const std::string &path)
|
void ConfigFilePath::setEnvMapFilePath(const std::string path)
|
||||||
{
|
{
|
||||||
envMapFilePath = path;
|
envMapFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setEmptyEnvmapFilePath(const std::string &path)
|
void ConfigFilePath::setEmptyEnvmapFilePath(const std::string path)
|
||||||
{
|
{
|
||||||
emptyEnvmapFilePath = path;
|
emptyEnvmapFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setPbrVertShaderPath(const std::string &path)
|
void ConfigFilePath::setPbrVertShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
pbrVertShaderPath = path;
|
pbrVertShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setPbrFragShaderPath(const std::string &path)
|
void ConfigFilePath::setPbrFragShaderPath(const std::string path)
|
||||||
{
|
{
|
||||||
pbrFragShaderPath = path;
|
pbrFragShaderPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setTtfFilePath(const std::string &path)
|
void ConfigFilePath::setTtfFilePath(const std::string path)
|
||||||
{
|
{
|
||||||
ttfFilePath = path;
|
ttfFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setImageOutputPath(const std::string &path)
|
void ConfigFilePath::setImageOutputPath(const std::string path)
|
||||||
{
|
{
|
||||||
imageOutputPath = path;
|
imageOutputPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setVideoOutputPath(const std::string &path)
|
void ConfigFilePath::setVideoOutputPath(const std::string path)
|
||||||
{
|
{
|
||||||
videoOutputPath = path;
|
videoOutputPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setTotalImageOutputPath(const std::string &path)
|
void ConfigFilePath::setTotalImageOutputPath(const std::string path)
|
||||||
{
|
{
|
||||||
totalImageOutputPath = path;
|
totalImageOutputPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setDeviceSpecFilePath(const std::string &path)
|
void ConfigFilePath::setDeviceSpecFilePath(const std::string path)
|
||||||
{
|
{
|
||||||
deviceSpecFilePath = path;
|
deviceSpecFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setImage2videoBatFilePath(const std::string &path)
|
void ConfigFilePath::setImage2videoBatFilePath(const std::string path)
|
||||||
{
|
{
|
||||||
image2videoBatFilePath = path;
|
image2videoBatFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigFilePath::setImage2videoShFilePath(const std::string &path)
|
void ConfigFilePath::setImage2videoShFilePath(const std::string path)
|
||||||
{
|
{
|
||||||
image2videoShFilePath = path;
|
image2videoShFilePath = path;
|
||||||
}
|
}
|
||||||
|
|
@ -4,67 +4,68 @@
|
||||||
class ConfigFilePath
|
class ConfigFilePath
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::string getAssetPath();
|
|
||||||
|
|
||||||
// Getter methods
|
// Getter methods
|
||||||
const std::string &getGlTFModelFilePath() const;
|
const std::string getGlTFModelFilePath() const;
|
||||||
const std::string &getModelVertShaderPath() const;
|
const std::string getModelVertShaderPath() const;
|
||||||
const std::string &getModelFragShaderPath() const;
|
const std::string getModelFragShaderPath() const;
|
||||||
const std::string &getUiVertShaderPath() const;
|
const std::string getUiVertShaderPath() const;
|
||||||
const std::string &getUiFragShaderPath() const;
|
const std::string getUiFragShaderPath() const;
|
||||||
const std::string &getSkyboxModleFilePath() const;
|
const std::string getSkyboxModleFilePath() const;
|
||||||
const std::string &getSkyboxVertShaderPath() const;
|
const std::string getSkyboxVertShaderPath() const;
|
||||||
const std::string &getSkyboxFragShaderPath() const;
|
const std::string getSkyboxFragShaderPath() const;
|
||||||
const std::string &getIblTexturesFilePath() const;
|
const std::string getIblTexturesFilePath() const;
|
||||||
const std::string &getTonemappingVertShaderPath() const;
|
const std::string getTonemappingVertShaderPath() const;
|
||||||
const std::string &getTonemappingEnableFragShaderPath() const;
|
const std::string getTonemappingEnableFragShaderPath() const;
|
||||||
const std::string &getTonemappingDisableFragShaderPath() const;
|
const std::string getTonemappingDisableFragShaderPath() const;
|
||||||
const std::string &getIrradianceFragShaderPath() const;
|
const std::string getIrradianceFragShaderPath() const;
|
||||||
const std::string &getFilterVertShaderPath() const;
|
const std::string getFilterVertShaderPath() const;
|
||||||
const std::string &getPrefilterEnvmapFragShaderPath() const;
|
const std::string getPrefilterEnvmapFragShaderPath() const;
|
||||||
const std::string &getBrdfVertShaderPath() const;
|
const std::string getBrdfVertShaderPath() const;
|
||||||
const std::string &getBrdfFragShaderPath() const;
|
const std::string getBrdfFragShaderPath() const;
|
||||||
const std::string &getEnvMapFilePath() const;
|
const std::string getEnvMapFilePath() const;
|
||||||
const std::string &getEmptyEnvmapFilePath() const;
|
const std::string getEmptyEnvmapFilePath() const;
|
||||||
const std::string &getPbrVertShaderPath() const;
|
const std::string getPbrVertShaderPath() const;
|
||||||
const std::string &getPbrFragShaderPath() const;
|
const std::string getPbrFragShaderPath() const;
|
||||||
const std::string &getTtfFilePath() const;
|
const std::string getTtfFilePath() const;
|
||||||
const std::string &getImageOutputPath() const;
|
const std::string getImageOutputPath() const;
|
||||||
const std::string &getVideoOutputPath() const;
|
const std::string getVideoOutputPath() const;
|
||||||
const std::string &getTotalImageOutputPath() const;
|
const std::string getTotalImageOutputPath() const;
|
||||||
const std::string &getDeviceSpecFilePath() const;
|
const std::string getDeviceSpecFilePath() const;
|
||||||
const std::string &getImage2videoBatFilePath() const;
|
const std::string getImage2videoBatFilePath() const;
|
||||||
const std::string &getImage2videoShFilePath() const;
|
const std::string getImage2videoShFilePath() const;
|
||||||
|
|
||||||
// Setter methods
|
// Setter methods
|
||||||
void setGlTFModelFilePath(const std::string &path);
|
void setGlTFModelFilePath(const std::string path);
|
||||||
void setModelVertShaderPath(const std::string &path);
|
void setModelVertShaderPath(const std::string path);
|
||||||
void setModelFragShaderPath(const std::string &path);
|
void setModelFragShaderPath(const std::string path);
|
||||||
void setUiVertShaderPath(const std::string &path);
|
void setUiVertShaderPath(const std::string path);
|
||||||
void setUiFragShaderPath(const std::string &path);
|
void setUiFragShaderPath(const std::string path);
|
||||||
void setSkyboxModleFilePath(const std::string &path);
|
void setSkyboxModleFilePath(const std::string path);
|
||||||
void setSkyboxVertShaderPath(const std::string &path);
|
void setSkyboxVertShaderPath(const std::string path);
|
||||||
void setSkyboxFragShaderPath(const std::string &path);
|
void setSkyboxFragShaderPath(const std::string path);
|
||||||
void setIblTexturesFilePath(const std::string &path);
|
void setIblTexturesFilePath(const std::string path);
|
||||||
void setTonemappingVertShaderPath(const std::string &path);
|
void setTonemappingVertShaderPath(const std::string path);
|
||||||
void setTonemappingEnableFragShaderPath(const std::string &path);
|
void setTonemappingEnableFragShaderPath(const std::string path);
|
||||||
void setTonemappingDisableFragShaderPath(const std::string &path);
|
void setTonemappingDisableFragShaderPath(const std::string path);
|
||||||
void setIrradianceFragShaderPath(const std::string &path);
|
void setIrradianceFragShaderPath(const std::string path);
|
||||||
void setFilterVertShaderPath(const std::string &path);
|
void setFilterVertShaderPath(const std::string path);
|
||||||
void setPrefilterEnvmapFragShaderPath(const std::string &path);
|
void setPrefilterEnvmapFragShaderPath(const std::string path);
|
||||||
void setBrdfVertShaderPath(const std::string &path);
|
void setBrdfVertShaderPath(const std::string path);
|
||||||
void setBrdfFragShaderPath(const std::string &path);
|
void setBrdfFragShaderPath(const std::string path);
|
||||||
void setEnvMapFilePath(const std::string &path);
|
void setEnvMapFilePath(const std::string path);
|
||||||
void setEmptyEnvmapFilePath(const std::string &path);
|
void setEmptyEnvmapFilePath(const std::string path);
|
||||||
void setPbrVertShaderPath(const std::string &path);
|
void setPbrVertShaderPath(const std::string path);
|
||||||
void setPbrFragShaderPath(const std::string &path);
|
void setPbrFragShaderPath(const std::string path);
|
||||||
void setTtfFilePath(const std::string &path);
|
void setTtfFilePath(const std::string path);
|
||||||
void setImageOutputPath(const std::string &path);
|
void setImageOutputPath(const std::string path);
|
||||||
void setVideoOutputPath(const std::string &path);
|
void setVideoOutputPath(const std::string path);
|
||||||
void setTotalImageOutputPath(const std::string &path);
|
void setTotalImageOutputPath(const std::string path);
|
||||||
void setDeviceSpecFilePath(const std::string &path);
|
void setDeviceSpecFilePath(const std::string path);
|
||||||
void setImage2videoBatFilePath(const std::string &path);
|
void setImage2videoBatFilePath(const std::string path);
|
||||||
void setImage2videoShFilePath(const std::string &path);
|
void setImage2videoShFilePath(const std::string path);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string getAssetPath() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string glTFModelFilePath = "models/DamagedHelmet/DamagedHelmet.gltf";
|
std::string glTFModelFilePath = "models/DamagedHelmet/DamagedHelmet.gltf";
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,155 @@
|
||||||
#include "LocalizationStrings.h"
|
#include "LocalizationStrings.h"
|
||||||
|
|
||||||
const char *LocalizationStrings::getModel() const { return m_model; }
|
LocalizationStrings::LocalizationStrings()
|
||||||
const char *LocalizationStrings::getEnvironmentMap() const { return m_environmentMap; }
|
{
|
||||||
const char *LocalizationStrings::getEnvironmentBackGround() const { return m_environmentBackGround; }
|
}
|
||||||
const char *LocalizationStrings::getDebugInput() const { return m_debugInput; }
|
|
||||||
const char *LocalizationStrings::getDebugPBREquation() const { return m_debugPBREquation; }
|
|
||||||
const char *LocalizationStrings::getAnimation() const { return m_animation; }
|
|
||||||
const char *LocalizationStrings::getPauseAnimation() const { return m_pauseAnimation; }
|
|
||||||
const char *LocalizationStrings::getAnimationSeq() const { return m_animationSeq; }
|
|
||||||
const char *LocalizationStrings::getMenuFile() const { return m_menuFile; }
|
|
||||||
const char *LocalizationStrings::getMenuOpenNewModel() const { return m_menuOpenNewModel; }
|
|
||||||
const char *LocalizationStrings::getMenuEnvironment() const { return m_menuEnvironment; }
|
|
||||||
const char *LocalizationStrings::getMenuEnvironmentConfig() const { return m_menuEnvironmentConfig; }
|
|
||||||
const char *LocalizationStrings::getMenuAnimation() const { return m_menuAnimation; }
|
|
||||||
const char *LocalizationStrings::getMenuDebugFrameRate() const { return m_menuDebugFrameRate; }
|
|
||||||
const char *LocalizationStrings::getMenuDebugInput() const { return m_menuDebugInput; }
|
|
||||||
const char *LocalizationStrings::getMenuAnimationNoAnimation() const { return m_menuAnimationNoAnimation; }
|
|
||||||
const char *LocalizationStrings::getMenuAnimationActivation() const { return m_menuAnimationActivation; }
|
|
||||||
const char *LocalizationStrings::getMenuAnimationAnimationSequence() const { return m_menuAnimationAnimationSequence; }
|
|
||||||
|
|
||||||
void LocalizationStrings::setModel(const char *model) { m_model = model; }
|
LocalizationStrings::~LocalizationStrings()
|
||||||
void LocalizationStrings::setEnvironmentMap(const char *environmentMap) { m_environmentMap = environmentMap; }
|
{
|
||||||
void LocalizationStrings::setEnvironmentBackGround(const char *environmentBackGround) { m_environmentBackGround = environmentBackGround; }
|
}
|
||||||
void LocalizationStrings::setDebugInput(const char *debugInput) { m_debugInput = debugInput; }
|
|
||||||
void LocalizationStrings::setDebugPBREquation(const char *debugPBREquation) { m_debugPBREquation = debugPBREquation; }
|
const char *LocalizationStrings::getModel() const
|
||||||
void LocalizationStrings::setAnimation(const char *animation) { m_animation = animation; }
|
{
|
||||||
void LocalizationStrings::setPauseAnimation(const char *pauseAnimation) { m_pauseAnimation = pauseAnimation; }
|
return m_model;
|
||||||
void LocalizationStrings::setAnimationSeq(const char *animationSeq) { m_animationSeq = animationSeq; }
|
}
|
||||||
void LocalizationStrings::setMenuFile(const char *menuFile) { m_menuFile = menuFile; }
|
const char *LocalizationStrings::getEnvironmentMap() const
|
||||||
void LocalizationStrings::setMenuOpenNewModel(const char *menuOpenNewModel) { m_menuOpenNewModel = menuOpenNewModel; }
|
{
|
||||||
void LocalizationStrings::setMenuEnvironment(const char *menuEnvironment) { m_menuEnvironment = menuEnvironment; }
|
return m_environmentMap;
|
||||||
void LocalizationStrings::setMenuEnvironmentConfig(const char *menuEnvironmentConfig) { m_menuEnvironmentConfig = menuEnvironmentConfig; }
|
}
|
||||||
void LocalizationStrings::setMenuAnimation(const char *menuAnimation) { m_menuAnimation = menuAnimation; }
|
const char *LocalizationStrings::getEnvironmentBackGround() const
|
||||||
void LocalizationStrings::setMenuDebugFrameRate(const char *menuDebugFrameRate) { m_menuDebugFrameRate = menuDebugFrameRate; }
|
{
|
||||||
void LocalizationStrings::setMenuDebugInput(const char *menuDebugInput) { m_menuDebugInput = menuDebugInput; }
|
return m_environmentBackGround;
|
||||||
void LocalizationStrings::setMenuAnimationNoAnimation(const char *menuAnimationNoAnimation) { m_menuAnimationNoAnimation = menuAnimationNoAnimation; }
|
}
|
||||||
void LocalizationStrings::setMenuAnimationActivation(const char *menuAnimationActivation) { m_menuAnimationActivation = menuAnimationActivation; }
|
const char *LocalizationStrings::getDebugInput() const
|
||||||
void LocalizationStrings::setMenuAnimationAnimationSequence(const char *menuAnimationAnimationSequence) { m_menuAnimationAnimationSequence = menuAnimationAnimationSequence; }
|
{
|
||||||
|
return m_debugInput;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getDebugPBREquation() const
|
||||||
|
{
|
||||||
|
return m_debugPBREquation;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getAnimation() const
|
||||||
|
{
|
||||||
|
return m_animation;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getPauseAnimation() const
|
||||||
|
{
|
||||||
|
return m_pauseAnimation;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getAnimationSeq() const
|
||||||
|
{
|
||||||
|
return m_animationSeq;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuFile() const
|
||||||
|
{
|
||||||
|
return m_menuFile;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuOpenNewModel() const
|
||||||
|
{
|
||||||
|
return m_menuOpenNewModel;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuEnvironment() const
|
||||||
|
{
|
||||||
|
return m_menuEnvironment;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuEnvironmentConfig() const
|
||||||
|
{
|
||||||
|
return m_menuEnvironmentConfig;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuAnimation() const
|
||||||
|
{
|
||||||
|
return m_menuAnimation;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuDebugFrameRate() const
|
||||||
|
{
|
||||||
|
return m_menuDebugFrameRate;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuDebugInput() const
|
||||||
|
{
|
||||||
|
return m_menuDebugInput;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuAnimationNoAnimation() const
|
||||||
|
{
|
||||||
|
return m_menuAnimationNoAnimation;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuAnimationActivation() const
|
||||||
|
{
|
||||||
|
return m_menuAnimationActivation;
|
||||||
|
}
|
||||||
|
const char *LocalizationStrings::getMenuAnimationAnimationSequence() const
|
||||||
|
{
|
||||||
|
return m_menuAnimationAnimationSequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LocalizationStrings::setModel(const char *model)
|
||||||
|
{
|
||||||
|
m_model = model;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setEnvironmentMap(const char *environmentMap)
|
||||||
|
{
|
||||||
|
m_environmentMap = environmentMap;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setEnvironmentBackGround(const char *environmentBackGround)
|
||||||
|
{
|
||||||
|
m_environmentBackGround = environmentBackGround;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setDebugInput(const char *debugInput)
|
||||||
|
{
|
||||||
|
m_debugInput = debugInput;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setDebugPBREquation(const char *debugPBREquation)
|
||||||
|
{
|
||||||
|
m_debugPBREquation = debugPBREquation;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setAnimation(const char *animation)
|
||||||
|
{
|
||||||
|
m_animation = animation;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setPauseAnimation(const char *pauseAnimation)
|
||||||
|
{
|
||||||
|
m_pauseAnimation = pauseAnimation;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setAnimationSeq(const char *animationSeq)
|
||||||
|
{
|
||||||
|
m_animationSeq = animationSeq;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuFile(const char *menuFile)
|
||||||
|
{
|
||||||
|
m_menuFile = menuFile;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuOpenNewModel(const char *menuOpenNewModel)
|
||||||
|
{
|
||||||
|
m_menuOpenNewModel = menuOpenNewModel;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuEnvironment(const char *menuEnvironment)
|
||||||
|
{
|
||||||
|
m_menuEnvironment = menuEnvironment;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuEnvironmentConfig(const char *menuEnvironmentConfig)
|
||||||
|
{
|
||||||
|
m_menuEnvironmentConfig = menuEnvironmentConfig;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuAnimation(const char *menuAnimation)
|
||||||
|
{
|
||||||
|
m_menuAnimation = menuAnimation;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuDebugFrameRate(const char *menuDebugFrameRate)
|
||||||
|
{
|
||||||
|
m_menuDebugFrameRate = menuDebugFrameRate;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuDebugInput(const char *menuDebugInput)
|
||||||
|
{
|
||||||
|
m_menuDebugInput = menuDebugInput;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuAnimationNoAnimation(const char *menuAnimationNoAnimation)
|
||||||
|
{
|
||||||
|
m_menuAnimationNoAnimation = menuAnimationNoAnimation;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuAnimationActivation(const char *menuAnimationActivation)
|
||||||
|
{
|
||||||
|
m_menuAnimationActivation = menuAnimationActivation;
|
||||||
|
}
|
||||||
|
void LocalizationStrings::setMenuAnimationAnimationSequence(const char *menuAnimationAnimationSequence)
|
||||||
|
{
|
||||||
|
m_menuAnimationAnimationSequence = menuAnimationAnimationSequence;
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,9 @@
|
||||||
class LocalizationStrings
|
class LocalizationStrings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
LocalizationStrings();
|
||||||
|
~LocalizationStrings();
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
const char *getModel() const;
|
const char *getModel() const;
|
||||||
const char *getEnvironmentMap() const;
|
const char *getEnvironmentMap() const;
|
||||||
|
|
|
||||||
|
|
@ -3,45 +3,45 @@
|
||||||
// Getters
|
// Getters
|
||||||
vks::TextureCubeMap &RenderSceneTextures::getEnvironmentCube()
|
vks::TextureCubeMap &RenderSceneTextures::getEnvironmentCube()
|
||||||
{
|
{
|
||||||
return environmentCube;
|
return m_environmentCube;
|
||||||
}
|
}
|
||||||
vks::Texture2D &RenderSceneTextures::getEmpty()
|
vks::Texture2D &RenderSceneTextures::getEmpty()
|
||||||
{
|
{
|
||||||
return empty;
|
return m_empty;
|
||||||
}
|
}
|
||||||
vks::Texture2D &RenderSceneTextures::getLutBrdf()
|
vks::Texture2D &RenderSceneTextures::getLutBrdf()
|
||||||
{
|
{
|
||||||
return lutBrdf;
|
return m_lutBrdf;
|
||||||
}
|
}
|
||||||
vks::TextureCubeMap &RenderSceneTextures::getIrradianceCube()
|
vks::TextureCubeMap &RenderSceneTextures::getIrradianceCube()
|
||||||
{
|
{
|
||||||
return irradianceCube;
|
return m_irradianceCube;
|
||||||
}
|
}
|
||||||
vks::TextureCubeMap &RenderSceneTextures::getPrefilteredCube()
|
vks::TextureCubeMap &RenderSceneTextures::getPrefilteredCube()
|
||||||
{
|
{
|
||||||
return prefilteredCube;
|
return m_prefilteredCube;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
void RenderSceneTextures::setEnvironmentCube(const vks::TextureCubeMap &texture)
|
void RenderSceneTextures::setEnvironmentCube(const vks::TextureCubeMap &texture)
|
||||||
{
|
{
|
||||||
environmentCube = texture;
|
m_environmentCube = texture;
|
||||||
}
|
}
|
||||||
void RenderSceneTextures::setEmpty(const vks::Texture2D &texture)
|
void RenderSceneTextures::setEmpty(const vks::Texture2D &texture)
|
||||||
{
|
{
|
||||||
empty = texture;
|
m_empty = texture;
|
||||||
}
|
}
|
||||||
void RenderSceneTextures::setLutBrdf(const vks::Texture2D &texture)
|
void RenderSceneTextures::setLutBrdf(const vks::Texture2D &texture)
|
||||||
{
|
{
|
||||||
lutBrdf = texture;
|
m_lutBrdf = texture;
|
||||||
}
|
}
|
||||||
void RenderSceneTextures::setIrradianceCube(const vks::TextureCubeMap &texture)
|
void RenderSceneTextures::setIrradianceCube(const vks::TextureCubeMap &texture)
|
||||||
{
|
{
|
||||||
irradianceCube = texture;
|
m_irradianceCube = texture;
|
||||||
}
|
}
|
||||||
void RenderSceneTextures::setPrefilteredCube(const vks::TextureCubeMap &texture)
|
void RenderSceneTextures::setPrefilteredCube(const vks::TextureCubeMap &texture)
|
||||||
{
|
{
|
||||||
prefilteredCube = texture;
|
m_prefilteredCube = texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderSceneTextures::RenderSceneTextures()
|
RenderSceneTextures::RenderSceneTextures()
|
||||||
|
|
@ -51,3 +51,24 @@ RenderSceneTextures::RenderSceneTextures()
|
||||||
RenderSceneTextures::~RenderSceneTextures()
|
RenderSceneTextures::~RenderSceneTextures()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderSceneTextures::destroyEnvironmentCube()
|
||||||
|
{
|
||||||
|
m_environmentCube.destroy();
|
||||||
|
}
|
||||||
|
void RenderSceneTextures::destroyEmpty()
|
||||||
|
{
|
||||||
|
m_empty.destroy();
|
||||||
|
}
|
||||||
|
void RenderSceneTextures::destroyLutBrdf()
|
||||||
|
{
|
||||||
|
m_lutBrdf.destroy();
|
||||||
|
}
|
||||||
|
void RenderSceneTextures::destroyIrradianceCube()
|
||||||
|
{
|
||||||
|
m_irradianceCube.destroy();
|
||||||
|
}
|
||||||
|
void RenderSceneTextures::destroyPrefilteredCube()
|
||||||
|
{
|
||||||
|
m_prefilteredCube.destroy();
|
||||||
|
}
|
||||||
|
|
@ -22,10 +22,17 @@ public:
|
||||||
void setIrradianceCube(const vks::TextureCubeMap &texture);
|
void setIrradianceCube(const vks::TextureCubeMap &texture);
|
||||||
void setPrefilteredCube(const vks::TextureCubeMap &texture);
|
void setPrefilteredCube(const vks::TextureCubeMap &texture);
|
||||||
|
|
||||||
|
// destroy
|
||||||
|
void destroyEnvironmentCube();
|
||||||
|
void destroyEmpty();
|
||||||
|
void destroyLutBrdf();
|
||||||
|
void destroyIrradianceCube();
|
||||||
|
void destroyPrefilteredCube();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vks::TextureCubeMap environmentCube;
|
vks::TextureCubeMap m_environmentCube;
|
||||||
vks::Texture2D empty;
|
vks::Texture2D m_empty;
|
||||||
vks::Texture2D lutBrdf;
|
vks::Texture2D m_lutBrdf;
|
||||||
vks::TextureCubeMap irradianceCube;
|
vks::TextureCubeMap m_irradianceCube;
|
||||||
vks::TextureCubeMap prefilteredCube;
|
vks::TextureCubeMap m_prefilteredCube;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "ConfigFilePath.h"
|
||||||
|
#include "RenderSceneTextures.h"
|
||||||
|
#include "renderShaderData.h"
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
|
@ -21,14 +24,12 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "algorithm"
|
|
||||||
#include <codecvt>
|
#include <codecvt>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include "VulkanDevice.hpp"
|
|
||||||
#include "VulkanExampleBase.h"
|
#include "VulkanExampleBase.h"
|
||||||
#include "glTFModel.h"
|
#include "glTFModel.h"
|
||||||
#include "ui.hpp"
|
#include "ui.hpp"
|
||||||
|
|
@ -37,152 +38,34 @@
|
||||||
#include <vulkan/vulkan.h>
|
#include <vulkan/vulkan.h>
|
||||||
|
|
||||||
#define ENABLE_VALIDATION false
|
#define ENABLE_VALIDATION false
|
||||||
|
#include "LocalizationStrings.h"
|
||||||
|
|
||||||
|
#include "ConfigFilePath.h"
|
||||||
|
#include "RenderSceneTextures.h"
|
||||||
|
#include "SceneUBOMatrices.h"
|
||||||
|
#include "SkyboxUBOMatrices.h"
|
||||||
#include "renderEffectState.h"
|
#include "renderEffectState.h"
|
||||||
|
#include "renderSceneModel.h"
|
||||||
|
#include "renderShaderData.h"
|
||||||
|
#include "renderUniformBufferSet.h"
|
||||||
|
#include "renderVideoOutputState.h"
|
||||||
|
|
||||||
class PlumageRender : public VulkanExampleBase
|
class PlumageRender : public VulkanExampleBase
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
RenderEffectState *m_effectState;
|
RenderEffectState *m_effectState;
|
||||||
|
RenderVideoOutputState *m_videoOutputState;
|
||||||
|
RenderSceneModel m_sceneModel;
|
||||||
|
RenderSceneTextures m_sceneTextures;
|
||||||
|
RenderShaderData m_shaderData;
|
||||||
|
LocalizationStrings m_localizationStrings;
|
||||||
|
|
||||||
|
SceneUBOMatrices m_shaderDataScene;
|
||||||
|
SkyboxUBOMatrices m_shaderDataSkybox;
|
||||||
|
|
||||||
|
ConfigFilePath m_configFilePath;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
struct Models
|
|
||||||
{
|
|
||||||
glTFModel::Model scene;
|
|
||||||
glTFModel::Model skybox;
|
|
||||||
} models;
|
|
||||||
|
|
||||||
struct Textures
|
|
||||||
{
|
|
||||||
vks::TextureCubeMap environmentCube;
|
|
||||||
vks::Texture2D empty;
|
|
||||||
vks::Texture2D lutBrdf;
|
|
||||||
vks::TextureCubeMap irradianceCube;
|
|
||||||
vks::TextureCubeMap prefilteredCube;
|
|
||||||
} textures;
|
|
||||||
|
|
||||||
struct ShaderData
|
|
||||||
{
|
|
||||||
glm::vec4 lightDir;
|
|
||||||
float exposure = 4.5f;
|
|
||||||
float gamma = 2.2f;
|
|
||||||
float prefilteredCubeMipLevels;
|
|
||||||
float scaleIBLAmbient = 2.0f;
|
|
||||||
float debugViewInputs = 0;
|
|
||||||
float debugViewEquation = 0;
|
|
||||||
} shaderData;
|
|
||||||
struct ChinesesUI
|
|
||||||
{
|
|
||||||
const char *model = "模型";
|
|
||||||
|
|
||||||
const char *environmentMap = "环境贴图";
|
|
||||||
const char *environmentBackGround = "启用背景贴图";
|
|
||||||
const char *debugInput = "输入";
|
|
||||||
const char *debugPBREquation = "PBR计算参数";
|
|
||||||
const char *animation = "动画";
|
|
||||||
const char *pauseAnimation = "启用动画";
|
|
||||||
const char *animationSeq = "动画序列";
|
|
||||||
// menu item
|
|
||||||
const char *menuFile = "文件";
|
|
||||||
const char *menuOpenNewModel = "新模型..";
|
|
||||||
const char *menuEnvironment = "环境光照";
|
|
||||||
const char *menuEnvironmentConfig = "设置";
|
|
||||||
const char *menuAnimation = "动画";
|
|
||||||
const char *menuDebugFrameRate = "fps";
|
|
||||||
const char *menuDebugInput = "输入";
|
|
||||||
const char *menuAnimationNoAnimation = "当前模型没有动画!";
|
|
||||||
|
|
||||||
const char *menuAnimationActivation = "开关";
|
|
||||||
const char *menuAnimationAnimationSequence = "动画序列";
|
|
||||||
|
|
||||||
} chineseUI;
|
|
||||||
|
|
||||||
struct UniformBufferSet
|
|
||||||
{
|
|
||||||
Buffer scene;
|
|
||||||
Buffer skybox;
|
|
||||||
Buffer params;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct UBOMatrices
|
|
||||||
{
|
|
||||||
glm::mat4 projection;
|
|
||||||
glm::mat4 model;
|
|
||||||
glm::mat4 view;
|
|
||||||
glm::vec3 camPos;
|
|
||||||
} shaderDataScene, shaderDataSkybox;
|
|
||||||
|
|
||||||
struct PushConstBlockMaterial
|
|
||||||
{
|
|
||||||
glm::vec4 baseColorFactor;
|
|
||||||
glm::vec4 emissiveFactor;
|
|
||||||
glm::vec4 diffuseFactor;
|
|
||||||
glm::vec4 specularFactor;
|
|
||||||
float workflow;
|
|
||||||
int colorTextureSet;
|
|
||||||
int PhysicalDescriptorTextureSet;
|
|
||||||
int normalTextureSet;
|
|
||||||
int occlusionTextureSet;
|
|
||||||
int emissiveTextureSet;
|
|
||||||
float metallicFactor;
|
|
||||||
float roughnessFactor;
|
|
||||||
float alphaMask;
|
|
||||||
float alphaMaskCutoff;
|
|
||||||
} pushConstBlockMaterial;
|
|
||||||
|
|
||||||
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/brown_photostudio_02_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";
|
|
||||||
|
|
||||||
} filePath;
|
|
||||||
|
|
||||||
float modelrot = 0.0f;
|
float modelrot = 0.0f;
|
||||||
glm::vec3 modelPos = glm::vec3(0.0f);
|
glm::vec3 modelPos = glm::vec3(0.0f);
|
||||||
|
|
||||||
|
|
@ -246,7 +129,7 @@ public:
|
||||||
std::vector<DescriptorSets> descriptorSets;
|
std::vector<DescriptorSets> descriptorSets;
|
||||||
|
|
||||||
std::vector<VkCommandBuffer> commandBuffers;
|
std::vector<VkCommandBuffer> commandBuffers;
|
||||||
std::vector<UniformBufferSet> uniformBuffers;
|
std::vector<RenderUniformBufferSet> uniformBuffers;
|
||||||
|
|
||||||
std::vector<VkFence> waitFences;
|
std::vector<VkFence> waitFences;
|
||||||
std::vector<VkSemaphore> renderCompleteSemaphores;
|
std::vector<VkSemaphore> renderCompleteSemaphores;
|
||||||
|
|
@ -312,14 +195,14 @@ public:
|
||||||
vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.material, nullptr);
|
vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.material, nullptr);
|
||||||
vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.node, nullptr);
|
vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.node, nullptr);
|
||||||
|
|
||||||
models.scene.destroy(device);
|
m_sceneModel.destroyScene(device);
|
||||||
models.skybox.destroy(device);
|
m_sceneModel.destroySkyBox(device);
|
||||||
|
|
||||||
for (auto buffer : uniformBuffers)
|
for (auto buffer : uniformBuffers)
|
||||||
{
|
{
|
||||||
buffer.params.destroy();
|
buffer.getParams().destroy();
|
||||||
buffer.scene.destroy();
|
buffer.getScene().destroy();
|
||||||
buffer.skybox.destroy();
|
buffer.getSkybox().destroy();
|
||||||
}
|
}
|
||||||
for (auto fence : waitFences)
|
for (auto fence : waitFences)
|
||||||
{
|
{
|
||||||
|
|
@ -334,11 +217,12 @@ public:
|
||||||
vkDestroySemaphore(device, semaphore, nullptr);
|
vkDestroySemaphore(device, semaphore, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
textures.environmentCube.destroy();
|
m_sceneTextures.destroyEnvironmentCube();
|
||||||
textures.irradianceCube.destroy();
|
m_sceneTextures.destroyIrradianceCube();
|
||||||
textures.prefilteredCube.destroy();
|
m_sceneTextures.destroyPrefilteredCube();
|
||||||
textures.lutBrdf.destroy();
|
m_sceneTextures.destroyLutBrdf();
|
||||||
textures.empty.destroy();
|
m_sceneTextures.destroyEmpty();
|
||||||
|
|
||||||
delete gui;
|
delete gui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,21 +11,29 @@ RenderSceneModel::~RenderSceneModel()
|
||||||
|
|
||||||
void RenderSceneModel::setScene(glTFModel::Model value)
|
void RenderSceneModel::setScene(glTFModel::Model value)
|
||||||
{
|
{
|
||||||
m_scene = value;
|
m_scene = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
glTFModel::Model RenderSceneModel::getScene() const
|
glTFModel::Model &RenderSceneModel::getScene()
|
||||||
{
|
{
|
||||||
return m_scene;
|
return m_scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderSceneModel::setSkyBox(glTFModel::Model value)
|
void RenderSceneModel::setSkyBox(glTFModel::Model value)
|
||||||
{
|
{
|
||||||
m_skybox = value;
|
m_skybox = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
glTFModel::Model RenderSceneModel::getSkyBox() const
|
glTFModel::Model &RenderSceneModel::getSkyBox()
|
||||||
{
|
{
|
||||||
return m_skybox;
|
return m_skybox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderSceneModel::destroyScene(VkDevice device)
|
||||||
|
{
|
||||||
|
m_scene.destroy(device);
|
||||||
|
}
|
||||||
|
void RenderSceneModel::destroySkyBox(VkDevice device)
|
||||||
|
{
|
||||||
|
m_skybox.destroy(device);
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "glTFModel.h"
|
#include "glTFModel.h"
|
||||||
|
#include "vulkan/vulkan.h"
|
||||||
|
|
||||||
class RenderSceneModel
|
class RenderSceneModel
|
||||||
{
|
{
|
||||||
|
|
@ -9,10 +10,13 @@ public:
|
||||||
~RenderSceneModel();
|
~RenderSceneModel();
|
||||||
|
|
||||||
void setScene(glTFModel::Model value);
|
void setScene(glTFModel::Model value);
|
||||||
glTFModel::Model getScene() const;
|
glTFModel::Model &getScene();
|
||||||
|
|
||||||
void setSkyBox(glTFModel::Model value);
|
void setSkyBox(glTFModel::Model value);
|
||||||
glTFModel::Model getSkyBox() const;
|
glTFModel::Model &getSkyBox();
|
||||||
|
|
||||||
|
void destroyScene(VkDevice device);
|
||||||
|
void destroySkyBox(VkDevice device);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
glTFModel::Model m_scene;
|
glTFModel::Model m_scene;
|
||||||
|
|
|
||||||
|
|
@ -9,43 +9,43 @@ RenderShaderData::~RenderShaderData()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
const glm::vec4 &RenderShaderData::getLightDir() const
|
glm::vec4 RenderShaderData::getLightDir()
|
||||||
{
|
{
|
||||||
return m_lightDir;
|
return m_lightDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RenderShaderData::getExposure() const
|
float &RenderShaderData::getExposure()
|
||||||
{
|
{
|
||||||
return m_exposure;
|
return m_exposure;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RenderShaderData::getGamma() const
|
float &RenderShaderData::getGamma()
|
||||||
{
|
{
|
||||||
return m_gamma;
|
return m_gamma;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RenderShaderData::getPrefilteredCubeMipLevels() const
|
float RenderShaderData::getPrefilteredCubeMipLevels()
|
||||||
{
|
{
|
||||||
return m_prefilteredCubeMipLevels;
|
return m_prefilteredCubeMipLevels;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RenderShaderData::getScaleIBLAmbient() const
|
float &RenderShaderData::getScaleIBLAmbient()
|
||||||
{
|
{
|
||||||
return m_scaleIBLAmbient;
|
return m_scaleIBLAmbient;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RenderShaderData::getDebugViewInputs() const
|
float &RenderShaderData::getDebugViewInputs()
|
||||||
{
|
{
|
||||||
return m_debugViewInputs;
|
return m_debugViewInputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RenderShaderData::getDebugViewEquation() const
|
float &RenderShaderData::getDebugViewEquation()
|
||||||
{
|
{
|
||||||
return m_debugViewEquation;
|
return m_debugViewEquation;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
void RenderShaderData::setLightDir(const glm::vec4 &dir)
|
void RenderShaderData::setLightDir(const glm::vec4 dir)
|
||||||
{
|
{
|
||||||
m_lightDir = dir;
|
m_lightDir = dir;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,16 +9,16 @@ public:
|
||||||
~RenderShaderData();
|
~RenderShaderData();
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
const glm::vec4 &getLightDir() const;
|
glm::vec4 getLightDir();
|
||||||
float getExposure() const;
|
float &getExposure();
|
||||||
float getGamma() const;
|
float &getGamma();
|
||||||
float getPrefilteredCubeMipLevels() const;
|
float getPrefilteredCubeMipLevels();
|
||||||
float getScaleIBLAmbient() const;
|
float &getScaleIBLAmbient();
|
||||||
float getDebugViewInputs() const;
|
float &getDebugViewInputs();
|
||||||
float getDebugViewEquation() const;
|
float &getDebugViewEquation();
|
||||||
|
|
||||||
// Setters
|
// Setters
|
||||||
void setLightDir(const glm::vec4 &dir);
|
void setLightDir(const glm::vec4 dir);
|
||||||
void setExposure(float exp);
|
void setExposure(float exp);
|
||||||
void setGamma(float g);
|
void setGamma(float g);
|
||||||
void setPrefilteredCubeMipLevels(float levels);
|
void setPrefilteredCubeMipLevels(float levels);
|
||||||
|
|
|
||||||
|
|
@ -9,33 +9,33 @@ RenderUniformBufferSet::~RenderUniformBufferSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getter method definitions
|
// Getter method definitions
|
||||||
const Buffer &RenderUniformBufferSet::getScene() const
|
Buffer &RenderUniformBufferSet::getScene()
|
||||||
{
|
{
|
||||||
return scene;
|
return scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Buffer &RenderUniformBufferSet::getSkybox() const
|
Buffer &RenderUniformBufferSet::getSkybox()
|
||||||
{
|
{
|
||||||
return skybox;
|
return skybox;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Buffer &RenderUniformBufferSet::getParams() const
|
Buffer &RenderUniformBufferSet::getParams()
|
||||||
{
|
{
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setter method definitions
|
// Setter method definitions
|
||||||
void RenderUniformBufferSet::setScene(const Buffer &buffer)
|
void RenderUniformBufferSet::setScene(Buffer &buffer)
|
||||||
{
|
{
|
||||||
scene = buffer;
|
scene = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderUniformBufferSet::setSkybox(const Buffer &buffer)
|
void RenderUniformBufferSet::setSkybox(Buffer &buffer)
|
||||||
{
|
{
|
||||||
skybox = buffer;
|
skybox = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderUniformBufferSet::setParams(const Buffer &buffer)
|
void RenderUniformBufferSet::setParams(Buffer &buffer)
|
||||||
{
|
{
|
||||||
params = buffer;
|
params = buffer;
|
||||||
}
|
}
|
||||||
|
|
@ -9,14 +9,14 @@ public:
|
||||||
~RenderUniformBufferSet();
|
~RenderUniformBufferSet();
|
||||||
|
|
||||||
// Getter methods
|
// Getter methods
|
||||||
const Buffer &getScene() const;
|
Buffer &getScene();
|
||||||
const Buffer &getSkybox() const;
|
Buffer &getSkybox();
|
||||||
const Buffer &getParams() const;
|
Buffer &getParams();
|
||||||
|
|
||||||
// Setter methods
|
// Setter methods
|
||||||
void setScene(const Buffer &buffer);
|
void setScene(Buffer &buffer);
|
||||||
void setSkybox(const Buffer &buffer);
|
void setSkybox(Buffer &buffer);
|
||||||
void setParams(const Buffer &buffer);
|
void setParams(Buffer &buffer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Buffer scene;
|
Buffer scene;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue