collect result images
2
.idea/.name
generated
|
|
@ -1 +1 @@
|
|||
UnicornTK
|
||||
vk_raytracing_tutorial
|
||||
2
.idea/misc.xml
generated
|
|
@ -3,7 +3,7 @@
|
|||
<component name="CMakePythonSetting">
|
||||
<option name="pythonIntegrationState" value="YES" />
|
||||
</component>
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/utk_experiments/utk">
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$/raytracer">
|
||||
<contentRoot DIR="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="CidrRootsConfiguration">
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@
|
|||
"name":"Camera",
|
||||
"rotation":[
|
||||
0,
|
||||
0.7071068286895752,
|
||||
0.7071067094802856,
|
||||
0,
|
||||
0.7071068286895752
|
||||
],
|
||||
"translation":[
|
||||
15,
|
||||
0,
|
||||
0
|
||||
5.538400650024414,
|
||||
2.8199868202209473,
|
||||
-2.0413269996643066
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ protected:
|
|||
|
||||
// Other
|
||||
bool m_showHelp{false}; // Show help, pressing
|
||||
bool m_show_gui{true};
|
||||
bool m_show_gui{false};
|
||||
bool m_useDynamicRendering{false}; // Using VK_KHR_dynamic_rendering
|
||||
float m_sceneRadius{1.f};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ void HelloVulkan::createGraphicsPipeline()
|
|||
//--------------------------------------------------------------------------------------------------
|
||||
// Loading the OBJ file and setting up all buffers
|
||||
//
|
||||
void HelloVulkan::loadScene(const std::string& filename)
|
||||
void HelloVulkan::loadScene(const std::string& filename, const std::string &pointset_path)
|
||||
{
|
||||
using vkBU = VkBufferUsageFlagBits;
|
||||
tinygltf::Model tmodel;
|
||||
|
|
@ -261,7 +261,7 @@ void HelloVulkan::loadScene(const std::string& filename)
|
|||
// Creates all textures found
|
||||
createTextureImages(cmdBuf, tmodel);
|
||||
//generate and submit pointset
|
||||
createPointsetImage(cmdBuf);
|
||||
createPointsetImage(cmdBuf, pointset_path);
|
||||
cmdBufGet.submitAndWait(cmdBuf);
|
||||
m_alloc.finalizeAndReleaseStaging();
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ void HelloVulkan::createTextureImages(const VkCommandBuffer& cmdBuf, tinygltf::M
|
|||
}
|
||||
}
|
||||
|
||||
void HelloVulkan::createPointsetImage(const VkCommandBuffer& cmdBuf)
|
||||
void HelloVulkan::createPointsetImage(const VkCommandBuffer& cmdBuf, const std::string& pointset_path)
|
||||
{
|
||||
//load pointset instead of generating it
|
||||
std::vector<vec2> points(m_size.height * m_size.width, vec2(0.f));
|
||||
|
|
@ -359,17 +359,18 @@ void HelloVulkan::createPointsetImage(const VkCommandBuffer& cmdBuf)
|
|||
|
||||
//load huge pointset
|
||||
//auto pointset = utk::read_text_pointset<long double>("pointset_16384_tc_0.3_0.00002f.txt")[0];
|
||||
auto pointset = utk::read_text_pointset<long double>(pointset_path.c_str())[0];
|
||||
|
||||
//iterate pointset and fill texture
|
||||
// for(int i = 0; i < pointset.Npts(); ++i)
|
||||
// {
|
||||
// auto point = std::make_pair(pointset[i][0] * (m_size.width - 1), pointset[i][1] * ((m_size.height) - 1));
|
||||
// float_t wholex, wholey, fractionalx, fractionaly;
|
||||
// fractionalx = std::modf(point.first, &wholex);
|
||||
// fractionaly = std::modf(point.second, &wholey);
|
||||
//
|
||||
// points[wholex + wholey * m_size.width] = vec2{fractionalx, fractionaly};
|
||||
// }
|
||||
for(int i = 0; i < pointset.Npts(); ++i)
|
||||
{
|
||||
auto point = std::make_pair(pointset[i][0] * (m_size.width - 1), pointset[i][1] * ((m_size.height) - 1));
|
||||
float_t wholex, wholey, fractionalx, fractionaly;
|
||||
fractionalx = std::modf(point.first, &wholex);
|
||||
fractionaly = std::modf(point.second, &wholey);
|
||||
|
||||
points[wholex + wholey * m_size.width] = vec2{fractionalx, fractionaly};
|
||||
}
|
||||
|
||||
m_pointsetBuffer = m_alloc.createBuffer(cmdBuf, sizeof(glm::vec2) * points.size(), points.data(),
|
||||
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT);
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ public:
|
|||
void setup(const VkInstance& instance, const VkDevice& device, const VkPhysicalDevice& physicalDevice, uint32_t queueFamily) override;
|
||||
void createDescriptorSetLayout();
|
||||
void createGraphicsPipeline();
|
||||
void loadScene(const std::string& filename);
|
||||
void loadScene(const std::string& filename, const std::string &pointset_path);
|
||||
void updateDescriptorSet();
|
||||
void createUniformBuffer();
|
||||
void createTextureImages(const VkCommandBuffer& cmdBuf, tinygltf::Model& gltfModel);
|
||||
void createPointsetImage(const VkCommandBuffer& cmdBuf);
|
||||
void createPointsetImage(const VkCommandBuffer& cmdBuf, const std::string &pointset_image);
|
||||
void updateUniformBuffer(const VkCommandBuffer& cmdBuf);
|
||||
void onResize(int /*w*/, int /*h*/) override;
|
||||
void destroyResources();
|
||||
|
|
@ -69,10 +69,10 @@ public:
|
|||
// Information pushed at each draw call
|
||||
PushConstantRaster m_pcRaster{
|
||||
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, // Identity matrix
|
||||
{0.f, 100.f, 0.f}, // light position
|
||||
{0.f, 1.f, 0.f}, // light position
|
||||
0, // instance Id
|
||||
1000.f, // light intensity
|
||||
0, // light type
|
||||
1.f, // light intensity
|
||||
1, // light type
|
||||
0 // material id
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
// at the top of imgui.cpp.
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include "backends/imgui_impl_glfw.h"
|
||||
|
|
@ -160,7 +161,8 @@ int main(int argc, char** argv)
|
|||
|
||||
// Creation of the example
|
||||
//FIXME: HERE WE CAN LOAD THE SCENE
|
||||
helloVk.loadScene(nvh::findFile("media/scenes/grid.gltf", defaultSearchPaths, true));
|
||||
std::cout << "Using pointset " << argv[1] << std::endl;
|
||||
helloVk.loadScene(nvh::findFile("media/scenes/lumberyard.gltf", defaultSearchPaths, true), argv[1]);
|
||||
|
||||
// Setup camera
|
||||
CameraManip.setWindowSize(SAMPLE_WIDTH, SAMPLE_HEIGHT);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,100 @@
|
|||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.560
|
||||
0.560
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.560
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
0.565
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
0.555
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.550
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.555
|
||||
0.560
|
||||
0.555
|
||||
0.555
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.555
|
||||
0.550
|
||||
0.555
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.550
|
||||
0.555
|
||||
0.555
|
||||
0.560
|
||||
0.555
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.550
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.550
|
||||
0.550
|
||||
0.560
|
||||
0.555
|
||||
0.555
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.560
|
||||
0.545
|
||||
0.555
|
||||
0.555
|
||||
0.560
|
||||
0.555
|
||||
0.555
|
||||
0.560
|
||||
BIN
utk_experiments/result_data/result_images/bistro/converged.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 28 KiB |
BIN
utk_experiments/result_data/result_images/grid/converged.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 4 KiB |
|
After Width: | Height: | Size: 4 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 4 KiB |
|
After Width: | Height: | Size: 4 KiB |