Compare commits
4 Commits
test-headl
...
main
Author | SHA1 | Date |
---|---|---|
InkSoul | 1a54e75ea2 | |
ink-soul | b37eee6c18 | |
ink-soul | 3600a1f4b7 | |
ink-soul | 61c501adcb |
|
@ -51,3 +51,7 @@ build/
|
|||
|
||||
*.mp4
|
||||
/data/output
|
||||
*.glb
|
||||
*.ktx
|
||||
|
||||
data/output/video/device0/result.mp4
|
||||
|
|
35
ReadMe.md
35
ReadMe.md
|
@ -9,16 +9,7 @@
|
|||
2. 支持gltf动画
|
||||
3. 支持模型的PBR材质渲染
|
||||
4. 使用基于IBL的环境光照
|
||||
|
||||
#### 分支:add image output ToDo list
|
||||
|
||||
1. 添加ppm格式图片序列输出
|
||||
2. 单帧输出,预览效果
|
||||
3. 接入ffmpeg将图片序列转图片
|
||||
|
||||
#### todo list
|
||||
|
||||
1. 参数化模板选择:维护一个模板数组,前端发送一个数组索引
|
||||
5. 支持渲染结果输出为图片序列通过ffmpeg转为视频(main分支上该功能暂时屏蔽)
|
||||
|
||||
#### 展示
|
||||
|
||||
|
@ -36,16 +27,22 @@
|
|||
|
||||
![](https://lychee.inksoul.top/uploads/original/39/56/ec512b70f1da4cf0771bcc38a6b9.webp)
|
||||
|
||||
#### 下一步计划(等待研究生考试结束)
|
||||
#### 下一步计划
|
||||
|
||||
1. 引入spdlog日志库,细化日志(正在做)
|
||||
2. 重置CMakeLists.txt,添加Xmake 的lua脚本
|
||||
3. 二次封装vulkan API,提供统一的渲染接口
|
||||
4. 更换imgui的分支,允许dock UI
|
||||
5. 添加启动UI,避免对默认模型的依赖
|
||||
6. 添加obj格式支持
|
||||
7. 添加PMX格式支持
|
||||
8. 引入USD格式支持
|
||||
- [ ] 引入spdlog日志库,细化日志(正在做)
|
||||
- [ ] 重置CMakeLists.txt,添加Xmake 的lua脚本
|
||||
- [ ] 二次封装vulkan API,提供统一的渲染接口
|
||||
- [ ] 更换imgui的分支,允许dock UI
|
||||
- [ ] 添加启动UI,避免对默认模型的依赖
|
||||
- [ ] 添加obj格式支持
|
||||
- [ ] 添加PMX格式支持
|
||||
- [ ] 引入USD格式支持
|
||||
|
||||
#### 重构
|
||||
|
||||
暂定层级:
|
||||
|
||||
![](doc/层级.png)
|
||||
|
||||
#### 使用开源库
|
||||
|
||||
|
|
|
@ -113,11 +113,11 @@ public:
|
|||
uint32_t lastFPS = 0;
|
||||
|
||||
struct Settings {
|
||||
bool validation = true; // 校验层开关
|
||||
bool validation = false; // 校验层开关
|
||||
bool fullscreen = false; // 全屏开关
|
||||
bool vsync = false; // 垂直同步开关
|
||||
bool multiSampling = true; // 多重采样
|
||||
bool rotateModel = true; // 模型自旋转(暂时失效)
|
||||
bool rotateModel = false; // 模型自旋转(暂时失效)
|
||||
bool headless = false; // 无头开关
|
||||
bool outputPNGimage = false;
|
||||
bool enableSaveToImageSequeue = true; // 图片序列开关(暂时弃用)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 263 KiB |
|
@ -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.0f, -2.0f });
|
||||
camera.setRotation({ 0.0f, 0.0f, 0.0f });
|
||||
}
|
||||
|
||||
|
@ -1025,8 +1025,8 @@ PlumageRender::PlumageRender()
|
|||
std::vector<glm::mat4> matrices = {
|
||||
glm::rotate(glm::rotate(glm::mat4(1.0f), glm::radians(90.0f), glm::vec3(0.0f, 1.0f, 0.0f)), glm::radians(180.0f), glm::vec3(1.0f, 0.0f, 0.0f)),
|
||||
glm::rotate(glm::rotate(glm::mat4(1.0f), glm::radians(-90.0f), glm::vec3(0.0f, 1.0f, 0.0f)), glm::radians(180.0f), glm::vec3(1.0f, 0.0f, 0.0f)),
|
||||
glm::rotate(glm::mat4(1.0f), glm::radians(-90.0f), glm::vec3(1.0f, 0.0f, 0.0f)),
|
||||
glm::rotate(glm::mat4(1.0f), glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f)),
|
||||
glm::rotate(glm::mat4(1.0f), glm::radians(-90.0f), glm::vec3(1.0f, 0.0f, 0.0f)),
|
||||
glm::rotate(glm::mat4(1.0f), glm::radians(180.0f), glm::vec3(1.0f, 0.0f, 0.0f)),
|
||||
glm::rotate(glm::mat4(1.0f), glm::radians(180.0f), glm::vec3(0.0f, 0.0f, 1.0f)),
|
||||
};
|
||||
|
@ -1035,9 +1035,11 @@ PlumageRender::PlumageRender()
|
|||
|
||||
VkViewport viewport{};
|
||||
viewport.width = (float)dim;
|
||||
viewport.height = (float)dim;
|
||||
viewport.height = -(float)dim;
|
||||
viewport.minDepth = 0.0f;
|
||||
viewport.maxDepth = 1.0f;
|
||||
viewport.x = 0;
|
||||
viewport.y = -viewport.height;
|
||||
|
||||
VkRect2D scissor{};
|
||||
scissor.extent.width = dim;
|
||||
|
@ -1070,7 +1072,9 @@ PlumageRender::PlumageRender()
|
|||
vulkanDevice->beginCommandBuffer(cmdBuf);
|
||||
|
||||
viewport.width = static_cast<float>(dim * std::pow(0.5f, m));
|
||||
viewport.height = static_cast<float>(dim * std::pow(0.5f, m));
|
||||
viewport.height = -static_cast<float>(dim * std::pow(0.5f, m));
|
||||
viewport.x = 0;
|
||||
viewport.y = -viewport.height;
|
||||
vkCmdSetViewport(cmdBuf, 0, 1, &viewport);
|
||||
vkCmdSetScissor(cmdBuf, 0, 1, &scissor);
|
||||
|
||||
|
@ -1133,7 +1137,7 @@ PlumageRender::PlumageRender()
|
|||
copyRegion.dstOffset = { 0, 0, 0 };
|
||||
|
||||
copyRegion.extent.width = static_cast<uint32_t>(viewport.width);
|
||||
copyRegion.extent.height = static_cast<uint32_t>(viewport.height);
|
||||
copyRegion.extent.height = -static_cast<uint32_t>(viewport.height);
|
||||
copyRegion.extent.depth = 1;
|
||||
|
||||
vkCmdCopyImage(
|
||||
|
@ -1434,6 +1438,8 @@ PlumageRender::PlumageRender()
|
|||
viewport.height = (float)dim;
|
||||
viewport.minDepth = 0.0f;
|
||||
viewport.maxDepth = 1.0f;
|
||||
//viewport.x = 0;
|
||||
//viewport.y = -viewport.height;
|
||||
|
||||
VkRect2D scissor{};
|
||||
scissor.extent.width = dim;
|
||||
|
@ -1497,7 +1503,7 @@ PlumageRender::PlumageRender()
|
|||
|
||||
if (settings.rotateModel)
|
||||
{
|
||||
shaderDataScene.model = glm::mat4(1.0f);
|
||||
//shaderDataScene.model = glm::mat4(1.0f);
|
||||
shaderDataScene.model = glm::rotate(shaderDataScene.model, glm::radians(modelrot), glm::vec3(0, 1, 0));
|
||||
}
|
||||
|
||||
|
@ -1971,11 +1977,11 @@ PlumageRender::PlumageRender()
|
|||
//outputImageSequeue(swapChainImage,filePath.imageSequenceFilePath);
|
||||
|
||||
|
||||
outputImageSequence();
|
||||
//outputImageSequence();
|
||||
|
||||
VK_CHECK_RESULT(vkWaitForFences(device, 1, &waitFences[frameIndex], VK_TRUE, UINT64_MAX));
|
||||
|
||||
imageSequenceToVideo();
|
||||
//imageSequenceToVideo();
|
||||
VK_CHECK_RESULT(vkResetFences(device, 1, &waitFences[frameIndex]));
|
||||
|
||||
VkResult acquire = swapChain.acquireNextImage(presentCompleteSemaphores[frameIndex], ¤tBuffer);
|
||||
|
@ -2131,6 +2137,9 @@ PlumageRender::PlumageRender()
|
|||
setupDescriptors();
|
||||
updateCBs = true;
|
||||
}
|
||||
if (gui->checkbox("模型自转", &settings.rotateModel)) {
|
||||
updateShaderParams = true;
|
||||
}
|
||||
if (gui->checkbox(chineseUI.environmentBackGround, &displayBackground)) {
|
||||
updateShaderParams = true;
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ public:
|
|||
|
||||
struct FilePath
|
||||
{ //model path
|
||||
std::string glTFModelFilePath = getAssetPath() + "models/sauvage_perfume.glb";
|
||||
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";
|
||||
|
||||
|
@ -174,7 +174,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/kloofendal_43d_clear_puresky_hdr16f_cube.ktx";
|
||||
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";
|
||||
|
|
Loading…
Reference in New Issue