Merge remote-tracking branch 'origin/Denoising'

This commit is contained in:
TheRedShip
2025-02-09 17:12:04 +01:00
16 changed files with 270 additions and 46 deletions

View File

@ -78,6 +78,15 @@ struct GPUDebug
int box_treshold;
};
struct GPUDenoise
{
int enabled;
int pass;
float c_phi;
float p_phi;
float n_phi;
};
struct GPUBvh
{
alignas(16) glm::vec3 min;
@ -135,6 +144,7 @@ class Scene
GPUVolume &getVolume();
GPUDebug &getDebug();
GPUDenoise &getDenoise();
Camera *getCamera(void) const;
GPUMaterial getMaterial(int material_index);
@ -162,6 +172,7 @@ class Scene
GPUVolume _gpu_volume;
GPUDebug _gpu_debug;
GPUDenoise _gpu_denoise;
Camera *_camera;
};

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/13 18:10:10 by TheRed #+# #+# */
/* Updated: 2025/01/30 22:27:43 by tomoron ### ########.fr */
/* Updated: 2025/02/02 19:42:13 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,13 +18,15 @@
class Shader
{
public:
Shader(std::string vertexPath, std::string fragmentPath, std::string computePath);
Shader(std::string vertexPath, std::string fragmentPath, std::string computePath, std::string denoisingPath);
~Shader(void);
void attach(void);
void setupVertexBuffer();
void drawTriangles();
void flipOutputDenoising(bool pass);
// void setBool(const std::string &name, bool value) const;
void set_int(const std::string &name, int value) const;
void set_float(const std::string &name, float value) const;
@ -37,6 +39,10 @@ class Shader
GLuint getProgram(void) const;
GLuint getProgramCompute(void) const;
GLuint getProgramComputeDenoising(void) const;
GLuint getNormalTexture(void) const;
GLuint getPositionTexture(void) const;
std::vector<float> getOutputImage(void);
@ -46,13 +52,18 @@ class Shader
GLuint _program;
GLuint _program_compute;
GLuint _program_denoising;
GLuint _output_texture;
GLuint _accumulation_texture;
GLuint _denoising_texture;
GLuint _normal_texture;
GLuint _position_texture;
GLuint _vertex;
GLuint _fragment;
GLuint _compute;
GLuint _denoising;
size_t _size;