collect result images
This commit is contained in:
parent
7250fe1dd0
commit
3300437294
343 changed files with 536 additions and 151 deletions
|
|
@ -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,34 +342,35 @@ 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));
|
||||
|
||||
|
||||
//generate blue noise points
|
||||
// const int npoints = 16384;
|
||||
// utk::CustomHeckSampler sampler(0.606f, 8.f, 0.3, true);
|
||||
// auto pointset = utk::Pointset<float>{};
|
||||
// std::cout << std::endl << "generating " << npoints << " blue noise points…" << std::endl;
|
||||
// sampler.generateSamples(pointset, npoints);
|
||||
//
|
||||
// utk::write_text_pointset("pointset_16384_tc_0.3_0.00002f.txt", pointset);
|
||||
// const int npoints = 16384;
|
||||
// utk::CustomHeckSampler sampler(0.606f, 8.f, 0.3, true);
|
||||
// auto pointset = utk::Pointset<float>{};
|
||||
// std::cout << std::endl << "generating " << npoints << " blue noise points…" << std::endl;
|
||||
// sampler.generateSamples(pointset, npoints);
|
||||
//
|
||||
// utk::write_text_pointset("pointset_16384_tc_0.3_0.00002f.txt", pointset);
|
||||
|
||||
//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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue