Skip to content

Commit 17f43c6

Browse files
committed
Fixes for inside the box
1 parent 5c8ba9d commit 17f43c6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/volumetric_clouds/main.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ vec2 ray_box(vec3 box_min, vec3 box_max, vec3 origin, vec3 direction)
750750
if (isinf(s_near) || isinf(s_far))
751751
return vec2(0.0, 0.0);
752752
else
753-
return vec2(s_near, s_far);
753+
return vec2(max(s_near, 0.0), max(0.0, s_far));
754754
}")
755755

756756

@@ -781,7 +781,9 @@ void main()
781781
2 -2 2 0 1 0 [0.0 0.0]
782782
0 0 -2 0 0 1 [1.0 3.0]
783783
0 0 -2 0 0 2 [0.5 1.5]
784-
2 2 -2 0 0 1 [0.0 0.0])
784+
2 2 -2 0 0 1 [0.0 0.0]
785+
0 0 0 1 0 0 [0.0 1.0]
786+
2 0 0 1 0 0 [0.0 0.0])
785787

786788

787789
(GLFW/glfwDestroyWindow window)

0 commit comments

Comments
 (0)