First attempt at opacity
Except for the inaccurate color blending, handling opacity in the raytracer seems fairly straightforward. When a semitransparent material is hit, a new ray is cast from the point of intersection in the same direction to gather color from behind the transparent object. You can see in the video how rendering slows down when i move closer to the transparent triangle, having it fill more of the screen and thus casting a lot of these extra rays. I did run into the familiar problem with rays instantly intersecting the triangle they are "sent from", and just like in lab 2 solved it by moving the origin of the ray ever so slightly along the ray direction vector.
As a bonus, back-face culling can be seen in the video in the form of walls disappearing at certain angles.
As a bonus, back-face culling can be seen in the video in the form of walls disappearing at certain angles.
Comments
Post a Comment