graphics pipeline rendering approaches
play

Graphics Pipeline Rendering approaches 1. object-oriented 3D - PowerPoint PPT Presentation

Graphics Pipeline Rendering approaches 1. object-oriented 3D rendering vertices image pipeline foreach object ... 2. image-oriented foreach pixel ... Z-buffer Rendering Z-buffering is very common approach, also often accelerated with


  1. Graphics Pipeline

  2. Rendering approaches 1. object-oriented 3D rendering vertices image pipeline foreach object ... 2. image-oriented foreach pixel ...

  3. Z-buffer Rendering •Z-buffering is very common approach, also often accelerated with hardware •OpenGL is based on this approach 3D Polygons Image Pixels GRAPHICS PIPELINE 3

  4. Pipelining operations An arithmetic pipeline that computes c+(a*b) a * + b c

  5. 3D graphics pipeline Clipper and Vertex Fragment Vertices primitive Rasterizer Pixels processor processor assembler Geometry : objects - made of primitives - made of vertices Vertex processing: coordinate transformations and color Clipping and primitive assembly: output is a set of primitives Rasterization: output is a set of fragments for each primitive Fragment processing: update pixels in the frame bu fg er

  6. 3D graphics pipeline • optimized for drawing 3D triangles with shared vertices • map 3D vertex locations to 2D screen locations • shade triangles and draw them in back to front order using a z-buffer • speed depends on # of triangles • most operations on vertices can be represented using a 4D coordinate space - 3D position + homogeneous coordinate for perspective viewing • 4x4 matrices and 4-vectors

  7. Primitives and Attributes

  8. Choice of primitives • Which primitives should an API contain? • small set - supported by hardware, or • lots of primitives - convenient for user

  9. Choice of primitives • Which primitives should an API contain? ➡ small set - supported by hardware • lots of primitives - convenient for user

  10. Choice of primitives • Which primitives should an API contain? ➡ small set - supported by hardware • lots of primitives - convenient for user GPUs are optimized for points , lines , and triangles

  11. Choice of primitives • Which primitives should an API contain? ➡ small set - supported by hardware • lots of primitives - convenient for user GPUs are optimized for points , lines , and triangles

  12. Two classes of primitives Angel and Shreiner Geometric : points, lines, polygons Image : arrays of pixels

  13. Point and line segment types Angel and Shreiner

  14. Polygons • Multi-sided planar element composed of edges and vertices. • Vertices (singular vertex) are represented by points Edges connect vertices as line segments • (x2,y2) E1 (x1,y1) E2 E3 (x3,y3)

  15. Valid polygons • Simple • Convex • Flat

  16. Valid polygons • Simple • Convex • Flat

  17. OpenGL polygons • Only triangles are supported (in latest versions) GL_TRIANGLE_STRIP GL_POINTS GL_TRIANGLES GL_TRIANGLE_FAN

  18. Other polygons triangulation

  19. Graphics Pipeline (slides courtesy K. Fatahalian)

  20. Clipper and Fragment Vertex Vertices Rasterizer Pixels primitive processor processor assembler Vertex processing Vertices are transformed into “screen space” v2 v0 v5 v4 v1 v3 Vertices

  21. Clipper and Fragment Vertex Vertices Rasterizer Pixels primitive processor processor assembler Vertex processing Vertices are transformed into “screen space” v2 EACH VERTEX IS v0 v5 TRANSFORMED v4 INDEPENDENTLY v1 v3 Vertices

  22. Clipper and Fragment Vertex Vertices Rasterizer Pixels primitive processor processor assembler Primitive processing Then organized into primitives that are clipped and culled… v2 v2 v0 v0 v5 v5 v4 v4 v1 v1 v3 v3 Vertices Primitives (triangles)

  23. Clipper and Fragment Vertex Vertices Rasterizer Pixels primitive processor processor assembler Rasterization Primitives are rasterized into “pixel fragments” Fragments

  24. Clipper and Fragment Vertex Vertices Rasterizer Pixels primitive processor processor assembler Rasterization Primitives are rasterized into “pixel fragments” EACH PRIMITIVE IS RASTERIZED INDEPENDENTLY

  25. Clipper and Fragment Vertex Vertices Rasterizer Pixels primitive processor processor assembler Fragment processing Fragments are shaded to compute a color at each pixel Shaded fragments

  26. Clipper and Fragment Vertex Vertices Rasterizer Pixels primitive processor processor assembler Fragment processing Fragments are shaded to compute a color at each pixel EACH FRAGMENT IS PROCESSED INDEPENDENTLY

  27. Clipper and Fragment Vertex Vertices Rasterizer Pixels primitive processor processor assembler Pixel operations Fragments are blended into the frame bu fg er at their pixel locations (z-bu fg er determines visibility) Pixels

  28. Pipeline entities v2 v2 v0 v0 v5 v5 v4 v4 v1 v3 v1 v3 Vertices Primitives Fragments Fragments (shaded) Pixels

  29. Graphics pipeline Memory Bu fg ers Vertex Generation Vertex Data Bu fg ers Fixed-function Vertex stream Programmable Vertices Vertex Processing Textures Vertex stream Primitive Generation Primitive stream Primitives Primitive Processing Textures Primitive stream Fragment Generation Fragment stream Fragments Fragment Processing Textures Fragment stream Pixel Operations Output image (pixels) Pixels

Recommend


More recommend