I am trying to implement a software renderer
It looks like this, it seems my interpolated normal is not perspectively correct
I use scanline conversion and calculate normal with following steps:
Assume we are now drawing line AB (A B have same y value in screen space)
-
Calculating normal of B by interpolating normals of Top vertex and bottom vertex. (Alpha and Beta value is retrieve from top and bottom in screen space)
-
to calculate A is similar
-
draw line AB. Calculating the normals of fragments by interpolating normals of A and B
-
calc light contribution
Sorry for my bad english, hope the picture helps
If I am doing wrong, how to do correct interpolation?
Aucun commentaire:
Enregistrer un commentaire