The SMG, textured from its own image map, in my renderer. Model: "SMG GUN Remastered" by ROHIT3DMODELS, CC-BY-4.0.
What is a texture?
In my earlier explorations, every object in my renders had one material with a single color. A texture allows multiple colors across the surface of an object. It simply tells us what color is supposed to be at the ray's hit location. It can be as simple as a checkered pattern like a chessboard, like the floors in all of these images, or as complicated as the texture on the SMG above.
To wrap an image, each point on the surface needs to know where it sits on that image. Since we are already using
( x , y , z ) (x, y, z) coordinates for the model, we adopt ( u , v ) (u, v) coordinates: two numbers from 0 to 1 that map a 2D image onto a 3D object.
Side bar: it keeps coming back to 2D
Rendering is already a 2D image made from a 3D scene. Then the white furnace test turned correctness into a flat grey square.…