Graphics Reference
In-Depth Information
How it works…
In the preceding screenshot, the impact of Phong tessellation upon contours and silhouettes
(the ear and nose) is quite clear. With only a small increase in the tessellation factor, a fairly
smooth surface is quickly possible.
As shown in the following diagram, calculating the vertex displacement in Phong tessellation
is done by:
1.
Computing p1 as the position on the flat surface (as per the previous triangle domain
shader using barycentric interpolation):
float3 p1 = BarycentricInterpolate(v0, v1, v2, baryUVW);
2.
Projecting p1 orthogonally to the tangent plane of each of the triangle vertices'
normal vectors (outputting Proj1 , Proj2 , and Proj3 ):
float3 proj1 = ProjectOntoPlane(n0, v0, p1);
float3 proj2 = ProjectOntoPlane(n1, v1, p1);
float3 proj3 = ProjectOntoPlane(n2, v2, p1);
3. And finally, computing the barycentric interpolation of the three projected points that
gives us our final position of P1 :
P1 = BarycentricInterpolate(proj1, proj2, proj3, baryUVW);
Calculation of the new vertex's displacement for Phong tessellation
 
Search WWH ::




Custom Search