Presentation is loading. Please wait.

Presentation is loading. Please wait.

Gouraud Shading with Bilinear Interpolation

Similar presentations


Presentation on theme: "Gouraud Shading with Bilinear Interpolation"— Presentation transcript:

1

2 Gouraud Shading with Bilinear Interpolation
Gouraud shading (smooth shading): color interpolation, for example, Triangle with three vertices (x1, y1), (x2, y2), (x3, y3), each with red components R1, R2, R3 color is represented as (Red, Green , Blue) Assuming a plane (in 3D) with vertices (x1, y1, R1), (X2, Y2, R2), and (X3, y3, R3)

3 Gouraud shading Vector equation of the plane is
(x,y) = s (x2-x1, y2 – y1) + t(x3-x1, y3-y1) + (x1, y1) solved for (s, t) , then s = A1x + B1y +C1, t = A2x + B2y +C2 So, given point (x,y) in this plane, what is its color? Answer: color of (x,y) = R1+ s (R2-R1) + t (R3-R1), or color = Ax + By +C, where A = A1 (R2-R1)+ A2 (R3-R1) B = B1(R2-R1) + B2 (R3-R1) C = C1(R2-R1) + C2(R3-R1) + R1

4 How is the color calculated?
Since, (x,y) = s (x2-x1, y2 – y1) + t(x3-x1, y3-y1) + (x1, y1) Therefore , (x,y, R) = s (x2-x1, y2 – y1, R2-R1) + t(x3-x1, y3-y1, R3-R1) + (x1, y1, R1) or, color R = s (R2-R1) + t (R3-R1) + R1

5


Download ppt "Gouraud Shading with Bilinear Interpolation"

Similar presentations


Ads by Google