1 / 19

GameFX C# / DirectX 2005

GameFX C# / DirectX 2005. The Rendering Pipeline. The Rendering Pipeline …. … what an „end user“ sees. The Rendering Pipeline …. … in pictures. User / Driver. Vertex Stage. Pixel Stage. Texture 0. Texture 1. Texture 2. Texture 3. Overview. Transform & Lighting. Rasterizer.

aliya
Download Presentation

GameFX C# / DirectX 2005

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GameFXC# / DirectX 2005 The Rendering Pipeline

  2. The Rendering Pipeline … … what an „end user“ sees. Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  3. The Rendering Pipeline … … in pictures Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  4. User / Driver Vertex Stage Pixel Stage Texture 0 Texture 1 Texture 2 Texture 3 Overview Transform & Lighting Rasterizer Texturing Blending/Ops Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  5. Objects in 3D world Geometry subsystem 2D primitives Raster subsystem Color image Rendering pipeline Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  6. Objects in 3D world Geometry subsystem 2D primitives Raster subsystem Color image Rendering pipeline Object coordinates Modelling transform affin World coordinates Model-View-Transformation Viewing transform affin Eye coordinates Normalizing transform Normalized (Clip-)coord. clipping 2D Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  7. Transformations • A transformation is like a function of a point • Modeling: • Define objects in „convenient“ coordinate systems • Multiply-instantiated geometry • Hierarchically defined linked figures • Viewing: • Window systems • Virtual camera • Perspective transformations Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  8. Point representation • Represent as row or column vector • Affects the kind of matrices we can multiply with Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  9. Transformation representation • Represent 2D transformations by a 2x2 matrix • If the point is a column vector • If the point is a row vector Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  10. Linear transformations • Scaling • Reflection S sx = sy uniform scaling Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  11. a Linear transformations • Shearing • Rotation around origin by 1 R(90°) Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  12. T Affine transformations • All linear transformations can be written as matrix multiplication • What about translation ? • We want to write homogeneous coordinates Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  13. General Camera Setup • Look at: • Position • Orientation • Frustum: • Camera parameters • Viewport: • 2D coordinate system Look at Frustum Viewport Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  14. Camera look at • Move camera C to originTranslate by –C • Build orthonormal frame„right“ R=DxU„zenith“ U=RxD • Adjust orientationRotation [R,U,D][X,Y,-Z] Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  15. Frustum y T t -z b B -n -f Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  16. User / Driver Vertex Stage Pixel Stage Texture 0 Texture 1 Texture 2 Texture 3 Overview Transform & Lighting Rasterizer Texturing Blending/Ops Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  17. Bresenham (Line Drawing) Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  18. Getting to Bresenham … /********************************* * Input: * xP: x-value of the startpoint * yP: y-value of the startpoint * xQ: x-value of the endpoint * yQ: y-value of the endpoint *********************************/ function drawLine(int xP, int yP, int xQ, int yQ) { x = xP; y = yP; d = 0; m = (yQ - yP) / (xQ - xP) while(true) { // put the pixel on the screen putPixel(x, y); if(x == xQ) break; x++; d += m; if(d > 0.5) { y++; d--; } } } Problem: • still floating point arithmetic Obersavtion: • m is rational • d is rational Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

  19. Bresenham … function drawLine(int xP, int yP, int xQ, int yQ) { x = xP; y = yP; D = 0; H = xQ - xP; c = 2 * H; M = 2 * (yQ - yP); while(true) { putPixel(x, y); if(x == xQ) break; x++; D += M; if(D > H) { y++; D -= c; } } } Introduce the following integer variables: Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group

More Related