From 34be8433f7810cf592ccbe2800640ed62465f9ee Mon Sep 17 00:00:00 2001 From: TheRedShip Date: Tue, 7 Jan 2025 10:16:40 +0100 Subject: [PATCH] + | Russian roulette was the problem --- includes/RT.hpp | 4 ++-- scenes/roughness.rt | 2 +- scenes/test.rt | 16 ++++++++-------- shaders/compute.glsl | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/includes/RT.hpp b/includes/RT.hpp index 8b69772..0383535 100644 --- a/includes/RT.hpp +++ b/includes/RT.hpp @@ -13,8 +13,8 @@ #ifndef RT__HPP # define RT__HPP -# define WIDTH 1000 -# define HEIGHT 1000 +# define WIDTH 1920 +# define HEIGHT 1080 # include "glm/glm.hpp" # include "glm/gtc/matrix_transform.hpp" diff --git a/scenes/roughness.rt b/scenes/roughness.rt index b8f9281..b5c6cff 100644 --- a/scenes/roughness.rt +++ b/scenes/roughness.rt @@ -40,5 +40,5 @@ sp 2.4 1.5 -1 1.5 14 // light quad -qu -1 2.9 -1 2 0 0 0 2 0 0 +qu -1 2.9 -1 2 0 0 0 0 2 0 diff --git a/scenes/test.rt b/scenes/test.rt index 2371565..b4545f2 100644 --- a/scenes/test.rt +++ b/scenes/test.rt @@ -3,17 +3,17 @@ CAM 0 2 5 MAT 30 30 30 0.0 0.0 0.0 //white MAT 255 255 255 0.0 1.0 1.0 //mirror -MAT 255 255 255 1.0 0.0 0.0 //sun +MAT 255 255 255 2.0 0.0 0.0 //sun MAT 255 100 100 0.0 0.0 0.0 //red -pl 0 -1 0 0 1 0 0 -pl 0 -1 -13 0 0 1 0 -# pl 0 0 -1 0 0 1 0 +pl 0 0 0 0 1 0 0 +# cu 0 0.5 1 1 1 1 3 -tr 0 0 0 1 0 0 0 0 1 1 -cu 0 1 0 1 1 1 3 +# tr -5 0 2 -5 2 2 0 2 2 2 +# tr -5 0 2 0 0 2 0 2 2 2 -qu -10 15 -9 0 7 0 0 0 7 2 +qu -5 0 0 2 0 0 0 2 0 2 //light problem +# qu -4 0 0 0 0 2 0 2 0 0 //blocking -# sp 15 30 -30 30 2 +# sp 0 30 0 30 2 \ No newline at end of file diff --git a/shaders/compute.glsl b/shaders/compute.glsl index 871e59b..ba2dc56 100644 --- a/shaders/compute.glsl +++ b/shaders/compute.glsl @@ -105,10 +105,10 @@ vec3 pathtrace(Ray ray, inout uint rng_state) GPUMaterial mat = materials[obj.mat_index]; // RR - float p = max(color.r, max(color.g, color.b)); - if (randomValue(rng_state) > p) - break; - color /= p; + // float p = max(color.r, max(color.g, color.b)); + // if (randomValue(rng_state) > p && i > 1) + // break; + // color /= p; // color *= mat.color;