Original Post
I am writing a software rasterizer as a school assignment, and I trouble getting my textures correct.
I found this tutorial about half space triangle filling, which seems more interesting than the scanline algorithm.
But then I was like: "Why don't you just calculate the barycentric coordinates right away?"
So I did, and the triangle looks fine.
Except for the texture.
So now my problems is how to use the barycentric coordinates to get perspective correct uv's (or any interpolation for that matter).
My pipeline gives the triangle in canonical space, so all I get is 3 vertices with their x,y,z and w value.
I tried googling it but they all keep talking about the scanline algorithm.
I found this tutorial about half space triangle filling, which seems more interesting than the scanline algorithm.
But then I was like: "Why don't you just calculate the barycentric coordinates right away?"
So I did, and the triangle looks fine.
Except for the texture.
So now my problems is how to use the barycentric coordinates to get perspective correct uv's (or any interpolation for that matter).
My pipeline gives the triangle in canonical space, so all I get is 3 vertices with their x,y,z and w value.
I tried googling it but they all keep talking about the scanline algorithm.
