CG Class 18, Wed 2018-10-24

2   Why textures are hard to do

  1. ... although the idea is simple.
  2. You want to take each texel on each object, find which pixel it would draw on to, and draw it there.
  3. That's too expensive. Because of the projection, the projection of one texel is almost never the same size as a pixel.
    1. Sometimes several texels will project to the same pixel, so they have to be averaged together to get the pixel color.
    2. At other times, one texel will project over several pixels, so you want to blend pixel colors smoothly from one texel to the next texel.
    3. Most texels will be invisible in the final image. Even with today's computers, this wastes a lot of computing power.
  4. So, this is how it's really implemented.
    1. For each visible fragment, i.e., pixel, find which texel would draw there.
    2. This requires a backwards version of the graphics pipeline.
    3. The interesting surfaces are curved, where each parameter pair (u,v) uses a bicubic polynomial to generate an (x,y,z). You have to invert that.
    4. All this has to be computed at hundreds of millions of pixels per second.
    5. It usually utilizes special texture mapping hardware for speed.