mercredi 6 mai 2015

Is my normal interpolation perspectively correct

I am trying to implement a software renderer

It looks like this, it seems my interpolated normal is not perspectively correct enter image description here

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)

  1. 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)

  2. to calculate A is similar

  3. draw line AB. Calculating the normals of fragments by interpolating normals of A and B

  4. calc light contribution

Sorry for my bad english, hope the picture helps

enter image description here

If I am doing wrong, how to do correct interpolation?

Aucun commentaire:

Enregistrer un commentaire