mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 18:48:36 +02:00
+ | Compute bvhdata patch
This commit is contained in:
@ -25,7 +25,12 @@ pl 0 -2 0 0 1 0 2 // floor
|
|||||||
qu -1 1.999 -1 2 0 0 0 0 2 6
|
qu -1 1.999 -1 2 0 0 0 0 2 6
|
||||||
|
|
||||||
OBJ obj/Dragon_80K.obj
|
OBJ obj/Dragon_80K.obj
|
||||||
|
# OBJ obj/Dragon_80K.obj
|
||||||
|
# OBJ obj/teapot.obj
|
||||||
|
|
||||||
|
# OBJ obj/Model.obj
|
||||||
|
|
||||||
# OBJ obj/Lowpoly_tree_sample.obj
|
# OBJ obj/Lowpoly_tree_sample.obj
|
||||||
|
|
||||||
# po -1.99 -0.5 -0.5 0 1 0 0 0 1 1 4
|
po -1.99 -0.5 -0.5 0 1 0 0 0 1 1 4
|
||||||
# po -0.5 -0.5 -1.99 0 1 0 1 0 0 0 4
|
po -0.5 -0.5 -1.99 0 1 0 1 0 0 0 4
|
||||||
|
@ -127,8 +127,10 @@ hitInfo traverseBVHs(Ray ray)
|
|||||||
|
|
||||||
for (int i = 0; i < u_bvhNum; i++)
|
for (int i = 0; i < u_bvhNum; i++)
|
||||||
{
|
{
|
||||||
ray.origin = i == 0 ? ray.origin : ray.origin + vec3(2., 0., 0.);
|
GPUBvhData bvh_data = BvhData[i];
|
||||||
hitInfo temp_hit = traceBVH(ray, BvhData[i]);
|
|
||||||
|
ray.origin = ray.origin + vec3(float(i), 0., 0.);
|
||||||
|
hitInfo temp_hit = traceBVH(ray, bvh_data);
|
||||||
|
|
||||||
if (temp_hit.t < hit.t)
|
if (temp_hit.t < hit.t)
|
||||||
{
|
{
|
||||||
@ -156,7 +158,7 @@ hitInfo traceRay(Ray ray)
|
|||||||
hitScene = traceScene(ray);
|
hitScene = traceScene(ray);
|
||||||
|
|
||||||
hit = hitBVH.t < hitScene.t ? hitBVH : hitScene;
|
hit = hitBVH.t < hitScene.t ? hitBVH : hitScene;
|
||||||
#if 0
|
#if 1
|
||||||
if (hit.obj_index == -1 || objects[hit.obj_index].type != 5)
|
if (hit.obj_index == -1 || objects[hit.obj_index].type != 5)
|
||||||
break ;
|
break ;
|
||||||
ray = portalRay(ray, hit);
|
ray = portalRay(ray, hit);
|
||||||
|
Reference in New Issue
Block a user