reconstruct dependency to device.hpp
parent
a8fe5397c2
commit
14f0b51c75
|
@ -12,7 +12,7 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "vulkan/vulkan.h"
|
#include "vulkan/vulkan.h"
|
||||||
#include "VulkanDevice.h"
|
#include "VulkanDevice.hpp"
|
||||||
#include "VulkanTools.h"
|
#include "VulkanTools.h"
|
||||||
|
|
||||||
namespace vks
|
namespace vks
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
#include "vulkan/vulkan.h"
|
#include "vulkan/vulkan.h"
|
||||||
#include "VulkanDevice.h"
|
#include "VulkanDevice.hpp"
|
||||||
#include "VulkanBuffer.h"
|
#include "VulkanBuffer.h"
|
||||||
#include <ktx.h>
|
#include <ktx.h>
|
||||||
#include <ktxvulkan.h>
|
#include <ktxvulkan.h>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "vulkan/vulkan.h"
|
#include "vulkan/vulkan.h"
|
||||||
#include "vulkanexamplebase.h"
|
#include "vulkanexamplebase.h"
|
||||||
#include "VulkanTools.h"
|
#include "VulkanTools.h"
|
||||||
#include "VulkanDevice.h"
|
#include "VulkanDevice.hpp"
|
||||||
|
|
||||||
class VulkanRaytracingSample : public VulkanExampleBase
|
class VulkanRaytracingSample : public VulkanExampleBase
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <ktxvulkan.h>
|
#include <ktxvulkan.h>
|
||||||
|
|
||||||
#include "VulkanBuffer.h"
|
#include "VulkanBuffer.h"
|
||||||
#include "VulkanDevice.h"
|
#include "VulkanDevice.hpp"
|
||||||
#include "VulkanTools.h"
|
#include "VulkanTools.h"
|
||||||
|
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "VulkanTools.h"
|
#include "VulkanTools.h"
|
||||||
#include "VulkanDebug.h"
|
#include "VulkanDebug.h"
|
||||||
#include "VulkanBuffer.h"
|
#include "VulkanBuffer.h"
|
||||||
#include "VulkanDevice.h"
|
#include "VulkanDevice.hpp"
|
||||||
|
|
||||||
#include "../external/imgui/imgui.h"
|
#include "../external/imgui/imgui.h"
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "vulkan/vulkan.h"
|
#include "vulkan/vulkan.h"
|
||||||
#include "VulkanDevice.h"
|
#include "VulkanDevice.hpp"
|
||||||
|
|
||||||
#include <ktx.h>
|
#include <ktx.h>
|
||||||
#include <ktxvulkan.h>
|
#include <ktxvulkan.h>
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
#include "VulkanUIOverlay.h"
|
#include "VulkanUIOverlay.h"
|
||||||
#include "VulkanSwapChain.h"
|
#include "VulkanSwapChain.h"
|
||||||
#include "VulkanBuffer.h"
|
#include "VulkanBuffer.h"
|
||||||
#include "VulkanDevice.h"
|
#include "VulkanDevice.hpp"
|
||||||
#include "VulkanTexture.h"
|
#include "VulkanTexture.h"
|
||||||
|
|
||||||
#include "VulkanInitializers.hpp"
|
#include "VulkanInitializers.hpp"
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
#include "assetLoader.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void assetLoader::readDirectory(const std::string& directory, const std::string& pattern, std::map<std::string, std::string>& filelist, bool recursive)
|
||||||
|
{
|
||||||
|
std::string searchpattern(directory + "/" + pattern);
|
||||||
|
WIN32_FIND_DATA data;
|
||||||
|
HANDLE hFind;
|
||||||
|
if ((hFind = FindFirstFile(searchpattern.c_str(), &data)) != INVALID_HANDLE_VALUE) {
|
||||||
|
do {
|
||||||
|
std::string filename(data.cFileName);
|
||||||
|
filename.erase(filename.find_last_of("."), std::string::npos);
|
||||||
|
filelist[filename] = directory + "/" + data.cFileName;
|
||||||
|
} while (FindNextFile(hFind, &data) != 0);
|
||||||
|
FindClose(hFind);
|
||||||
|
}
|
||||||
|
if (recursive) {
|
||||||
|
std::string dirpattern = directory + "/*";
|
||||||
|
if ((hFind = FindFirstFile(dirpattern.c_str(), &data)) != INVALID_HANDLE_VALUE) {
|
||||||
|
do {
|
||||||
|
if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
||||||
|
char subdir[MAX_PATH];
|
||||||
|
strcpy(subdir, directory.c_str());
|
||||||
|
strcat(subdir, "/");
|
||||||
|
strcat(subdir, data.cFileName);
|
||||||
|
if ((strcmp(data.cFileName, ".") != 0) && (strcmp(data.cFileName, "..") != 0)) {
|
||||||
|
readDirectory(subdir, pattern, filelist, recursive);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (FindNextFile(hFind, &data) != 0);
|
||||||
|
FindClose(hFind);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
#include "vulkan/vulkan.h"
|
||||||
|
#include "VulkanDevice.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace assetLoader
|
||||||
|
{
|
||||||
|
|
||||||
|
void readDirectory(const std::string& directory, const std::string& pattern, std::map<std::string, std::string>& filelist, bool recursive);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "tiny_gltf.h"
|
#include "tiny_gltf.h"
|
||||||
#include "VulkanDevice.h"
|
#include "VulkanDevice.hpp"
|
||||||
#include "vulkan/vulkan.h"
|
#include "vulkan/vulkan.h"
|
||||||
|
|
||||||
#define ENABLE_VALIDATION false
|
#define ENABLE_VALIDATION false
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,14 +7,14 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include<io.h>
|
||||||
#include "algorithm"
|
#include "algorithm"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <vulkan/vulkan.h>
|
#include <vulkan/vulkan.h>
|
||||||
#include "vulkanexamplebase.h"
|
#include "VulkanExampleBase.h"
|
||||||
#include "glTFModel.h"
|
#include "glTFModel.h"
|
||||||
|
//#include "VulkanDevice.hpp"
|
||||||
|
|
||||||
|
|
||||||
#define ENABLE_VALIDATION false
|
#define ENABLE_VALIDATION false
|
||||||
|
@ -29,6 +29,12 @@ public:
|
||||||
bool ToneMapping = true;
|
bool ToneMapping = true;
|
||||||
bool pbrEnabled = true;
|
bool pbrEnabled = true;
|
||||||
|
|
||||||
|
struct stat
|
||||||
|
{
|
||||||
|
|
||||||
|
} info ;
|
||||||
|
|
||||||
|
|
||||||
struct Models
|
struct Models
|
||||||
{
|
{
|
||||||
glTFModel::Model scene;
|
glTFModel::Model scene;
|
||||||
|
@ -84,22 +90,36 @@ public:
|
||||||
} pushConstBlockMaterial;
|
} pushConstBlockMaterial;
|
||||||
|
|
||||||
struct FilePath
|
struct FilePath
|
||||||
{
|
{ //model path
|
||||||
std::string glTFModelFilePath = getAssetPath() + "buster_drone/busterDrone.gltf";
|
std::string glTFModelFilePath = getAssetPath() + "DamagedHelmet.gltf";
|
||||||
std::string skyboxModleFilePath = getAssetPath() + "models/cube.gltf";
|
|
||||||
std::string iblTexturesFilePath = getAssetPath() + "textures/hdr/pisa_cube.ktx";
|
|
||||||
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";
|
||||||
|
|
||||||
|
// 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/pisa_cube.ktx";
|
||||||
|
//tonemapping
|
||||||
std::string tonemappingVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/genbrdflut.vert.spv";
|
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 tonemappingEnableFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/tonemapping_enable.frag.spv";
|
||||||
std::string tonemappingDisableFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/tonemapping_disable.frag.spv";
|
std::string tonemappingDisableFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/tonemapping_disable.frag.spv";
|
||||||
std::string irradianceVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/filtercube.vert.spv";
|
|
||||||
std::string irradianceFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/irradiancecube.frag.spv";
|
|
||||||
std::string prefilterVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/filtercube.vert.spv";
|
// cube map
|
||||||
std::string prefilterFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/prefilterenvmap.frag.spv";
|
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() + "buster_drone/shaders/glsl/genbrdflut.vert.spv";
|
std::string brdfVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/genbrdflut.vert.spv";
|
||||||
std::string brdfFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/genbrdflut.frag.spv";
|
std::string brdfFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/genbrdflut.frag.spv";
|
||||||
|
// environment map texture
|
||||||
|
std::string envMapFilePath = getAssetPath() + "environments/papermill.ktx";
|
||||||
|
|
||||||
|
// pbr shader
|
||||||
|
std::string pbrVertShaderPath = getAssetPath() + "shaders/pbr.vert.spv";
|
||||||
|
std::string pbrFragShaderPath = getAssetPath() + "shaders/pbr_khr.frag.spv";
|
||||||
|
|
||||||
} filePath;
|
} filePath;
|
||||||
|
|
||||||
|
@ -188,8 +208,8 @@ public:
|
||||||
} lightSource;
|
} lightSource;
|
||||||
|
|
||||||
|
|
||||||
|
//cube map generation
|
||||||
|
|
||||||
/*
|
|
||||||
struct OffScreen
|
struct OffScreen
|
||||||
{
|
{
|
||||||
VkImage image;
|
VkImage image;
|
||||||
|
@ -197,7 +217,7 @@ public:
|
||||||
VkDeviceMemory memory;
|
VkDeviceMemory memory;
|
||||||
VkFramebuffer framebuffer;
|
VkFramebuffer framebuffer;
|
||||||
} offscreen;
|
} offscreen;
|
||||||
*/
|
|
||||||
struct IrradiancePushBlock
|
struct IrradiancePushBlock
|
||||||
{
|
{
|
||||||
glm::mat4 mvp;
|
glm::mat4 mvp;
|
||||||
|
@ -259,11 +279,11 @@ public:
|
||||||
void loadEnvironment(std::string filename);
|
void loadEnvironment(std::string filename);
|
||||||
void buildCommandBuffers();
|
void buildCommandBuffers();
|
||||||
void loadAssets();
|
void loadAssets();
|
||||||
void setupDescriptors();
|
void setupNodeDescriptorSet(glTFModel::Node* node);
|
||||||
|
void setupDescriptors();
|
||||||
void preparePipelines();
|
void preparePipelines();
|
||||||
void CreateToneMappingPipeline();
|
void CreateToneMappingPipeline();
|
||||||
void GenerateIrradianceCubemap();
|
void generateCubemaps();
|
||||||
void GeneratePrefilteredCubemap();
|
|
||||||
void GenerateBRDFLUT();
|
void GenerateBRDFLUT();
|
||||||
void prepareUniformBuffers();
|
void prepareUniformBuffers();
|
||||||
void updateUniformBuffers();
|
void updateUniformBuffers();
|
||||||
|
|
Loading…
Reference in New Issue