Skip to content

Commit

Permalink
Refactor render function to use type parameter for pixel and initiali…
Browse files Browse the repository at this point in the history
…ze answer to zero
  • Loading branch information
dominic-chang committed Nov 21, 2024
1 parent 8b03bb6 commit 439b32e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/schemes/schemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ function render(camera::AbstractCamera, scene::Scene)
return render.(camera.screen.pixels, Ref(scene))
end

function render(pixel::AbstractPixel, scene::Scene)
function render(pixel::AbstractPixel{T}, scene::Scene) where {T}
mesh = scene[1]
ans = raytrace(pixel, mesh)#mesh.material(pixel, mesh.geometry)
ans = zero(T)#mesh.material(pixel, mesh.geometry)

for itr in 2:length(scene)
for itr in 1:length(scene)
mesh = scene[itr]
ans += raytrace(pixel, mesh)
end
Expand Down

0 comments on commit 439b32e

Please sign in to comment.