mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
~ | dfghjkl
This commit is contained in:
@ -7,7 +7,7 @@ Pos=1646,5
|
|||||||
Size=259,200
|
Size=259,200
|
||||||
|
|
||||||
[Window][Material]
|
[Window][Material]
|
||||||
Pos=1648,207
|
Pos=1646,209
|
||||||
Size=266,299
|
Size=266,299
|
||||||
|
|
||||||
[Window][Fog settings]
|
[Window][Fog settings]
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/12/23 18:30:18 by ycontre #+# #+# */
|
/* 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
2008748
obj/Dragon_800K.obj
Normal file
File diff suppressed because it is too large
Load Diff
@ -26,5 +26,5 @@ qu -1 1.999 -1 2 0 0 0 0 2 6
|
|||||||
|
|
||||||
OBJ obj/Dragon_800K.obj
|
OBJ obj/Dragon_800K.obj
|
||||||
|
|
||||||
# po -1.99 -0.5 -0.5 0 1 0 0 0 1 1 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
|
po -0.5 -0.5 -1.99 0 1 0 1 0 0 0 4
|
||||||
|
@ -80,7 +80,7 @@ struct GPUBvh
|
|||||||
int first_primitive;
|
int first_primitive;
|
||||||
int primitive_count;
|
int primitive_count;
|
||||||
};
|
};
|
||||||
layout(std430, binding = 5) buffer BvhBuffer
|
layout(std430, binding = 3) buffer BvhBuffer
|
||||||
{
|
{
|
||||||
GPUBvh bvh[];
|
GPUBvh bvh[];
|
||||||
};
|
};
|
||||||
|
@ -130,10 +130,11 @@ hitInfo traceRay(Ray ray)
|
|||||||
hitScene = traceScene(ray);
|
hitScene = traceScene(ray);
|
||||||
|
|
||||||
hit = hitBVH.t < hitScene.t ? hitBVH : hitScene;
|
hit = hitBVH.t < hitScene.t ? hitBVH : hitScene;
|
||||||
#if 0
|
#if 1
|
||||||
if (hit.obj_index == -1 || objects[hit.obj_index].type != 5)
|
if (hit.obj_index == -1 || objects[hit.obj_index].type != 5)
|
||||||
break ;
|
break ;
|
||||||
ray = portalRay(ray, hit);
|
ray = portalRay(ray, hit);
|
||||||
|
ray.inv_direction = (1.0 / ray.direction);
|
||||||
#else
|
#else
|
||||||
return (hit);
|
return (hit);
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/09/27 14:51:49 by TheRed #+# #+# */
|
/* 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 */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/01/16 21:48:48 by TheRed #+# #+# */
|
/* 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 left_count = 0;
|
||||||
int right_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];
|
GPUTriangle triangle = primitives[_first_primitive + i];
|
||||||
glm::vec3 centroid = (triangle.position + triangle.vertex1 + triangle.vertex2) / 3.0f;
|
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)
|
if (_primitive_count <= 4)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
glm::vec3 extent = _aabb.max - _aabb.min;
|
|
||||||
|
|
||||||
const int num_test_per_axis = 5;
|
const int num_test_per_axis = 5;
|
||||||
|
|
||||||
int best_axis = 0;
|
int best_axis = 0;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/13 20:21:13 by ycontre #+# #+# */
|
/* 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 *fragmentCode = loadFileWithIncludes(fragmentPath);
|
||||||
const char *computeCode = loadFileWithIncludes(computePath);
|
const char *computeCode = loadFileWithIncludes(computePath);
|
||||||
|
|
||||||
// printWithLineNumbers(computeCode);
|
printWithLineNumbers(computeCode);
|
||||||
|
|
||||||
_vertex = glCreateShader(GL_VERTEX_SHADER);
|
_vertex = glCreateShader(GL_VERTEX_SHADER);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user