Skip to content

Commit

Permalink
Update CSG_Museum_1_Fragment.glsl
Browse files Browse the repository at this point in the history
  • Loading branch information
erichlof authored Nov 13, 2023
1 parent 238515c commit f40fc21
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions shaders/CSG_Museum_1_Fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -746,20 +746,30 @@ float SceneIntersect( )
}
objectCount++;

for (int i = 0; i < N_QUADS; i++)
{
d = QuadIntersect( quads[i].v0, quads[i].v1, quads[i].v2, quads[i].v3, rayOrigin, rayDirection, TRUE );
if (d < t)
{
t = d;
hitNormal = (quads[i].normal);
hitEmission = quads[i].emission;
hitColor = quads[i].color;
hitType = quads[i].type;
hitObjectID = float(objectCount);
}
objectCount++;

d = QuadIntersect( quads[0].v0, quads[0].v1, quads[0].v2, quads[0].v3, rayOrigin, rayDirection, TRUE );
if (d < t)
{
t = d;
hitNormal = (quads[0].normal);
hitEmission = quads[0].emission;
hitColor = quads[0].color;
hitType = quads[0].type;
hitObjectID = float(objectCount);
}
objectCount++;

d = QuadIntersect( quads[1].v0, quads[1].v1, quads[1].v2, quads[1].v3, rayOrigin, rayDirection, TRUE );
if (d < t)
{
t = d;
hitNormal = (quads[1].normal);
hitEmission = quads[1].emission;
hitColor = quads[1].color;
hitType = quads[1].type;
hitObjectID = float(objectCount);
}
objectCount++;


// now intersect all CSG objects
Expand Down

0 comments on commit f40fc21

Please sign in to comment.