diff --git a/scenes/dragon.rt b/scenes/dragon.rt index eaad2aa..04d68d2 100644 --- a/scenes/dragon.rt +++ b/scenes/dragon.rt @@ -1,4 +1,4 @@ -CAM 1.82501 0.45 0 -10 180 0.005 2.164 35 5 +CAM 1.99 0.45 0 -10 180 0.005 2.164 35 5 MAT 255 255 255 0.0 1. 0.3 // white 0 @@ -24,8 +24,9 @@ pl 0 -2 0 0 1 0 2 // floor qu -1 1.999 -1 2 0 0 0 0 2 6 -OBJ obj/Dragon_80K.obj -0.5 0 0.55 1 0 90 0 -OBJ obj/Dragon_80K.obj 0.5 0 -0.55 1 0 -90 0 +OBJ obj/Dragon_800K.obj -0.5 0 0.55 5 0 90 0 +OBJ obj/Dragon_800K.obj 0.5 0 -0.55 5 0 -90 0 + # OBJ obj/Model.obj diff --git a/scenes/test.rt b/scenes/test.rt index dbd97e0..c5f2206 100644 --- a/scenes/test.rt +++ b/scenes/test.rt @@ -1,4 +1,5 @@ -CAM -0.75 1.3 -1. -15 50 0.005 2 45 5 +# CAM -0.75 1.3 -1. -15 50 0.005 2 45 5 +CAM -0.75 30 -1. -15 50 0.005 2 45 5 MAT 255 255 255 0.0 1. 0.3 // white 0 diff --git a/shaders/trace.glsl b/shaders/trace.glsl index 925074e..7b8927c 100644 --- a/shaders/trace.glsl +++ b/shaders/trace.glsl @@ -156,24 +156,6 @@ hitInfo traceTopBVH(Ray ray) hit.t = 1e30; hit.obj_index = -1; - //this is working - // for (int i = 0; i < u_bvhNum; i++) - // { - // hit_bvh = traverseBVHs(ray, BvhData[i]); - // if (hit_bvh.t < hit.t) - // { - // hit.t = hit_bvh.t; - // hit.last_t = hit_bvh.last_t; - // hit.obj_index = hit_bvh.obj_index; - // hit.mat_index = hit_bvh.mat_index; - // hit.position = hit_bvh.position; - // hit.normal = hit_bvh.normal; - // } - // } - - // return (hit); - // - int stack[32]; int stack_ptr = 0; stack[0] = 0; @@ -244,7 +226,7 @@ hitInfo traceRay(Ray ray) hitScene = traceScene(ray); hit = hitBVH.t < hitScene.t ? hitBVH : hitScene; - #if 0 + #if 1 if (hit.obj_index == -1 || objects[hit.obj_index].type != 5) break ; ray = portalRay(ray, hit); diff --git a/srcs/RT.cpp b/srcs/RT.cpp index 69a8fdf..4ba55c0 100644 --- a/srcs/RT.cpp +++ b/srcs/RT.cpp @@ -20,8 +20,8 @@ int main(int argc, char **argv) return (1); Window window(&scene, WIDTH, HEIGHT, "RT_GPU", 0); - // Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/compute.glsl"); - Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/debug.glsl"); + Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/compute.glsl"); + // Shader shader("shaders/vertex.vert", "shaders/frag.frag", "shaders/debug.glsl"); GLint max_gpu_size; glGetIntegerv(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &max_gpu_size);