fix spacebar bug, fix ios depth buffer error, parallelize raytracing
This commit is contained in:
@@ -281,7 +281,14 @@ void NodePanelGrid::bake_uvs()
|
||||
auto light_dir = glm::normalize(light_pos);
|
||||
|
||||
auto data_out = std::make_unique<uint8_t[]>(fb.getWidth() * fb.getHeight() * 4);
|
||||
#if _WIN32
|
||||
concurrency::parallel_for(int(0), fb.getHeight(), [&](int y)
|
||||
#elif __IOS__ || __OSX__
|
||||
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
|
||||
dispatch_apply(count, queue, ^(size_t i)
|
||||
#else
|
||||
for (int y = 0; y < fb.getHeight(); y++)
|
||||
#endif
|
||||
{
|
||||
for (int x = 0; x < fb.getWidth(); x++)
|
||||
{
|
||||
@@ -321,6 +328,9 @@ void NodePanelGrid::bake_uvs()
|
||||
}
|
||||
}
|
||||
}
|
||||
#if _WIN32 || __IOS__ || __OSX__
|
||||
);
|
||||
#endif
|
||||
//stbi_write_jpg("bake-out.jpg", fb.getWidth(), fb.getHeight(), 4, data_out.get(), 75);
|
||||
m_texture.update(data_out.get());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user