Unformatted text preview:

Chapter 5.1 GraphicsOverviewFundamentalsFrame and Back BufferVisibility and Depth BufferStencil BufferTrianglesVerticesCoordinate SpacesCoordinate Spaces (2)Coordinate Spaces (3)Coordinate Spaces (4)TexturesShadersMaterialsHigh-Level OrganizationGameplay and RenderingRender ObjectsRender InstancesMeshesSkeletonsVolume PartitioningVolume Partitioning - PortalsVolume Partitioning – PortalsSlide 25Slide 26Slide 27Slide 28Slide 29Slide 30Slide 31Slide 32Volume Partitioning – BSPSlide 34Volume Partitioning: QuadtreeSlide 36Volume Partitioning - PVSSlide 38Slide 39Rendering PrimitivesStrips, Lists, FansStrips, Lists, Fans (2)Strips, Lists, Fans (3)Strips, Lists, Fans (4)Indexed PrimitivesThe Vertex CacheThe Vertex Cache (2)Quads and Point SpritesSlide 49Texture FormatsTexture Formats (2)Texture Formats (3)Texture Formats (4)Texture MappingTexture Mapping (2)Texture FilteringTexture Filtering (2)Texture Filtering (3)Rendering to TexturesLightingComponentsLighting EnvironmentLighting Environment (2)Multiple LightsMultiple Lights (2)Multiple Lights (3)Multiple Lights (4)Diffuse Material LightingNormal MapsPre-computed Radiance TransferSlide 71Slide 72Specular Material LightingSpecular Material Lighting (2)Specular Material Lighting (3)Specular Material Lighting (4)Environment MapsEnvironment Maps - 2Environment Maps - 3Hardware Rendering PipeSlide 81Input AssemblyVertex ShadingPrimitive Assembly, Cull, ClipProject, RasterizePixel ShadingZ, Stencil, Framebuffer BlendShader CharacteristicsShader LanguagesConclusionsConclusions (2)Chapter 5.1Graphics2OverviewFundamentalsHigh-Level OrganizationRendering PrimitivesTexturesLightingThe Hardware Rendering PipelineConclusions3FundamentalsFrame and Back BufferVisibility and Depth BufferStencil BufferTrianglesVerticesCoordinate SpacesTexturesShadersMaterials4Frame and Back BufferBoth hold pixel colorsFrame buffer is displayed on screenBack buffer is just a region of memoryImage is rendered to the back bufferHalf-drawn images are very distractingSwapped to the frame bufferMay be a swap, or may be a copyBack buffer is larger if anti-aliasingShrink and filter to frame buffer5Visibility and Depth BufferDepth buffer is same size as back bufferHolds a depth or “Z” valueOften called the “Z buffer”Pixels test their depth against existing valueIf greater, new pixel is further than existing pixelTherefore hidden by existing pixel – rejectedOtherwise, is in front, and therefore visibleOverwrites value in depth buffer and color in back bufferNo useful units for the depth valueBy convention, nearer means lower valueNon-linear mapping from world space6Stencil BufferUtility bufferUsually eight bits in sizeUsually interleaved with 24-bit depth bufferCan write to stencil bufferCan reject pixels based on comparison between existing value and referenceMany uses for masking and culling7TrianglesFundamental primitive of pipelinesEverything else constructed from them(except lines and point sprites)Three points define a planeTriangle plane is mapped with dataTexturesColors“Rasterized” to find pixels to draw8VerticesA vertex is a point in spacePlus other attribute dataColorsSurface normalTexture coordinatesWhatever data shader programs needTriangles use three verticesVertices shared between adjacent triangles9Coordinate SpacesWorld spaceArbitrary global game spaceObject spaceChild of world spaceOrigin at entity’s position and orientationVertex positions and normals stored in thisCamera spaceCamera’s version of “object” space10Coordinate Spaces (2)Clip spaceDistorted version of camera spaceEdges of screen make four side planesNear and far planesNeeded to control precision of depth bufferTotal of six clipping planesDistorted to make a cube in 4D clip spaceMakes clipping hardware simpler11Coordinate Spaces (3)EyeTriangles will be clippedCameraspacevisiblefrustumClipspacefrustum12Coordinate Spaces (4)Screen spaceClip space vertices projected to screen spaceActual pixels, ready for renderingTangent spaceDefined at each point on surface of meshUsually smoothly interpolated over surfaceNormal of surface is one axis“tangent” and “binormal” axes lie along surfaceTangent direction is controlled by artistUseful for lighting calculations13TexturesArray of texelsSame a pixel, but for a textureNominally R,G,B,A but can mean anything1D, 2D, 3D and “cube map” arrays2D is by far the most commonBasically just a 2D image bitmapOften square and power-of-2 in sizeCube map - six 2D arrays makes hollow cubeApproximates a hollow sphere of texels14ShadersA program run at each vertex or pixelGenerates pixel colors or vertex positionsRelatively small programsUsually tens or hundreds of instructionsExplicit parallelismNo direct communication between shaders“Extreme SIMD” programming modelHardware capabilities evolving rapidly15MaterialsDescription of how to render a triangleBig blob of data and stateVertex and pixel shadersTexturesGlobal variablesDescription of data held in verticesOther pipeline stateDoes not include actual vertex data16High-Level OrganizationGameplay and RenderingRender ObjectsRender InstancesMeshesSkeletonsVolume Partitioning17Gameplay and RenderingRendering speed varies according to sceneSome scenes more complex than othersTypically 15-60 frames per secondGameplay is constant speedCamera view should not change gameIn multiplayer, each person has a different view, but there is only one shared game1 update per second (RTS) to thousands (FPS)Keep the two as separate as possible!18Render ObjectsDescription of renderable object typeMesh data (triangles, vertices)Material data (shaders, textures, etc)Skeleton (+rig) for animationShared by multiple instances19Render InstancesA single entity in a worldReferences a render objectDecides what the object looks likePosition and orientationLighting stateAnimation state20MeshesTrianglesVerticesSingle material“Atomic unit of rendering”Not quite atomic, depending on hardwareSingle object may have multiple meshesEach with different shaders, textures, etc21SkeletonsSkeleton is a


View Full Document

GT CS 4455 - 41-Graphics

Download 41-Graphics
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view 41-Graphics and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view 41-Graphics 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?