Basic GUI

This commit is contained in:
Dynamitos
2025-01-24 23:20:30 +01:00
parent 8af00e2510
commit cfefb125c8
9 changed files with 64 additions and 8 deletions
+8
View File
@@ -5,6 +5,10 @@
void BVH::addModel(PModel model, glm::mat4 transform)
{
model->boundingBox.transform(transform);
for (auto& point : model->positions)
{
point = glm::vec3(transform * glm::vec4(point, 1));
}
models.push_back(std::move(model));
}
@@ -13,6 +17,10 @@ void BVH::addModels(std::vector<PModel> _models, glm::mat4 transform)
for (int i = 0; i < _models.size(); ++i)
{
_models[i]->boundingBox.transform(transform);
for (auto& point : _models[i]->positions)
{
point = glm::vec3(transform * glm::vec4(point, 1));
}
models.push_back(std::move(_models[i]));
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ void Scene::render(Camera cam, RenderParameter params)
image.resize(params.width * params.height);
accumulator.resize(params.width * params.height);
worker = std::thread(
[&]()
[&, cam, params]()
{
for (int samp = 0; samp < params.numSamples; ++samp)
{