Appendix-3 UNC Pixel Planes

UNC Pixel Planes
designed by Prof. Henry Fuchs et al
Pixel Planes
Henry Fuchs’ Idea: build processing into
the frame buffer, a processor per pixel.
–UNC designs are called enhanced
memories, not SIMD processors
Enabler was linear expression tree…
Representation of a triangle
• Oriented Triangles, three vertices A, B, C
• A triangle is defined by Lines AB, BC, and CA
• For example, let A = (0, 0), B=(10, 0), C = (2, 5)
Line AB = (0,0) + (10, 0)*t
Let X = 10t, Y = 0, so Line AB => Y =0;
Line BC = (10, 0) + (-8, 5)*t = (10-8t, 5t)
Let X = 10 -8t, Y = 5t, so, line BC =>
-5X-8Y + 50=0
Similarly Line CA = (2, 5) + (-2, -5)*t
So, Line CA => 5X - 2Y = 0
Distance from point (U,V) to Line CA is ?
Point to line distance (2D)
•
•
•
•
AX + BY +C = 0 ----line K
Point (U, V)
What is the distance from (U,V ) to line K?
Answer: (AU + BV +C)/M
M = sqrt (A*A + B*B)
Distance with a sign: for a point within a triangle, all
minus, or all positive signs for its distance, assuming
each line with a normal vector.
Shading with fast evaluation of
AX + BY + C = 0
• Flat shading: constant color, A = B = 0, C = Color
• 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)
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 = 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
So, we then broadcast A, B, C into this Pixel-Planes, and the
red components for each pixel is done!
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, y3y1, R3-R1) + (x1, y1, R1)
or, color R = s (R2-R1) + t (R3-R1) + R1
Implementation
Shading
Hardware design
Pixel-Planes
Communications & Multimedia Lab
22
Bit operation
Binary representation:
for easy hardware architecture/realization
Right most significant bit, and shift left at each clock!
Eg.:
011 equals 6 in Decimal
01100 equals 6
0101 equals 10
01111000 equals 30 in Decimal
(all zeros at the right ends: redundant, for pipeline operations)
Communications & Multimedia Lab
23