Skip to content

Commit 4d78f46

Browse files
committed
fix iterative version
1 parent c113489 commit 4d78f46

File tree

4 files changed

+344
-177
lines changed

4 files changed

+344
-177
lines changed

docs/code/basic-scene.jl

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,18 @@ end
7272

7373
begin
7474
integrator = Trace.WhittedIntegrator(cam, Trace.UniformSampler(8), 5)
75-
@time integrator(scene, film)
75+
@btime integrator(scene, film)
7676
img = reverse(film.framebuffer, dims=1)
7777
end
78+
7879
# 6.296157 seconds (17.64 k allocations: 19.796 MiB, 0.13% gc time, 45 lock conflicts)
7980
# After more GPU optimizations
8081
# 4.169616 seconds (17.37 k allocations: 19.777 MiB, 0.14% gc time, 20 lock conflicts)
8182
# After first shading running on GPU
8283
# 3.835527 seconds (17.36 k allocations: 19.779 MiB, 0.16% gc time, 41 lock conflicts)
84+
# 4.191 s (4710 allocations: 18.36 MiB)
85+
# iterative_li: 5.2s -.-
8386

84-
camera_sample = Trace.get_camera_sample(integrator.sampler, Point2f(512))
85-
ray, ω = Trace.generate_ray_differential(integrator.camera, camera_sample)
86-
87-
@btime Trace.intersect_p(bvh, ray)
88-
@btime Trace.intersect!(bvh, ray)
89-
90-
###
91-
# Int32 always
92-
# 42.000 μs (1 allocation: 624 bytes)
93-
# Tuple instead of vector for nodes_to_visit
94-
# 43.400 μs (1 allocation: 624 bytes)
95-
# AFTER GPU rework
96-
# intersect!
97-
# 40.500 μs (1 allocation: 368 bytes)
98-
# intersect_p
99-
# 11.500 μs (0 allocations: 0 bytes)
100-
101-
### LinearBVHLeaf as one type
102-
# 5.247460 seconds (17.55 k allocations: 19.783 MiB, 46 lock conflicts)
10387

10488
# begin
10589
# integrator = Trace.SPPMIntegrator(cam, 0.075f0, 5, 1)

0 commit comments

Comments
 (0)