mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
+ | Russian roulette was the problem
This commit is contained in:
@ -13,8 +13,8 @@
|
|||||||
#ifndef RT__HPP
|
#ifndef RT__HPP
|
||||||
# define RT__HPP
|
# define RT__HPP
|
||||||
|
|
||||||
# define WIDTH 1000
|
# define WIDTH 1920
|
||||||
# define HEIGHT 1000
|
# define HEIGHT 1080
|
||||||
|
|
||||||
# include "glm/glm.hpp"
|
# include "glm/glm.hpp"
|
||||||
# include "glm/gtc/matrix_transform.hpp"
|
# include "glm/gtc/matrix_transform.hpp"
|
||||||
|
@ -40,5 +40,5 @@ sp 2.4 1.5 -1 1.5 14
|
|||||||
|
|
||||||
|
|
||||||
// light quad
|
// 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
|
||||||
|
|
||||||
|
@ -3,17 +3,17 @@ CAM 0 2 5
|
|||||||
|
|
||||||
MAT 30 30 30 0.0 0.0 0.0 //white
|
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 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
|
MAT 255 100 100 0.0 0.0 0.0 //red
|
||||||
|
|
||||||
pl 0 -1 0 0 1 0 0
|
pl 0 0 0 0 1 0 0
|
||||||
pl 0 -1 -13 0 0 1 0
|
# cu 0 0.5 1 1 1 1 3
|
||||||
# pl 0 0 -1 0 0 1 0
|
|
||||||
|
|
||||||
tr 0 0 0 1 0 0 0 0 1 1
|
# tr -5 0 2 -5 2 2 0 2 2 2
|
||||||
cu 0 1 0 1 1 1 3
|
# 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
|
@ -105,10 +105,10 @@ vec3 pathtrace(Ray ray, inout uint rng_state)
|
|||||||
GPUMaterial mat = materials[obj.mat_index];
|
GPUMaterial mat = materials[obj.mat_index];
|
||||||
|
|
||||||
// RR
|
// RR
|
||||||
float p = max(color.r, max(color.g, color.b));
|
// float p = max(color.r, max(color.g, color.b));
|
||||||
if (randomValue(rng_state) > p)
|
// if (randomValue(rng_state) > p && i > 1)
|
||||||
break;
|
// break;
|
||||||
color /= p;
|
// color /= p;
|
||||||
//
|
//
|
||||||
|
|
||||||
color *= mat.color;
|
color *= mat.color;
|
||||||
|
Reference in New Issue
Block a user