~ | Working Toplevel bvh for untransformed obj

This commit is contained in:
TheRedShip
2025-01-22 23:46:27 +01:00
parent cd65cff03f
commit bdcafaf4f0
10 changed files with 1183 additions and 146 deletions

View File

@ -20,8 +20,8 @@ int main(int argc, char **argv)
return (1);
Window window(&scene, WIDTH, HEIGHT, "RT_GPU", 0);
// Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/compute.glsl");
Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/debug.glsl");
Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/compute.glsl");
// Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/debug.glsl");
GLint max_gpu_size;
glGetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &max_gpu_size);

View File

@ -33,8 +33,8 @@ void TopBVH::updateBounds(std::vector<GPUBvhData> &bvhs_data, std::vector<GPUBvh
GPUBvhData bvh_data = bvhs_data[_first_bvh + i];
GPUBvh root_bvh = bvhs[bvh_data.bvh_start_index];
glm::vec3 min = root_bvh.min - bvh_data.offset;
glm::vec3 max = root_bvh.max - bvh_data.offset;
glm::vec3 min = root_bvh.min + bvh_data.offset;
glm::vec3 max = root_bvh.max + bvh_data.offset;
_aabb.min = glm::min(_aabb.min, min);
_aabb.max = glm::max(_aabb.max, max);