The Rendering Pipeline (1)

Size: px
Start display at page:

Download "The Rendering Pipeline (1)"

Transcription

1 The Rendering Pipeline (1) Alessandro Martinelli 30 settembre 2014 The Rendering Pipeline (1) Rendering Architecture First Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware

2 Rendering Architecture The Rendering Pipeline (1) Rendering Architecture First Rendering Pipeline Rendering Primitives Unit Volume, Clipping and Viewport Transform Scan-Line and Z-Buffer Algorithms A Simplified Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware A. Martinelli Pipeline 30 settembre / 42

3 Rendering Architecture Rendering Architecture CPU side Driver Buffer Istruzione 1 Istruzione 2 Istruzione 3... Bus GPU side GPU Graphics Memory API Application A. Martinelli Pipeline 30 settembre / 42

4 Rendering Architecture Graphics API Low-Level Library Open GL (Open Graphics Library) Direct3D (DirectX, microsoft library) High-Level Library Java 3D Open Scenegraph others... A. Martinelli Pipeline 30 settembre / 42

5 Rendering Architecture Graphics API: Open GL Open Graphics Library: C and C++ software library, available in Java with JOGL Binding. A. Martinelli Pipeline 30 settembre / 42

6 Rendering Architecture Graphics API: Open GL Open Graphics Library: C and C++ software library, available in Java with JOGL Binding. At the moment, a well defined standard from Khronos Group A. Martinelli Pipeline 30 settembre / 42

7 Rendering Architecture Graphics API: Open GL Open Graphics Library: C and C++ software library, available in Java with JOGL Binding. At the moment, a well defined standard from Khronos Group Different Versions: Open GL 1.x: fixed rendering pipeline. Open GL 2.x/3.x/4.x: programmable-customizable rendering pipeline Open GL 1.0/1.1 ES: simplified OpenGL 1.x version for Embedded Systems missing a programmable graphics chipset. Open GL 2.0/3.0 ES: simplified OpenGL 2.x/3.x version for Embedded Systems having a programmable graphics chipset. A. Martinelli Pipeline 30 settembre / 42

8 Rendering Architecture Graphics API: Open GL Open Graphics Library: C and C++ software library, available in Java with JOGL Binding. At the moment, a well defined standard from Khronos Group Different Versions: Open GL 1.x: fixed rendering pipeline. Open GL 2.x/3.x/4.x: programmable-customizable rendering pipeline Open GL 1.0/1.1 ES: simplified OpenGL 1.x version for Embedded Systems missing a programmable graphics chipset. Open GL 2.0/3.0 ES: simplified OpenGL 2.x/3.x version for Embedded Systems having a programmable graphics chipset. Defining the Graphical Context : XGL, GLUT: Linux Systems WGL: Windows EGL: Embedded Systems A. Martinelli Pipeline 30 settembre / 42

9 Rendering Architecture GPU: a Gray Box the Graphics API will control a GPU Model A. Martinelli Pipeline 30 settembre / 42

10 Rendering Architecture GPU: a Gray Box the Graphics API will control a GPU Model the real GPU implements the Model A. Martinelli Pipeline 30 settembre / 42

11 Rendering Architecture GPU: a Gray Box the Graphics API will control a GPU Model the real GPU implements the Model the effective structure must respect the behavioural model of the API... A. Martinelli Pipeline 30 settembre / 42

12 Rendering Architecture GPU: a Gray Box the Graphics API will control a GPU Model the real GPU implements the Model the effective structure must respect the behavioural model of the API..... but the effective structure of the GPU is encapsulated behind the API and is not known A. Martinelli Pipeline 30 settembre / 42

13 Rendering Architecture GPU: a Gray Box the Graphics API will control a GPU Model the real GPU implements the Model the effective structure must respect the behavioural model of the API..... but the effective structure of the GPU is encapsulated behind the API and is not known OpenGL Model The GPU Model is a Pipeline A. Martinelli Pipeline 30 settembre / 42

14 Rendering Architecture GPU: a Gray Box the Graphics API will control a GPU Model the real GPU implements the Model the effective structure must respect the behavioural model of the API..... but the effective structure of the GPU is encapsulated behind the API and is not known OpenGL Model The GPU Model is a Pipeline The Rendering Pipeline is a chain of blocks implementing different graphics algorithms. A. Martinelli Pipeline 30 settembre / 42

15 Rendering Architecture About Performance Rendering Architecture: a Serial System A. Martinelli Pipeline 30 settembre / 42

16 Rendering Architecture About Performance Rendering Architecture: a Serial System As in every Serial System, we will have a bottleneck. A. Martinelli Pipeline 30 settembre / 42

17 Rendering Architecture About Performance Rendering Architecture: a Serial System As in every Serial System, we will have a bottleneck. The Bottleneck depends upon: Time of command elaboration from the CPU Time of command transfer on the Communication BUS Time of command execution on the GPU A. Martinelli Pipeline 30 settembre / 42

18 Rendering Architecture GPU: Tecnical Notes GPUs are based on parallel processing units A. Martinelli Pipeline 30 settembre / 42

19 Rendering Architecture GPU: Tecnical Notes GPUs are based on parallel processing units Common Graphics Tasks which can be executed as parallel processes: Colour management on each pixel Evaluation of vertices properties A. Martinelli Pipeline 30 settembre / 42

20 Rendering Architecture GPU: Tecnical Notes GPUs are based on parallel processing units Common Graphics Tasks which can be executed as parallel processes: Colour management on each pixel Evaluation of vertices properties From 1995 to 2005, during the time required for a CPU to speed up with a factor 2x, a GPU speeded up with a factor 10x A. Martinelli Pipeline 30 settembre / 42

21 Rendering Architecture GPU: Tecnical Notes GPUs are based on parallel processing units Common Graphics Tasks which can be executed as parallel processes: Colour management on each pixel Evaluation of vertices properties From 1995 to 2005, during the time required for a CPU to speed up with a factor 2x, a GPU speeded up with a factor 10x Main Goal: whatever it happens, try to make the GPU the Bottleneck of the system A. Martinelli Pipeline 30 settembre / 42

22 Rendering Architecture GPU: Tecnical Notes GPUs are based on parallel processing units Common Graphics Tasks which can be executed as parallel processes: Colour management on each pixel Evaluation of vertices properties From 1995 to 2005, during the time required for a CPU to speed up with a factor 2x, a GPU speeded up with a factor 10x Main Goal: whatever it happens, try to make the GPU the Bottleneck of the system... because the CPU and the Communication Bus may be involved in other processes not related to graphics A. Martinelli Pipeline 30 settembre / 42

23 Rendering Primitives The Rendering Pipeline (1) Rendering Architecture First Rendering Pipeline Rendering Primitives Unit Volume, Clipping and Viewport Transform Scan-Line and Z-Buffer Algorithms A Simplified Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware A. Martinelli Pipeline 30 settembre / 42

24 Rendering Primitives Geometric-Rendering Primitives Geometric Primitive A simple geometric element for which our Rendering Pipeline has a rasterization algorithm A. Martinelli Pipeline 30 settembre / 42

25 Rendering Primitives Geometric-Rendering Primitives Geometric Primitive A simple geometric element for which our Rendering Pipeline has a rasterization algorithm Rasterization Algorithm Algorithm used to draw a geometry on a digital image Digital Image A matrix of pixels. Each pixel can be assigned only one RGB/RGBA colour value A. Martinelli Pipeline 30 settembre / 42

26 Rendering Primitives Geometric-Rendering Primitives Geometric Primitive A simple geometric element for which our Rendering Pipeline has a rasterization algorithm Rasterization Algorithm Algorithm used to draw a geometry on a digital image Digital Image A matrix of pixels. Each pixel can be assigned only one RGB/RGBA colour value Geometric Primitives Properties Vertices (Shape) Rendering Properties (its Rasterization Algorithm Parameters) A. Martinelli Pipeline 30 settembre / 42

27 Rendering Primitives Point Geometric Properties Vertex V Rendering Properties Colour (RGB) Dimension (diameter/edge in pixel) Anti-Aliasing (yes-no) glcolor3f(1,0,0); glpointsize(4); glbegin(gl POINTS); glvertex3f(v x,v y,v z); glend(); A. Martinelli Pipeline 30 settembre / 42

28 Rendering Primitives A. Martinelli Pipeline 30 settembre / 42

29 Rendering Primitives Line Geometric Properties Vertices {A, B} Rendering Properties Colours of each Vertex (RGB), Colour Interpolation (yes-no) Width (extension of the rectangle in direction orthogonal to AB) Anti-Aliasing (yes-no) glbegin(gl LINES); glcolor3f(1,0,0); glvertex3f(a x,a y,a z); glcolor3f(1,1,0); glvertex3f(b x,b y,b z); glend(); A. Martinelli Pipeline 30 settembre / 42

30 Rendering Primitives Drawing More Lines: Lines, Line Strip and Line Loop Primitive Lines Behaviour: Each 2 Vertices, draws a line In the example: {V 1,V 2,V 2,V 3,V 3,V 4,V 4,V 1 } V 2 V 3 V 1 V 4 A. Martinelli Pipeline 30 settembre / 42

31 Rendering Primitives Drawing More Lines: Lines, Line Strip and Line Loop Primitive Lines Behaviour: Each 2 Vertices, draws a line In the example: {V 1,V 2,V 2,V 3,V 3,V 4,V 4,V 1 } Primitive Line Strip Behaviour: for each new Vertex, create a Line with the previous one Nell esempio: {V 1,V 2,V 3,V 4,V 1 } V 2 V 3 V 1 V 4 A. Martinelli Pipeline 30 settembre / 42

32 Rendering Primitives Drawing More Lines: Lines, Line Strip and Line Loop Primitive Lines Behaviour: Each 2 Vertices, draws a line In the example: {V 1,V 2,V 2,V 3,V 3,V 4,V 4,V 1 } Primitive Line Strip Behaviour: for each new Vertex, create a Line with the previous one Nell esempio: {V 1,V 2,V 3,V 4,V 1 } Primitive Line Loop V 2 V 3 Behaviour: Closed Polyline Nell esempio: {V 1,V 2,V 3,V 4 } V 1 V 4 A. Martinelli Pipeline 30 settembre / 42

33 Rendering Primitives Triangle Geometric Properties Vertices {A,B,C} Rendering Properties Vertex Colour: Front and Back, Colour Interpolation Render Mode ( Fill-Line ) Front-Face (Counter-Clock-Wise or Clock-Wise),Face Culling (yes-no) Anti-Aliasing (yes-no) A. Martinelli Pipeline 30 settembre / 42

34 Rendering Primitives A. Martinelli Pipeline 30 settembre / 42

35 Rendering Primitives Drawing More Triangles: Triangles, Triangle Strip PrimitivePrimitiva Triangles Triangles Behaviour: Each 3 Vertices, builds a triangle Example: {V 1,V 2,V 3,V 2,V 3,V 4,V 3,V 4,V 5,V 4,V 5,V 6 } V 2 V 4 V 6 V 1 V 3 V 5 A. Martinelli Pipeline 30 settembre / 42

36 Rendering Primitives Drawing More Triangles: Triangles, Triangle Strip PrimitivePrimitiva Triangles Triangles Behaviour: Each 3 Vertices, builds a triangle Example: {V 1,V 2,V 3,V 2,V 3,V 4,V 3,V 4,V 5,V 4,V 5,V 6 } Primitive Triangle Strip Behaviour: for each new Vertex, builds a Triangle with the last 2 in the sequence Example: {V 1,V 2,V 3,V 4,V 5,V 6 } V 2 V 4 V 6 V 1 V 3 V 5 A. Martinelli Pipeline 30 settembre / 42

37 Rendering Primitives Drawing More Triangles: Triangle Fan V 2 V 4 V 5 V 1 V 3 V 6 A. Martinelli Pipeline 30 settembre / 42

38 Rendering Primitives Drawing More Triangles: Triangle Fan Primitive Triangle Fan Behaviour: for each new Vertex, builds a Triangle using the FIRST vertex in the list and the Previous one Example: {V 3,V 1,V 2,V 4,V 5,V 6 } V 2 V 4 V 5 V 1 V 3 V 6 A. Martinelli Pipeline 30 settembre / 42

39 Rendering Primitives Triangle Strip and Triangle Fan An example: Sphere Model The sphere is represented with Strips aligned with parallels The caps are represented with Triangle Fan The other strips are Triangle Strip Triangle Fan Triangle Strip Triangle Fan A. Martinelli Pipeline 30 settembre / 42

40 Rendering Primitives Triangle Property: Render Mode Render Mode: Fill Draws a filled triangles, drawing each pixel in its area glpolygonmode(gl FRONT AND BACK,GL FILL); A Fill A Line B C B C A. Martinelli Pipeline 30 settembre / 42

41 Rendering Primitives Triangle Property: Render Mode Render Mode: Fill Draws a filled triangles, drawing each pixel in its area glpolygonmode(gl FRONT AND BACK,GL FILL); Render Mode: Line Draws the layout of the triangle, drawing each edge as a line. A Fill A Line B C B C A. Martinelli Pipeline 30 settembre / 42

42 Rendering Primitives Triangle Property: Render Mode Render Mode: Fill Draws a filled triangles, drawing each pixel in its area glpolygonmode(gl FRONT AND BACK,GL FILL); Render Mode: Line Draws the layout of the triangle, drawing each edge as a line. The rendering properties of Lines are used. A Fill A Line B C B C A. Martinelli Pipeline 30 settembre / 42

43 Rendering Primitives Triangle Property: Render Mode Render Mode: Fill Draws a filled triangles, drawing each pixel in its area glpolygonmode(gl FRONT AND BACK,GL FILL); Render Mode: Line Draws the layout of the triangle, drawing each edge as a line. The rendering properties of Lines are used. glpolygonmode(gl FRONT AND BACK,GL LINE); A Fill A Line B C B C A. Martinelli Pipeline 30 settembre / 42

44 Rendering Primitives Triangle Property: Front-Face a Front Face a Back Face A. Martinelli Pipeline 30 settembre / 42

45 Rendering Primitives Triangle Property: Front-Face a Front Face a Back Face GL FRONT AND BACK : assign the property to both the face GL FRONT : assign the property to the front face GL BACK : assign the property to the back face GL NONE : stay for no faces (used for some special situations) A. Martinelli Pipeline 30 settembre / 42

46 Rendering Primitives Triangle Properties: Winding-Rule(1/2) Vertices Order Clock-Wise Counter-Clock-Wise A. Martinelli Pipeline 30 settembre / 42

47 Rendering Primitives Triangle Properties: Winding-Rule(1/2) Vertices Order Clock-Wise Counter-Clock-Wise The order of vertices after the rotation... they are ClockWise if they were CounterClockWise before the rotation they are CounterClockWise if they were ClockWise before the rotation A Counter-ClockWise A C B C ClockWise B A. Martinelli Pipeline 30 settembre / 42

48 Rendering Primitives Triangle Properties: Winding-Rule(2/2) Counter-ClockWise If vertices are Counter-ClockWise, then the triangle is seen on its Front face Otherwise. the triangle is seen on its Back face ClockWise If vertices are ClockWise, then the triangle is seen on its Front face Otherwise. the triangle is seen on its Back face glfrontface(gl CCW) : use the Counter-ClockWise winding rule (often default) glfrontface(gl CW) : use the ClockWise winding rule A. Martinelli Pipeline 30 settembre / 42

49 Rendering Primitives Triangle Property: Face Culling The Face Culling is the operation cutting all the face belonging to some face class (Back or Front) before drawing them. Why? We suppose an object is Closed, and that its Front Faces are all outside. Then, whenever we see a face from its Back Side, that face is internal and will be indeed hidden from some other Front Face. glcullface(gl BACK) : set the class of faces which must be Culled glenable/gldisable(gl CULL FACE) : enable/disable Face Culling Not Visible = visual result Front Face Direction Front Face Direction A. Martinelli Pipeline 30 settembre / 42

50 Rendering Primitives Triangle and Line Properties : Colour Interpolation Colour Interpolation: No (Flat) The triangle is drawn using the colour of given on its last vertex. A. Martinelli Pipeline 30 settembre / 42

51 Rendering Primitives Triangle and Line Properties : Colour Interpolation Colour Interpolation: No (Flat) The triangle is drawn using the colour of given on its last vertex. Interpolazione del Colore: Yes (Smooth) The colour of each pixel inside the triangle area is evaluated with a linear interpolations model based on the colour of each vertex. glshademode(gl FLAT): disable interpolation glshademode(gl SMOOTH) : enable interpolation A. Martinelli Pipeline 30 settembre / 42

52 Rendering Primitives Primitive Quad/Quad Strip A quadrilateral is always split into 2 triangles. The 2 triangles are found with an algorithm looking for the best diagonal between the 2 possible available. V 2 V 2 V 3 V3 V 1 V 1 V 4 Geometric Properties V 4 4 Vertices {V 1,V 2,V 3,V 4 } IT IS NOT necessary for such vertices to be on the same plane!! Rendering Properties Same as triangles. Quad Strip Each 2 vertices, create a quad using the 2 previous ones. A. Martinelli Pipeline 30 settembre / 42

53 Rendering Primitives Polygon Geometric Properties N Vertices {V 1,V 2,V 3,V 4,...,V N } IT IS NOT necessary for such vertices to be on the same plane!! Rendering Properties Same as triangles. A. Martinelli Pipeline 30 settembre / 42

54 Unit Volume, Clipping and Viewport Transform The Rendering Pipeline (1) Rendering Architecture First Rendering Pipeline Rendering Primitives Unit Volume, Clipping and Viewport Transform Scan-Line and Z-Buffer Algorithms A Simplified Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware A. Martinelli Pipeline 30 settembre / 42

55 Unit Volume, Clipping and Viewport Transform Unit Volume Unit Volume The Unit Volume is the space, usually a Cube, which contains what can be seen Whatever is put inside the cube, is not visible Our Rendering Engine will project all the primitives to the Frontal Face of the Cube In OpenGL the Unit Volume is the Cube with extremes [-1,1]x[-1,1]x[-1,1] A. Martinelli Pipeline 30 settembre / 42

56 Unit Volume, Clipping and Viewport Transform Clipping Clipping is the operation cutting or eliminating all the geometries not being entirely inside the Unit Volume. Discarded Tessellated Kept A. Martinelli Pipeline 30 settembre / 42

57 Unit Volume, Clipping and Viewport Transform Viewport Transform(1/2) From the Unit Volume to the Final Image Clipping: each geometry not being entirely contained into the Unit Volume, is tasselleted or thrown away. Projection: 3D primitives are projected through the z axis to the frontal face, and they become 2D Primitives. Viewport Transform: converts Unit Volume Coordinates into Image Coordinates Clipping Projection Viewport Note Before Viewport Transform, we have 3D vertices (which may have a colour property associated) After Viewport Transform, we have 2D vertices which have a z-properties associated (and may also have a colour property) A. Martinelli Pipeline 30 settembre / 42

58 Unit Volume, Clipping and Viewport Transform Viewport Transform(2/2) Viewport Transform width,height: width and height of the image area to be drawn x VP,y VP : position of the area X im = x VP + (1+x) width 2 Y im = y VP + (1 y) height 2 a+b place the viewport. place the viewport. Note The Front Face of the Unit Volume is a square, but the viewport may not be squared. So, our geometries may seems stretched. This effect must be balanced applying proper coordinates transforms, as we will see in a following lectures. A. Martinelli Pipeline 30 settembre / 42

59 Unit Volume, Clipping and Viewport Transform The Rendering Pipeline (1) Rendering Architecture First Rendering Pipeline Rendering Primitives Unit Volume, Clipping and Viewport Transform Scan-Line and Z-Buffer Algorithms A Simplified Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware A. Martinelli Pipeline 30 settembre / 42

60 Unit Volume, Clipping and Viewport Transform Scan-Line Algorithm (1/3) Rasterization We are going to see only one Rasterization Algorithm: the scan-line algorithm, which draws geometries like triangles. This algorithm works in a 2D space. A. Martinelli Pipeline 30 settembre / 42

61 Unit Volume, Clipping and Viewport Transform Scan-Line Algorithm (1/3) Rasterization We are going to see only one Rasterization Algorithm: the scan-line algorithm, which draws geometries like triangles. This algorithm works in a 2D space. Input given 3 vertices A.xy,B.xy,C.xy in the image-space given a z property of each vertex given a colour property of each vertex (with an active colour interpolation) A. Martinelli Pipeline 30 settembre / 42

62 Unit Volume, Clipping and Viewport Transform Scan-Line Algorithm (1/3) Rasterization We are going to see only one Rasterization Algorithm: the scan-line algorithm, which draws geometries like triangles. This algorithm works in a 2D space. Input given 3 vertices A.xy,B.xy,C.xy in the image-space given a z property of each vertex given a colour property of each vertex (with an active colour interpolation) NOTE The one presented here is a very simplified model, whose aim is to understand some of the most important aspects of the Rendering Process. A. Martinelli Pipeline 30 settembre / 42

63 Unit Volume, Clipping and Viewport Transform Scan-Line Algorithm (2/3) Algorithm They are evaluated the maximum and minimum values for y y Max y Max y Max x Min,CZ min x Max,CZ max x Min,CZ min y K x Max,CZ max y K y Min y Min y Min A. Martinelli Pipeline 30 settembre / 42

64 Unit Volume, Clipping and Viewport Transform Scan-Line Algorithm (2/3) Algorithm They are evaluated the maximum and minimum values for y For each value y within the range, with step 1 px, they are evaluated the maximum and minimum values for x y Max y Max y Max x Min,CZ min x Max,CZ max x Min,CZ min y K x Max,CZ max y K y Min y Min y Min A. Martinelli Pipeline 30 settembre / 42

65 Unit Volume, Clipping and Viewport Transform Scan-Line Algorithm (2/3) Algorithm They are evaluated the maximum and minimum values for y For each value y within the range, with step 1 px, they are evaluated the maximum and minimum values for x y Max y Max y Max x Min,CZ min x Max,CZ max x Min,CZ min y K x Max,CZ max y K y Min y Min y Min A. Martinelli Pipeline 30 settembre / 42

66 Unit Volume, Clipping and Viewport Transform Scan-Line Algorithm (2/3) Algorithm They are evaluated the maximum and minimum values for y For each value y within the range, with step 1 px, they are evaluated the maximum and minimum values for x For each pixel in the y direaction, from the minumum to the maximum of x, a line is generated. And the each pixel on that line, another linear interpolation process evaluates a depth-z and a colour value y Max y Max y Max x Min,CZ min x Max,CZ max x Min,CZ min y K x Max,CZ max y K y Min y Min y Min A. Martinelli Pipeline 30 settembre / 42

67 Unit Volume, Clipping and Viewport Transform Scan-Line Algorithm (3/3) Output (x,y): coordinates of a pixel in the image c: colour for that pixel z: a depth value related to that coordinates. ATTENTION!! For each triangle a lot of Fragments got generated. A. Martinelli Pipeline 30 settembre / 42

68 Unit Volume, Clipping and Viewport Transform Scan-Line: More Triangles Big Issue If we have 2 fragments from 2 different triangles on the same pixel (x,y), what colour should i use? Painter Algorithm Order all triangles from the farthest to the nearest and i draw all triangles in that order If a new triangle is drawing other already drawn pixels, the get overwritten Problems: Its not easy to keep an ordered list of all the triangles It Treats depth at triangles granularity, so only one depth value per triangle should be used A. Martinelli Pipeline 30 settembre / 42

69 Unit Volume, Clipping and Viewport Transform Z-Buffer (Depth-Buffer) Algorithm(1/3) A Z-Buffer is a matrix with same dimensions as the image used to store depth values. A. Martinelli Pipeline 30 settembre / 42

70 Unit Volume, Clipping and Viewport Transform Z-Buffer (Depth-Buffer) Algorithm(1/3) A Z-Buffer is a matrix with same dimensions as the image used to store depth values. The matrix is initialized in each position with a value meaning far far away A. Martinelli Pipeline 30 settembre / 42

71 Unit Volume, Clipping and Viewport Transform Z-Buffer (Depth-Buffer) Algorithm(1/3) A Z-Buffer is a matrix with same dimensions as the image used to store depth values. The matrix is initialized in each position with a value meaning far far away each Fragment will be affected by the Depth Test. Depth Test Positive Test : if the z/depth value in the Fragment is lesser (nearest) to the value in the same position of the Z-Buffer, than the Fragment is accepted A. Martinelli Pipeline 30 settembre / 42

72 Unit Volume, Clipping and Viewport Transform Z-Buffer (Depth-Buffer) Algorithm(1/3) A Z-Buffer is a matrix with same dimensions as the image used to store depth values. The matrix is initialized in each position with a value meaning far far away each Fragment will be affected by the Depth Test. Depth Test Positive Test : if the z/depth value in the Fragment is lesser (nearest) to the value in the same position of the Z-Buffer, than the Fragment is accepted Negative Test : if the z/depth value in the Fragment is greater (farther) to the value in the same position of the Z-Buffer, than the Fragment is discarded. A. Martinelli Pipeline 30 settembre / 42

73 Unit Volume, Clipping and Viewport Transform Z-Buffer (Depth-Buffer) Algorithm(2/3) (x,y) Fragments (x,y+1) (x,y) (x,y+1) (x,y) (x,y+1) A. Martinelli Pipeline 30 settembre / 42

74 Unit Volume, Clipping and Viewport Transform Z-Buffer (Depth-Buffer) Algorithm(3/3) The Z-Buffer Algorithm allows a depths management having the precision of the pixel. This allows the rendering of intersections between triangles. The Z-Buffer precision is related to the number of bits used to represent depth values in the buffer, usually 16 bits. glenable(gl DEPTH TEST): enables the Depth-Test gldisable(gl DEPTH TEST) : disable the Depth-Test (that does not exactly means we are using the Painter Algorithm) A. Martinelli Pipeline 30 settembre / 42

75 Unit Volume, Clipping and Viewport Transform The Rendering Pipeline (1) Rendering Architecture First Rendering Pipeline Rendering Primitives Unit Volume, Clipping and Viewport Transform Scan-Line and Z-Buffer Algorithms A Simplified Rendering Pipeline Second Pipeline: Illumination and Shading Third Pipeline: Coordinates Transforms Fourth Pipeline: Texturing Fifth Pipeline: Memory Structures Programmable Graphics Hardware A. Martinelli Pipeline 30 settembre / 42

76 Unit Volume, Clipping and Viewport Transform A Simplified Rendering Pipeline (1/2) Pipeline A machine built of serial operative stages Each stage make its own task on a set of data The operative stages will work parallelly on different data sets A. Martinelli Pipeline 30 settembre / 42

77 Unit Volume, Clipping and Viewport Transform A Simplified Rendering Pipeline (1/2) Pipeline A machine built of serial operative stages Each stage make its own task on a set of data The operative stages will work parallelly on different data sets A. Martinelli Pipeline 30 settembre / 42

78 Unit Volume, Clipping and Viewport Transform A Simplified Rendering Pipeline (2/2) Pipeline State State Variable: a Rendering Property setted with the API. Its value is kept through different executions of the same stage. State Variables work on different stages Geometry: a set of Primitives built from a list of ordered vertices. In the former OpenGL the list was delimited by Begin/End instructions. A. Martinelli Pipeline 30 settembre / 42

79 Unit Volume, Clipping and Viewport Transform A Simplified Rendering Pipeline (2/2) Pipeline State State Variable: a Rendering Property setted with the API. Its value is kept through different executions of the same stage. State Variables work on different stages Geometry: a set of Primitives built from a list of ordered vertices. In the former OpenGL the list was delimited by Begin/End instructions. A. Martinelli Pipeline 30 settembre / 42

80 Unit Volume, Clipping and Viewport Transform A Simplified Rendering Pipeline (2/2) Pipeline State State Variable: a Rendering Property setted with the API. Its value is kept through different executions of the same stage. State Variables work on different stages Geometry: a set of Primitives built from a list of ordered vertices. In the former OpenGL the list was delimited by Begin/End instructions. Pipeline Instructions Vertex: Most important command, asking the pipeline to manage a new vertex. Vertex-Properties: like colour, in the Former OpenGL they were managed as special State Variable State Variable: the Rendering Properties should be constant during the drawing process of each single geometry. A. Martinelli Pipeline 30 settembre / 42

81 Unit Volume, Clipping and Viewport Transform Simplified Rendering Pipeline Structure Vertex Stream (x,c,z)min ymax (x,c,z)max y Primitives Manager Rastering Module ymin Fragments( (x,y),(c,z) ) Clipping, Viewport Transform Z-Buffering Module write read(z-test) Color Buffer Z-Buffer A. Martinelli Pipeline 30 settembre / 42

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 Announcements Project 2 due Friday, October 11

More information

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11 Pipeline Operations CS 4620 Lecture 11 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives to pixels RASTERIZATION

More information

Rasterization Overview

Rasterization Overview Rendering Overview The process of generating an image given a virtual camera objects light sources Various techniques rasterization (topic of this course) raytracing (topic of the course Advanced Computer

More information

Graphics Programming

Graphics Programming Graphics Programming 3 rd Week, 2011 OpenGL API (1) API (application programming interface) Interface between an application program and a graphics system Application Program OpenGL API Graphics Library

More information

Pipeline Operations. CS 4620 Lecture 14

Pipeline Operations. CS 4620 Lecture 14 Pipeline Operations CS 4620 Lecture 14 2014 Steve Marschner 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives

More information

Rendering Objects. Need to transform all geometry then

Rendering Objects. Need to transform all geometry then Intro to OpenGL Rendering Objects Object has internal geometry (Model) Object relative to other objects (World) Object relative to camera (View) Object relative to screen (Projection) Need to transform

More information

CS451Real-time Rendering Pipeline

CS451Real-time Rendering Pipeline 1 CS451Real-time Rendering Pipeline JYH-MING LIEN DEPARTMENT OF COMPUTER SCIENCE GEORGE MASON UNIVERSITY Based on Tomas Akenine-Möller s lecture note You say that you render a 3D 2 scene, but what does

More information

Spring 2009 Prof. Hyesoon Kim

Spring 2009 Prof. Hyesoon Kim Spring 2009 Prof. Hyesoon Kim Application Geometry Rasterizer CPU Each stage cane be also pipelined The slowest of the pipeline stage determines the rendering speed. Frames per second (fps) Executes on

More information

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015 CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015 Announcements Project 2 due tomorrow at 2pm Grading window

More information

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Homework project #2 due this Friday, October

More information

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline Computergrafik Today Rendering pipeline s View volumes, clipping Viewport Matthias Zwicker Universität Bern Herbst 2008 Rendering pipeline Rendering pipeline Hardware & software that draws 3D scenes on

More information

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane Rendering Pipeline Rendering Converting a 3D scene to a 2D image Rendering Light Camera 3D Model View Plane Rendering Converting a 3D scene to a 2D image Basic rendering tasks: Modeling: creating the world

More information

Pipeline Operations. CS 4620 Lecture 10

Pipeline Operations. CS 4620 Lecture 10 Pipeline Operations CS 4620 Lecture 10 2008 Steve Marschner 1 Hidden surface elimination Goal is to figure out which color to make the pixels based on what s in front of what. Hidden surface elimination

More information

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside CS230 : Computer Graphics Lecture 4 Tamar Shinar Computer Science & Engineering UC Riverside Shadows Shadows for each pixel do compute viewing ray if ( ray hits an object with t in [0, inf] ) then compute

More information

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing EECE 478 Rasterization & Scenes Rasterization Learning Objectives Be able to describe the complete graphics pipeline. Describe the process of rasterization for triangles and lines. Compositing Manipulate

More information

VISIBILITY & CULLING. Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH

VISIBILITY & CULLING. Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH VISIBILITY & CULLING Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH Visibility Visibility Given a set of 3D objects, which surfaces are visible from a specific point

More information

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into 2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into the viewport of the current application window. A pixel

More information

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

COMP30019 Graphics and Interaction Rendering pipeline & object modelling COMP30019 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Lecture outline Introduction to Modelling Polygonal geometry The rendering

More information

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling Lecture outline COMP30019 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Introduction to Modelling Polygonal geometry The rendering

More information

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL OpenGL: Open Graphics Library Introduction to OpenGL Part II CS 351-50 Graphics API ( Application Programming Interface) Software library Layer between programmer and graphics hardware (and other software

More information

Computer Graphics with OpenGL ES (J. Han) Chapter VII Rasterizer

Computer Graphics with OpenGL ES (J. Han) Chapter VII Rasterizer Chapter VII Rasterizer Rasterizer The vertex shader passes the clip-space vertices to the rasterizer, which performs the following: Clipping Perspective division Back-face culling Viewport transform Scan

More information

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18 CS 498 VR Lecture 18-4/4/18 go.illinois.edu/vrlect18 Review and Supplement for last lecture 1. What is aliasing? What is Screen Door Effect? 2. How image-order rendering works? 3. If there are several

More information

Spring 2011 Prof. Hyesoon Kim

Spring 2011 Prof. Hyesoon Kim Spring 2011 Prof. Hyesoon Kim Application Geometry Rasterizer CPU Each stage cane be also pipelined The slowest of the pipeline stage determines the rendering speed. Frames per second (fps) Executes on

More information

Hidden surface removal. Computer Graphics

Hidden surface removal. Computer Graphics Lecture Hidden Surface Removal and Rasterization Taku Komura Hidden surface removal Drawing polygonal faces on screen consumes CPU cycles Illumination We cannot see every surface in scene We don t want

More information

CS4620/5620: Lecture 14 Pipeline

CS4620/5620: Lecture 14 Pipeline CS4620/5620: Lecture 14 Pipeline 1 Rasterizing triangles Summary 1! evaluation of linear functions on pixel grid 2! functions defined by parameter values at vertices 3! using extra parameters to determine

More information

CSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Project 2 due Friday, October 12

More information

Graphics and Interaction Rendering pipeline & object modelling

Graphics and Interaction Rendering pipeline & object modelling 433-324 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Lecture outline Introduction to Modelling Polygonal geometry The rendering

More information

Computer graphic -- Programming with OpenGL I

Computer graphic -- Programming with OpenGL I Computer graphic -- Programming with OpenGL I A simple example using OpenGL Download the example code "basic shapes", and compile and run it Take a look at it, and hit ESC when you're done. It shows the

More information

Ciril Bohak. - INTRODUCTION TO WEBGL

Ciril Bohak. - INTRODUCTION TO WEBGL 2016 Ciril Bohak ciril.bohak@fri.uni-lj.si - INTRODUCTION TO WEBGL What is WebGL? WebGL (Web Graphics Library) is an implementation of OpenGL interface for cmmunication with graphical hardware, intended

More information

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT COMP27112 Computer Graphics and Image Processing 2: Introducing image synthesis Toby.Howard@manchester.ac.uk 1 Introduction In these notes we ll cover: Some orientation how did we get here? Graphics system

More information

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T Copyright 2018 Sung-eui Yoon, KAIST freely available on the internet http://sglab.kaist.ac.kr/~sungeui/render

More information

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside CS130 : Computer Graphics Tamar Shinar Computer Science & Engineering UC Riverside Raster Devices and Images Raster Devices Hearn, Baker, Carithers Raster Display Transmissive vs. Emissive Display anode

More information

4: Polygons and pixels

4: Polygons and pixels COMP711 Computer Graphics and Image Processing 4: Polygons and pixels Toby.Howard@manchester.ac.uk 1 Introduction We ll look at Properties of polygons: convexity, winding, faces, normals Scan conversion

More information

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE UGRAD.CS.UBC.C A/~CS314 Mikhail Bessmeltsev 1 WHAT IS RENDERING? Generating image from a 3D scene 2 WHAT IS RENDERING? Generating image

More information

Could you make the XNA functions yourself?

Could you make the XNA functions yourself? 1 Could you make the XNA functions yourself? For the second and especially the third assignment, you need to globally understand what s going on inside the graphics hardware. You will write shaders, which

More information

Rendering Pipeline and Coordinates Transforms

Rendering Pipeline and Coordinates Transforms Rendering Pipeline and Coordinates Transforms Alessandro Martinelli alessandro.martinelli@unipv.it 16 October 2013 Rendering Pipeline (3): Coordinates Transforms Rendering Architecture First Rendering

More information

CS 130 Exam I. Fall 2015

CS 130 Exam I. Fall 2015 S 3 Exam I Fall 25 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying

More information

CS 4620 Program 3: Pipeline

CS 4620 Program 3: Pipeline CS 4620 Program 3: Pipeline out: Wednesday 14 October 2009 due: Friday 30 October 2009 1 Introduction In this assignment, you will implement several types of shading in a simple software graphics pipeline.

More information

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI Tutorial on GPU Programming #2 Joong-Youn Lee Supercomputing Center, KISTI Contents Graphics Pipeline Vertex Programming Fragment Programming Introduction to Cg Language Graphics Pipeline The process to

More information

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline Last Time? The Traditional Graphics Pipeline Participating Media Measuring BRDFs 3D Digitizing & Scattering BSSRDFs Monte Carlo Simulation Dipole Approximation Today Ray Casting / Tracing Advantages? Ray

More information

CHAPTER 1 Graphics Systems and Models 3

CHAPTER 1 Graphics Systems and Models 3 ?????? 1 CHAPTER 1 Graphics Systems and Models 3 1.1 Applications of Computer Graphics 4 1.1.1 Display of Information............. 4 1.1.2 Design.................... 5 1.1.3 Simulation and Animation...........

More information

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura Computer Graphics Lecture 9 Hidden Surface Removal Taku Komura 1 Why Hidden Surface Removal? A correct rendering requires correct visibility calculations When multiple opaque polygons cover the same screen

More information

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored.

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored. From Vertices to Fragments: Rasterization Reading Assignment: Chapter 7 Frame Buffer Special memory where pixel colors are stored. System Bus CPU Main Memory Graphics Card -- Graphics Processing Unit (GPU)

More information

CS 428: Fall Introduction to. OpenGL primer. Andrew Nealen, Rutgers, /13/2010 1

CS 428: Fall Introduction to. OpenGL primer. Andrew Nealen, Rutgers, /13/2010 1 CS 428: Fall 2010 Introduction to Computer Graphics OpenGL primer Andrew Nealen, Rutgers, 2010 9/13/2010 1 Graphics hardware Programmable {vertex, geometry, pixel} shaders Powerful GeForce 285 GTX GeForce480

More information

The Graphics Pipeline

The Graphics Pipeline The Graphics Pipeline Ray Tracing: Why Slow? Basic ray tracing: 1 ray/pixel Ray Tracing: Why Slow? Basic ray tracing: 1 ray/pixel But you really want shadows, reflections, global illumination, antialiasing

More information

CS 130 Final. Fall 2015

CS 130 Final. Fall 2015 CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying

More information

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1 UNIVERSITY OF EAST ANGLIA School of Computing Sciences Main Series PG Examination 2013-14 COMPUTER GAMES DEVELOPMENT CMPSME27 Time allowed: 2 hours Answer any THREE questions. (40 marks each) Notes are

More information

CS130 : Computer Graphics Lecture 2: Graphics Pipeline. Tamar Shinar Computer Science & Engineering UC Riverside

CS130 : Computer Graphics Lecture 2: Graphics Pipeline. Tamar Shinar Computer Science & Engineering UC Riverside CS130 : Computer Graphics Lecture 2: Graphics Pipeline Tamar Shinar Computer Science & Engineering UC Riverside Raster Devices and Images Raster Devices - raster displays show images as a rectangular array

More information

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline Final Projects Proposals due Thursday 4/8 Proposed project summary At least 3 related papers (read & summarized) Description of series of test cases Timeline & initial task assignment The Traditional Graphics

More information

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal Overview Pipeline implementation I Preliminaries Clipping Line clipping Hidden Surface removal Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives

More information

Performance OpenGL Programming (for whatever reason)

Performance OpenGL Programming (for whatever reason) Performance OpenGL Programming (for whatever reason) Mike Bailey Oregon State University Performance Bottlenecks In general there are four places a graphics system can become bottlenecked: 1. The computer

More information

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker CMSC427 Transformations II: Viewing Credit: some slides from Dr. Zwicker What next? GIVEN THE TOOLS OF The standard rigid and affine transformations Their representation with matrices and homogeneous coordinates

More information

(Refer Slide Time 05:03 min)

(Refer Slide Time 05:03 min) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture # 27 Visible Surface Detection (Contd ) Hello and welcome everybody to the

More information

TSBK03 Screen-Space Ambient Occlusion

TSBK03 Screen-Space Ambient Occlusion TSBK03 Screen-Space Ambient Occlusion Joakim Gebart, Jimmy Liikala December 15, 2013 Contents 1 Abstract 1 2 History 2 2.1 Crysis method..................................... 2 3 Chosen method 2 3.1 Algorithm

More information

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer Real-Time Rendering (Echtzeitgraphik) Michael Wimmer wimmer@cg.tuwien.ac.at Walking down the graphics pipeline Application Geometry Rasterizer What for? Understanding the rendering pipeline is the key

More information

WebGL (Web Graphics Library) is the new standard for 3D graphics on the Web, designed for rendering 2D graphics and interactive 3D graphics.

WebGL (Web Graphics Library) is the new standard for 3D graphics on the Web, designed for rendering 2D graphics and interactive 3D graphics. About the Tutorial WebGL (Web Graphics Library) is the new standard for 3D graphics on the Web, designed for rendering 2D graphics and interactive 3D graphics. This tutorial starts with a basic introduction

More information

CS 465 Program 4: Modeller

CS 465 Program 4: Modeller CS 465 Program 4: Modeller out: 30 October 2004 due: 16 November 2004 1 Introduction In this assignment you will work on a simple 3D modelling system that uses simple primitives and curved surfaces organized

More information

Module 13C: Using The 3D Graphics APIs OpenGL ES

Module 13C: Using The 3D Graphics APIs OpenGL ES Module 13C: Using The 3D Graphics APIs OpenGL ES BREW TM Developer Training Module Objectives See the steps involved in 3D rendering View the 3D graphics capabilities 2 1 3D Overview The 3D graphics library

More information

THE AUSTRALIAN NATIONAL UNIVERSITY Final Examinations(Semester 2) COMP4610/COMP6461 (Computer Graphics) Final Exam

THE AUSTRALIAN NATIONAL UNIVERSITY Final Examinations(Semester 2) COMP4610/COMP6461 (Computer Graphics) Final Exam THE AUSTRALIAN NATIONAL UNIVERSITY Final Examinations(Semester 2) 2009 COMP4610/COMP6461 (Computer Graphics) Final Exam Writing Period: 3 hours duration Study Period: 15 minutes duration - you may read

More information

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment Notes on Assignment Notes on Assignment Objects on screen - made of primitives Primitives are points, lines, polygons - watch vertex ordering The main object you need is a box When the MODELVIEW matrix

More information

Geometry Primitives. Computer Science Department University of Malta. Sandro Spina Computer Graphics and Simulation Group. CGSG Geometry Primitives

Geometry Primitives. Computer Science Department University of Malta. Sandro Spina Computer Graphics and Simulation Group. CGSG Geometry Primitives Geometry Primitives Sandro Spina Computer Graphics and Simulation Group Computer Science Department University of Malta 1 The Building Blocks of Geometry The objects in our virtual worlds are composed

More information

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science CSC 307 1.0 Graphics Programming Department of Statistics and Computer Science Graphics Programming 2 Common Uses for Computer Graphics Applications for real-time 3D graphics range from interactive games

More information

CS 112 The Rendering Pipeline. Slide 1

CS 112 The Rendering Pipeline. Slide 1 CS 112 The Rendering Pipeline Slide 1 Rendering Pipeline n Input 3D Object/Scene Representation n Output An image of the input object/scene n Stages (for POLYGON pipeline) n Model view Transformation n

More information

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches: Surface Graphics Objects are explicitely defined by a surface or boundary representation (explicit inside vs outside) This boundary representation can be given by: - a mesh of polygons: 200 polys 1,000

More information

COMP3421 Computer Graphics

COMP3421 Computer Graphics COMP3421 Computer Graphics Introduction Angela Finlayson Email: angf@cse.unsw.edu.au Computer Graphics Algorithms to automatically render images from models. Light Camera hi mum Objects model image Computer

More information

Models and Architectures

Models and Architectures Models and Architectures Objectives Learn the basic design of a graphics system Introduce graphics pipeline architecture Examine software components for an interactive graphics system 1 Image Formation

More information

Drawing Fast The Graphics Pipeline

Drawing Fast The Graphics Pipeline Drawing Fast The Graphics Pipeline CS559 Fall 2015 Lecture 9 October 1, 2015 What I was going to say last time How are the ideas we ve learned about implemented in hardware so they are fast. Important:

More information

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline Last Time? The Traditional Graphics Pipeline Reading for Today A Practical Model for Subsurface Light Transport, Jensen, Marschner, Levoy, & Hanrahan, SIGGRAPH 2001 Participating Media Measuring BRDFs

More information

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU FROM VERTICES TO FRAGMENTS Lecture 5 Comp3080 Computer Graphics HKBU OBJECTIVES Introduce basic implementation strategies Clipping Scan conversion OCTOBER 9, 2011 2 OVERVIEW At end of the geometric pipeline,

More information

3D Graphics and OpenGl. First Steps

3D Graphics and OpenGl. First Steps 3D Graphics and OpenGl First Steps Rendering of 3D Graphics Objects defined in (virtual/mathematical) 3D space. Rendering of 3D Graphics Objects defined in (virtual/mathematical) 3D space. We see surfaces

More information

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms Visible Surface Determination Visibility Culling Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms Divide-and-conquer strategy:

More information

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3) Computer Graphics (Fall 2008) COMS 4160, Lecture 9: OpenGL 1 http://www.cs.columbia.edu/~cs4160 To Do Start thinking (now) about HW 3. Milestones are due soon. Course Course 3D Graphics Pipeline 3D Graphics

More information

Drawing Fast The Graphics Pipeline

Drawing Fast The Graphics Pipeline Drawing Fast The Graphics Pipeline CS559 Spring 2016 Lecture 10 February 25, 2016 1. Put a 3D primitive in the World Modeling Get triangles 2. Figure out what color it should be Do ligh/ng 3. Position

More information

Texture Mapping. Texture (images) lecture 16. Texture mapping Aliasing (and anti-aliasing) Adding texture improves realism.

Texture Mapping. Texture (images) lecture 16. Texture mapping Aliasing (and anti-aliasing) Adding texture improves realism. lecture 16 Texture mapping Aliasing (and anti-aliasing) Texture (images) Texture Mapping Q: Why do we need texture mapping? A: Because objects look fake and boring without it. Adding texture improves realism.

More information

lecture 16 Texture mapping Aliasing (and anti-aliasing)

lecture 16 Texture mapping Aliasing (and anti-aliasing) lecture 16 Texture mapping Aliasing (and anti-aliasing) Texture (images) Texture Mapping Q: Why do we need texture mapping? A: Because objects look fake and boring without it. Adding texture improves realism.

More information

Institutionen för systemteknik

Institutionen för systemteknik Code: Day: Lokal: M7002E 19 March E1026 Institutionen för systemteknik Examination in: M7002E, Computer Graphics and Virtual Environments Number of sections: 7 Max. score: 100 (normally 60 is required

More information

Motivation. Culling Don t draw what you can t see! What can t we see? Low-level Culling

Motivation. Culling Don t draw what you can t see! What can t we see? Low-level Culling Motivation Culling Don t draw what you can t see! Thomas Larsson Mälardalen University April 7, 2016 Image correctness Rendering speed One day we will have enough processing power!? Goals of real-time

More information

OpenGL SUPERBIBLE. Fifth Edition. Comprehensive Tutorial and Reference. Richard S. Wright, Jr. Nicholas Haemel Graham Sellers Benjamin Lipchak

OpenGL SUPERBIBLE. Fifth Edition. Comprehensive Tutorial and Reference. Richard S. Wright, Jr. Nicholas Haemel Graham Sellers Benjamin Lipchak OpenGL SUPERBIBLE Fifth Edition Comprehensive Tutorial and Reference Richard S. Wright, Jr. Nicholas Haemel Graham Sellers Benjamin Lipchak AAddison-Wesley Upper Saddle River, NJ Boston Indianapolis San

More information

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters.

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters. 1 2 Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters. Crowd rendering in large environments presents a number of challenges,

More information

Graphics Hardware. Instructor Stephen J. Guy

Graphics Hardware. Instructor Stephen J. Guy Instructor Stephen J. Guy Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability! Programming Examples Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability!

More information

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Spatial Data Structures and Speed-Up Techniques Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Spatial data structures What is it? Data structure that organizes

More information

World Coordinate System

World Coordinate System World Coordinate System Application Model Application Program Graphics System Workstation Normally, the User or Object Coordinate System. World Coordinate Window: A subset of the world coordinate system,

More information

Introduction to Visualization and Computer Graphics

Introduction to Visualization and Computer Graphics Introduction to Visualization and Computer Graphics DH2320, Fall 2015 Prof. Dr. Tino Weinkauf Introduction to Visualization and Computer Graphics Visibility Shading 3D Rendering Geometric Model Color Perspective

More information

The Rasterization Pipeline

The Rasterization Pipeline Lecture 5: The Rasterization Pipeline (and its implementation on GPUs) Computer Graphics CMU 15-462/15-662, Fall 2015 What you know how to do (at this point in the course) y y z x (w, h) z x Position objects

More information

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 11794--4400 Tel: (631)632-8450; Fax: (631)632-8334

More information

Normalized Device Coordinate System (NDC) World Coordinate System. Example Coordinate Systems. Device Coordinate System

Normalized Device Coordinate System (NDC) World Coordinate System. Example Coordinate Systems. Device Coordinate System World Coordinate System Normalized Device Coordinate System (NDC) Model Program Graphics System Workstation Model Program Graphics System Workstation Normally, the User or Object Coordinate System. World

More information

3D Rasterization II COS 426

3D Rasterization II COS 426 3D Rasterization II COS 426 3D Rendering Pipeline (for direct illumination) 3D Primitives Modeling Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation

More information

Adaptive Point Cloud Rendering

Adaptive Point Cloud Rendering 1 Adaptive Point Cloud Rendering Project Plan Final Group: May13-11 Christopher Jeffers Eric Jensen Joel Rausch Client: Siemens PLM Software Client Contact: Michael Carter Adviser: Simanta Mitra 4/29/13

More information

CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications

CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-4400 Tel: (631)632-8450; Fax:

More information

E.Order of Operations

E.Order of Operations Appendix E E.Order of Operations This book describes all the performed between initial specification of vertices and final writing of fragments into the framebuffer. The chapters of this book are arranged

More information

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1 X. GPU Programming 320491: Advanced Graphics - Chapter X 1 X.1 GPU Architecture 320491: Advanced Graphics - Chapter X 2 GPU Graphics Processing Unit Parallelized SIMD Architecture 112 processing cores

More information

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17]

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17] 6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, 2011 9:05-12pm Two hand-written sheet of notes (4 pages) allowed NAME: 1 / 17 2 / 12 3 / 35 4 / 8 5 / 18 Total / 90 1 SSD [ /17]

More information

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department CSE 690: GPGPU Lecture 2: Understanding the Fabric - Intro to Graphics Klaus Mueller Stony Brook University Computer Science Department Klaus Mueller, Stony Brook 2005 1 Surface Graphics Objects are explicitely

More information

Lecture 2. Shaders, GLSL and GPGPU

Lecture 2. Shaders, GLSL and GPGPU Lecture 2 Shaders, GLSL and GPGPU Is it interesting to do GPU computing with graphics APIs today? Lecture overview Why care about shaders for computing? Shaders for graphics GLSL Computing with shaders

More information

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION INTRODUCTION OBJECTIVE: This chapter deals the applications of computer graphics and overview of graphics systems and imaging. UNIT I 1 With clear

More information

Surface shading: lights and rasterization. Computer Graphics CSE 167 Lecture 6

Surface shading: lights and rasterization. Computer Graphics CSE 167 Lecture 6 Surface shading: lights and rasterization Computer Graphics CSE 167 Lecture 6 CSE 167: Computer Graphics Surface shading Materials Lights Rasterization 2 Scene data Rendering pipeline Modeling and viewing

More information

Graphics for VEs. Ruth Aylett

Graphics for VEs. Ruth Aylett Graphics for VEs Ruth Aylett Overview VE Software Graphics for VEs The graphics pipeline Projections Lighting Shading Runtime VR systems Two major parts: initialisation and update loop. Initialisation

More information

The Application Stage. The Game Loop, Resource Management and Renderer Design

The Application Stage. The Game Loop, Resource Management and Renderer Design 1 The Application Stage The Game Loop, Resource Management and Renderer Design Application Stage Responsibilities 2 Set up the rendering pipeline Resource Management 3D meshes Textures etc. Prepare data

More information

Chapter 5. Projections and Rendering

Chapter 5. Projections and Rendering Chapter 5 Projections and Rendering Topics: Perspective Projections The rendering pipeline In order to view manipulate and view a graphics object we must find ways of storing it a computer-compatible way.

More information

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018 CSE 167: Introduction to Computer Graphics Lecture #9: Visibility Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018 Announcements Midterm Scores are on TritonEd Exams to be

More information