Ray Tracer - Part 4
Textures
Textures
Now, textures are supported! replace_kd, replace_all and blend_kd are texture modes which can be used for blending/replacing the texture with the shading color of the object. Nearest and bilinear interpolation methods are implemented.
Implementing textures was more challenging than my expectations. Specifically, getting the correct output for non-uniformly scaled spheres was a really satisfactory moment.
ellipsoids_texture_bilinear: 0.198 sec
ellipsoids_texture_bilinear_rotate: 0.200 sec
sphere_texture_replace_bilinear: 0.192 sec
sphere_texture_blend_bilinear: 0.193 sec
Ongoing work
Bump mapping, perlin noise…
Written on June 19, 2019