~ | 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

0
fps.txt Normal file
View File

View File

@ -7,7 +7,7 @@ Pos=1646,5
Size=259,200
[Window][Material]
Pos=1648,207
Pos=1646,209
Size=266,299
[Window][Fog settings]

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 18:30:18 by ycontre #+# #+# */
/* Updated: 2025/01/15 18:58:12 by ycontre ### ########.fr */
/* Updated: 2025/01/19 18:46:38 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */

2008748
obj/Dragon_800K.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@ -26,5 +26,5 @@ qu -1 1.999 -1 2 0 0 0 0 2 6
OBJ obj/Dragon_800K.obj
# po -1.99 -0.5 -0.5 0 1 0 0 0 1 1 4
# po -0.5 -0.5 -1.99 0 1 0 1 0 0 0 4
po -1.99 -0.5 -0.5 0 1 0 0 0 1 1 4
po -0.5 -0.5 -1.99 0 1 0 1 0 0 0 4

View File

@ -80,7 +80,7 @@ struct GPUBvh
int first_primitive;
int primitive_count;
};
layout(std430, binding = 5) buffer BvhBuffer
layout(std430, binding = 3) buffer BvhBuffer
{
GPUBvh bvh[];
};

View File

@ -130,10 +130,11 @@ hitInfo traceRay(Ray ray)
hitScene = traceScene(ray);
hit = hitBVH.t < hitScene.t ? hitBVH : hitScene;
#if 0
#if 1
if (hit.obj_index == -1 || objects[hit.obj_index].type != 5)
break ;
ray = portalRay(ray, hit);
ray.inv_direction = (1.0 / ray.direction);
#else
return (hit);
#endif

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/27 14:51:49 by TheRed #+# #+# */
/* Updated: 2025/01/18 21:10:23 by ycontre ### ########.fr */
/* Updated: 2025/01/19 19:05:44 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */

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);