~ | dfghjkl

This commit is contained in:
RedShip
2025-01-19 20:04:59 +01:00
parent 0ae411d8ea
commit d7bf46e76e
11 changed files with 2008761 additions and 14 deletions

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/16 21:48:48 by TheRed #+# #+# */
/* Updated: 2025/01/18 21:11:35 by ycontre ### ########.fr */
/* Updated: 2025/01/19 18:30:27 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
@ -53,7 +53,7 @@ float BVH::evaluateSah(std::vector<GPUTriangle> &primitives, int axis, float pos
int left_count = 0;
int right_count = 0;
for (unsigned int i = 0; i < _primitive_count; i++)
for (int i = 0; i < _primitive_count; i++)
{
GPUTriangle triangle = primitives[_first_primitive + i];
glm::vec3 centroid = (triangle.position + triangle.vertex1 + triangle.vertex2) / 3.0f;
@ -84,8 +84,6 @@ void BVH::subdivide(std::vector<GPUTriangle> &primitives)
if (_primitive_count <= 4)
return ;
glm::vec3 extent = _aabb.max - _aabb.min;
const int num_test_per_axis = 5;
int best_axis = 0;

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/13 20:21:13 by ycontre #+# #+# */
/* Updated: 2025/01/18 19:08:58 by ycontre ### ########.fr */
/* Updated: 2025/01/19 18:58:42 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
@ -67,7 +67,7 @@ Shader::Shader(std::string vertexPath, std::string fragmentPath, std::string com
const char *fragmentCode = loadFileWithIncludes(fragmentPath);
const char *computeCode = loadFileWithIncludes(computePath);
// printWithLineNumbers(computeCode);
printWithLineNumbers(computeCode);
_vertex = glCreateShader(GL_VERTEX_SHADER);