Merge branch 'main' of github.com:TheRedShip/RT_GPU

This commit is contained in:
TheRedShip
2025-01-10 23:08:50 +01:00
8 changed files with 178 additions and 178 deletions

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 18:30:18 by ycontre #+# #+# */
/* Updated: 2024/12/23 18:46:13 by ycontre ### ########.fr */
/* Updated: 2025/01/10 18:58:38 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
@ -59,7 +59,7 @@ class Scene
void updateGPUData();
const std::vector<GPUObject> &getObjectData() const;
const std::vector<GPUMaterial> &getMaterialData() const;
std::vector<GPUMaterial> &getMaterialData();
Camera *getCamera(void) const;
Material *getMaterial(int material_index);

View File

@ -20,5 +20,5 @@ pl -3 0 0 1 0 0 3
pl 0 0 -3 0 0 1 4
pl 0 0 3 0 0 -1 2
po -0.33 -0.66 -1 0 1 0 0.5 0.5 0 0 2
po -0.33 -0.66 -1 0 1 0 0.5 0.5 -0.5 0 2
po -0.5 -0.5 1 0 1 0 1 0 0 1 4

View File

@ -1,8 +1,8 @@
CAM -0.0970577 1.63916 1.69444 -13.6 -84 0 1
CAM -0.0970577 1.63916 1.69444 -13.6 -84 0 4
MAT 200 200 200 0.0 0.0 0.0 //white
MAT 255 50 50 0.0 1.0 0.0 //red
MAT 255 50 50 0.0 1.0 1.0 //red
MAT 50 255 50 0.0 0.0 0.0 //green
MAT 100 100 255 0.0 0.0 0.0 //blue
MAT 255 100 255 0.0 0.0 0.0 //purple

View File

@ -38,17 +38,17 @@ struct GPUCamera
float focus_distance;
};
layout(std430, binding = 1) buffer ObjectBuffer
layout(std430, binding = 0) buffer ObjectBuffer
{
GPUObject objects[];
};
layout(std430, binding = 2) buffer MaterialBuffer
layout(std430, binding = 1) buffer MaterialBuffer
{
GPUMaterial materials[];
};
layout(std140) uniform CameraData
layout(std140, binding = 0) uniform CameraData
{
GPUCamera camera;
};

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/27 14:51:49 by TheRed #+# #+# */
/* Updated: 2025/01/09 16:17:29 by tomoron ### ########.fr */
/* Updated: 2025/01/10 19:12:40 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 18:29:41 by ycontre #+# #+# */
/* Updated: 2025/01/08 20:08:03 by ycontre ### ########.fr */
/* Updated: 2025/01/10 18:58:57 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
@ -153,7 +153,7 @@ const std::vector<GPUObject>& Scene::getObjectData() const
return (_gpu_objects);
}
const std::vector<GPUMaterial>& Scene::getMaterialData() const
std::vector<GPUMaterial>& Scene::getMaterialData()
{
return (_gpu_materials);
}

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/13 20:21:13 by ycontre #+# #+# */
/* Updated: 2024/10/14 19:52:40 by ycontre ### ########.fr */
/* Updated: 2025/01/10 18:53:39 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */