more data generation
This commit is contained in:
parent
7a0f86c425
commit
7250fe1dd0
698 changed files with 248864 additions and 273 deletions
|
|
@ -349,27 +349,27 @@ void HelloVulkan::createPointsetImage(const VkCommandBuffer& cmdBuf)
|
|||
|
||||
|
||||
//generate blue noise points
|
||||
/*const int npoints = 262144;
|
||||
utk::CustomHeckSampler sampler(0.606f, 8.f, 0.5);
|
||||
auto pointset = utk::Pointset<float>{};
|
||||
std::cout << std::endl << "generating " << npoints << " blue noise points…" << std::endl;
|
||||
sampler.generateSamples(pointset, npoints);
|
||||
// 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);
|
||||
|
||||
utk::write_text_pointset("pointset_262144.txt", pointset);
|
||||
*/
|
||||
//load huge pointset
|
||||
auto pointset = utk::read_text_pointset<long double>("pointset_262144.txt")[0];
|
||||
//auto pointset = utk::read_text_pointset<long double>("pointset_16384_tc_0.3_0.00002f.txt")[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