replace template image with pointset

This commit is contained in:
CDaut 2024-07-09 21:22:43 +02:00
parent 1114f4c8ff
commit 2852bf13d6
Signed by: clara
GPG key ID: 223391B52FAD4463

View file

@ -348,7 +348,7 @@ void HelloVulkan::createPointsetImage(const VkCommandBuffer& cmdBuf)
//generate blue noise points //generate blue noise points
const int npoints = 256; //points.size() / NCHANNELS; const int npoints = 16384; //points.size() / NCHANNELS;
utk::CustomHeckSampler sampler(0.606f, 8.f, 0.5); utk::CustomHeckSampler sampler(0.606f, 8.f, 0.5);
auto pointset = utk::Pointset<float>{}; auto pointset = utk::Pointset<float>{};
std::cout << std::endl << "generating " << npoints << " blue noise points…" << std::endl; std::cout << std::endl << "generating " << npoints << " blue noise points…" << std::endl;
@ -356,7 +356,6 @@ void HelloVulkan::createPointsetImage(const VkCommandBuffer& cmdBuf)
utk::write_text_pointset("biig_pointset.txt", pointset); utk::write_text_pointset("biig_pointset.txt", pointset);
/*
//iterate pointset and fill texture //iterate pointset and fill texture
for(int i = 0; i < pointset.Npts(); ++i) for(int i = 0; i < pointset.Npts(); ++i)
{ {
@ -367,15 +366,6 @@ void HelloVulkan::createPointsetImage(const VkCommandBuffer& cmdBuf)
points[wholex + wholey * m_size.width] = vec2{fractionalx, fractionaly}; points[wholex + wholey * m_size.width] = vec2{fractionalx, fractionaly};
} }
*/
for(int y = 0; y < m_size.height; ++y)
{
for(int x = 0; x < m_size.width; ++x)
{
points[x + y * m_size.width] = vec2{static_cast<float_t>(x) / static_cast<float_t>(m_size.width), static_cast<float_t>(y) / static_cast<float_t>(m_size.height)};
}
}
m_pointsetBuffer = m_alloc.createBuffer(cmdBuf, sizeof(glm::vec2) * points.size(), points.data(), 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); VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT);