Tuesday, September 12, 2017

Particularly Wavy Update 2

hey all,



Here is a second video showing the progress on Particularly Wavy. I have completely redone the system of tracking light reflections and refractions. I did a whole bunch of google searches, and I discovered that many ray tracing programs use something called ray trees.



Now, as a linguist (and if there are any out there, please forgive the mistakes in the VP of this tree), I'm used to using tree structures like the one below, so it was kinda cool to get to use tree structures to make my light puzzle elements work. The way ray trees work is you have a root ray, and then you calculate any intersections for that ray. If it intersects anything, you decide what to do based on the object it intersected. If the object is reflective or refractive, then you create children rays and perform more intersection calculations on those children rays, and so on. Each frame, you simply traverse the tree from root through each of its children, and each of their children, etc, updating intersection values as you. If anything has changed, then you can simply prune that subtree, and recalculate intersections and create new children as necessary.

No comments:

Post a Comment