How to do phong shading in POV-ray

476 Views Asked by At

I am using POV-ray raytracer for rendering. I have a mesh of triangles, when I render that using :

 mesh
{
    triangle
   {
           < corner_1>, <corner_2>, <corner_3>
   }

}

I am not getting smooth shading, there is also a provision for smooth shading in POV-ray which is using :

smooth_triangle
{
    <Corner_1>, <Normal_1>, <Corner_2>,
    <Normal_2>, <Corner_3>, <Normal_3>
    [OBJECT_MODIFIER...]
}

But the problem is that it requires normal of corners of triangle ( it uses phong shading ), How to calculate normal at corners of triangle? How to have a smooth shading in POV-ray?

NOTE: triangles sharing common vertices will have same normal at those vertices

0

There are 0 best solutions below