You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 9: Raytracing (44)
Carpetfizz

How do you decide when caching is "worth" it. For example, in a game or an animation where the scene is constantly changing, isn't there a very low chance of having to test the same intersection again?

Hsifnus

On the same topic, wouldn't a scene changing often necessitate invalidating at least portions of the intersection cache in order to preserve consistency between cache and scene?

anup-h

I think this slide means that the intersection solution is cached only if it's not in the cell that's currently being tested, so that when you arrive at the correct cell later on in this process, the intersection point doesn't need to be recomputed. I don't think there's any point caching intersections for tracing future rays or for computing future frames.

jeromylui

I was a bit confused on this slide on what it means by "Check intersection point is inside cell". Does that mean the red point isn't the nearest because it isn't located in a blue cell? And if this is the case, shouldn't the cell directly above the dark blue cell be blue as well, because that's where the ray first intersects with a shape and the ray passes through it?

jeromylui

I was a bit confused on this slide on what it means by "Check intersection point is inside cell". Does that mean the red point isn't the nearest because it isn't located in a blue cell? And if this is the case, shouldn't the cell directly above the dark blue cell be blue as well, because that's where the ray first intersects with a shape and the ray passes through it?

yzyz

Each cell stores all the objects that intersect it. When we are checking for intersection in some cell, we check for intersection with all the objects stored in that cell. It may be the case that the intersection point lies outside of the cell though, in which case we need to ignore it since other intersections may be closer. However, we may eventually encounter the cell containing the intersection, so we can cache the result so that we won't have to do the calculation again when we get there. So in this slide, we are currently testing the dark blue cell. We have found an intersection, the red point, but this does not lie in our current cell, so we cache it and save it for later, when we actually do test its cell.

cornrow-kenny

To add to earlier comments about scene changing, I think the answer is that all of this intersection/caching stuff takes place to render one frame, and that the scene would be treated as static at that point in time.

kavimehta

Regarding potential errors when caching, is it so bad to have slightly incorrect images when rendering something like a video game? A few pixels out of place in a single frame cannot really be a huge issue at something like 60 FPS. I wonder what the margin for error is and when things become noticeable

sutble

For those who have taken CS188, this slide reminds me of depth first search. Just because we have reached a goal state, it doesnt mean we can automatically return the path taken to reach that state. We need to keep traversing to double check that it is indeed the shortest path. More info can be found here https://www.geeksforgeeks.org/bfs-vs-dfs-binary-tree/

You must be enrolled in the course to comment