UNC Pixel Planes designed by Prof. Henry Fuchs et al

26
UNC Pixel Planes designed by Prof. Henry Fuchs et al

description

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. - PowerPoint PPT Presentation

Transcript of UNC Pixel Planes designed by Prof. Henry Fuchs et al

Page 1: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

UNC Pixel Planesdesigned by Prof. Henry Fuchs et al

Page 2: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 3: 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…

Page 4: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 5: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 6: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 7: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 8: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

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=0Similarly Line CA = (2, 5) + (-2, -5)*t So, Line CA => 5X - 2Y = 0Distance from point (U,V) to Line CA is ?

Page 9: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

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)

Page 10: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

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.

Page 11: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

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)

Page 12: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

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, whereA = A1 (R2-R1)+ A2 (R3-R1)B = B1(R2-R1) + B2 (R3-R1)C = C1(R2-R1) + C2(R3-R1) + R1So, we then broadcast A, B, C into this Pixel-Planes, and the red

components for each pixel is done!

Page 13: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

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

Page 14: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

• Three vertices: (0,0) (2,4), and (6,2) with red colors 10, 50, 20 Given point (2,2) inside the triangle, the color

is 28! (since s = 0.4, t = 0.2)• Goven point (x, y), the color is ? Represented as Ax + By +C, what are the values

of (A, B, C)? Hint:A = -2, B= 11 and C= 10

Page 15: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 16: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 17: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 18: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 19: UNC Pixel Planes designed by Prof. Henry Fuchs  et al
Page 20: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

Implementation

Page 21: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

Shading

Page 22: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

Hardware design

Page 23: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

Communications & Multimedia Lab 23

Pixel-Planes

Page 24: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

Communications & Multimedia Lab 24

Bit operation

Binary representation: for easy hardware architecture/realizationRight most significant bit, and shift left at each clock!

Eg.: 011 equals 6 in Decimal01100 equals 60101 equals 1001111000 equals 30 in Decimal (all zeros at the right ends: redundant, for pipeline operations)

Page 25: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

011 equals 6 in Decimal After left shift one bit, it is 110 (one 0 added to the right), the value is 3!

01100 equals 6, left shift one bit, becomes 11000, value is 3

0101 equals 10, left shift one bit, becomes 1010, value is 5

01111000 equals 30 in Decimal, left shift one bit, becomes 11110000, value is 15.

Page 26: UNC Pixel Planes designed by Prof. Henry Fuchs  et al

One bit adder

For example: 01100 = A 01010= C A+ C = 00001 Carry = 0 Value of A is 6, value of B is 10, A + C = 16

Left shift one bit (one time per clock trigger)