Learning C, Day 15 (Texture Mapping 1)

Today I worked on adding texture mapping to the renderer so that it can display textured objects, which took about two and a half hours. It isn’t done yet, though, so here’s the classic missing texture color using the new code:

Not sure why this GIF looks so fried, it had the same recording settings.

Right now the code loops through each pixel of each screen space triangle and puts a magenta pixel there. I have a texture in memory, but what I don’t have is the mapping between the screen pixel and the texture pixel, or texel. Tomorrow is Barycentric coordinates, which should provide the mapping. See you then!

Leave a comment

Your email address will not be published. Required fields are marked *


Your data is processed in accordance with my privacy policy. Comments are manually approved and may take a while to appear.