C++ Ray Tracer
A ray tracer written from scratch based on Phong shading and extended to support reflectiveness and transparency
Chapter 1
A C++ ray tracer written from scratch based on Phong shading and extended to support reflectiveness and transparency. The current version is used for grading in CSCI 5607 Fundamentals of Computer Graphics at UMN, thus the source code is not made public.
Phong Shading
Spheres rendered with high ambient value (upper), high diffuse value (lower-left), and high specular value (lower-right).
Soft Shadow, Spotlight and Attenuation
Light sources in the scene cast soft shadows on the spheres. Spotlights with soft shadow boundaries were implemented (illuminated area with circular shape). Light attenuation effect was also included (light sources closer to the surface create brighter illumination).
Texture Mapping
A basic textured sphere.
A textured scene with more geometric primitives.
Normal maps are also supported.
Reflection, Refraction & Fresnel Effect
The surface acts like a perfect mirror.
Light rays pass through the crystal ball. Note that Fresnel effect is implemented, so that the sphere is more transparent in the center, and more reflective towards the boundary.
Note that the scene is upright after the rays entering and exiting the glass surfaces twice (flipped twice). Also the boundary of the sphere appears like a dark ring due to total internal reflection.
Statement: If no specific statement in the content, the copyright belongs to Yuxuan Huang . Reprint please indicate the link of this article.
(The content is authorized with CC BY-NC-SA 4.0 protocol)
Title:《 C++ Ray Tracer 》
Link:https://yuxuan-huang97.github.io/rendering/ray-tracer.html
The last update of this article was days ago, so it may be outdated!