Presentation is loading. Please wait.

Presentation is loading. Please wait.

Gouraud-shaded Triangle Rasterization

Similar presentations


Presentation on theme: "Gouraud-shaded Triangle Rasterization"— Presentation transcript:

1 Gouraud-shaded Triangle Rasterization
CS294-6 (Fall 1998) Michael Chu

2 Gouraud-shaded Triangle Rasterization
Roadmap Algorithm Current Implementation Retrospective Quality/Capacity Tradeoffs SCORE Implementation Overview Conclusion 9/18/2018 Gouraud-shaded Triangle Rasterization

3 Triangle Rasterization
Algorithm (Overview) Verticies (w/ RGB) Triangle Rasterization Kernel Packed Pixels (w/ mem addr) 9/18/2018 Gouraud-shaded Triangle Rasterization

4 Gouraud-shaded Triangle Rasterization
Algorithm (Overview 2) Verticies (w/ RGB) Triangle Setup (init RGB and XY, d?/dx, d?/dy) per subtriangle Subtriangle Processor (init RGB and XY, d?/dx) per scanline Scanline Rasterizer Packed Pixels (w/ mem addr) 9/18/2018 Gouraud-shaded Triangle Rasterization

5 Gouraud-shaded Triangle Rasterization
Algorithm (Overview 3) Vmax(x,y) (R3,G3,B3) Etop top.lines Emaj Vmid(x,y) (R2,G2,B2) bottom.lines Ebot Vmin(x,y) (R1,G1,B1) 9/18/2018 Gouraud-shaded Triangle Rasterization

6 Gouraud-shaded Triangle Rasterization
Algorithm (Overview 4) The color of each pixel is linearly interpolated from the colors of each of the verticies. An error term is updated every scanline to choose increment value for initial scanline position and color value. 9/18/2018 Gouraud-shaded Triangle Rasterization

7 Algorithm (Restrictions)
Basic rasterization only. No texture mapping/clipping/z-buffering/alpha testing No floating point verticies/colors (if triangle setup is mapped to array). 9/18/2018 Gouraud-shaded Triangle Rasterization

8 Current Implementation (Overview)
9/18/2018 Gouraud-shaded Triangle Rasterization

9 Gouraud-shaded Triangle Rasterization
9/18/2018 Gouraud-shaded Triangle Rasterization

10 Current Implementation (Decisions)
Triangle setup is performed on CPU. Only utilized once per triangle. Requires very wide multipliers/dividers. Pixel rasterization is done sequentially (pixel per cycle, after setup cost). Avoids repeated row misses in the memory due to random access. 9/18/2018 Gouraud-shaded Triangle Rasterization

11 Current Implementation (Decisions 2)
Each triangle is given to the rasterizer as 2 separate subtriangles. Uses carry-save adder for scanline pixel generation (2-slow), and then preload accumulator for fully throughput. 9/18/2018 Gouraud-shaded Triangle Rasterization

12 Current Implementation (Benchmark)
1020 triangle input set (taken from Mesa (osdemo) in MediaBench) Only 1003 were eligible for rasterizing (remaining 17 were culled). Triangle setup code was not included in statistics. 9/18/2018 Gouraud-shaded Triangle Rasterization

13 Current Implementation (Benchmark 2)
9/18/2018 Gouraud-shaded Triangle Rasterization

14 Current Implementation (Statistics - Area)
Before BLBs added for absorbing retiming depth: 1097 BLBs (1267 LUTs). After adding BLBs for absorbing retiming depth (via limitdepth): 1409 BLBs (1578 LUTs). 9/18/2018 Gouraud-shaded Triangle Rasterization

15 Current Implementation (Statistics - Area 2)
Bounding box area (level 11): X: 64 BLBs. Y: 32 BLBs. Number of design inputs: 400 Number of design outputs: 44 9/18/2018 Gouraud-shaded Triangle Rasterization

16 Current Implementation (Statistics - Time)
CPU (200Mhz SunOS 5.5.1/ribbit.cs): Entire image: seconds / image. Per triangle: seconds / triangle. Triangle rate: triangles / second. 9/18/2018 Gouraud-shaded Triangle Rasterization

17 Current Implementation (Statistics - Time 2)
HSRA (250Mhz): Entire image: cycles / image. Per triangle: cycles / triangle. Triangle rate: triangles / second. 9/18/2018 Gouraud-shaded Triangle Rasterization

18 Current Implementation (Statistics - Time 3)
Speedup (HSRA vs. CPU): 1.78. Design characteristics: Per scanline setup cost: 55 cycles. Triangle startup cost (to first pixel): 56 cycles. No pipelining of scanlines. No pipelining of triangles. 9/18/2018 Gouraud-shaded Triangle Rasterization

19 Current Implementation (Statistics - Power)
CPU: Nodes toggled: Energy consumed: pJ. 9/18/2018 Gouraud-shaded Triangle Rasterization

20 Current Implementation (Statistics - Power 2)
HSRA: Activity: LUT Outputs: 0.079 Inputs: Total: 0.063 9/18/2018 Gouraud-shaded Triangle Rasterization

21 Current Implementation (Statistics - Power 3)
9/18/2018 Gouraud-shaded Triangle Rasterization

22 Current Implementation (Statistics - Power 4)
HSRA: Energy: LUT Outputs: pJ (3.3 x 108 pJ) Inputs: pJ (3.5 x 106 pJ) Clock energy: pJ (3.9 x 109 pJ) Total: pJ (4.3 x 109 pJ) 9/18/2018 Gouraud-shaded Triangle Rasterization

23 Current Implementation (Statistics - Power 5)
Power was calculated using only the first 510 triangles. The high energy consumption could be from: clock signal. driving signals across large chip area. scanline generators run continuously (invalid pixels are not written to memory). 9/18/2018 Gouraud-shaded Triangle Rasterization

24 Retrospective (Difficulties)
Long latencies in cross-chip control signals. 55 cycle setup cost per scanline. CAD tool run time/bugs. 9/18/2018 Gouraud-shaded Triangle Rasterization

25 Retrospective (Design Improvements)
Early “end-of-scanline” signaling to minimize per scanline setup cost. Add a “ready-for-next-triangle” signal to allow some pipelining of triangles. 9/18/2018 Gouraud-shaded Triangle Rasterization

26 Retrospective (Architecture Improvements)
Hardwired control distribution wires to minimize cross-chip signaling. Dedicated carry logic to reduce wide adder latency (in scanline startup critical path). 9/18/2018 Gouraud-shaded Triangle Rasterization

27 Quality/Capacity Tradeoff
Floating point values -> fixed point values: retain 11 bits of precision (value * 2048). Experiment: Reduce number of bits of precision used: from 11 bits to 0 bits. used Peak-Signal-to-Noise-Ratio (PSNR) to compare, pixel for pixel, original image (11 bits) to new image. 9/18/2018 Gouraud-shaded Triangle Rasterization

28 Quality/Capacity (PSNR)
9/18/2018 Gouraud-shaded Triangle Rasterization

29 Quality/Capacity Tradeoff (PSNR vs. Precision Bits)
9/18/2018 Gouraud-shaded Triangle Rasterization

30 Quality/Capacity Tradeoff (Size vs. Precision Bits)
9/18/2018 Gouraud-shaded Triangle Rasterization

31 Quality/Capacity Tradeoff (PSNR vs. Size)
9/18/2018 Gouraud-shaded Triangle Rasterization

32 Gouraud-shaded Triangle Rasterization
Conclusion Design showed some speedup, but not enough to offset increased area/power requirements. Could benefit from pipelining scanline and triangle rasterization (expensive init/setup costs). 9/18/2018 Gouraud-shaded Triangle Rasterization

33 Gouraud-shaded Triangle Rasterization
Conclusion 2 From quality/capacity study, savings may result from analyzing sizes of triangles and reducing precision of input values. 9/18/2018 Gouraud-shaded Triangle Rasterization


Download ppt "Gouraud-shaded Triangle Rasterization"

Similar presentations


Ads by Google