Title: x86 and 3D graphics
1x86 and 3D graphics
2Quick Intro to 3D Graphics
- Glossary
- Vertex point in 3D space
- Triangle 3 connected vertices
- Object list of triangles that have the same
material properties (AKA Mesh) - Texture a 2D image that is wrapped on the
surface of a Mesh
3For Each Triangle...
- Geometry
- transform each vertex (FP)
- Lighting
- compute lighting from light sources and surface
properties (FP) - Rasterization
- setup triangle for rasterization (FP)
- perform shading texture mapping during triangle
fill (INT)
4Rendering Process
incident light
perspective projection
Mathematical models for light, objects
viewer create a 2D image via a 3D process
objects
5Coordinate Systems
6Transformation
- Transformantion change the coordinate system a
point lies in - Examples
- Viewing Transformation - translate objects to
viewer coordinate before projection to viewing
plane - Shadows - translate objects to light source
coordinates to calculate shadows
7Lighting Process
V
Surface
Diffuse Light scatters in all directions
Specular Light reflects in direction of
reflection vector R
8Rasterization
- Now that we have transformed and lit polygons
actually, the vertices... - And, we know where they appear on the screen
- We have to fill their interiors!
9Textures
Image maps to apply surfaces. Gives impression of
complex surface properties. Can substitute for
lots of polys (eg, tree bitmap on a single
rectangle, vs. thousands of leaf polys)
10Rasterization (again)
11Flat Fill
12Some lighting
13And textures
14Demo
15History of 3D Pipeline Partitioning
Software 3D Processor Does All
First Generation 3D HW Accelerators
2nd Generation HW (1998-99)
3rd Generation HW (1999-2000)
Application
Application
Application
Application
Geometry
Geometry
Geometry
Geometry
Lighting
Lighting
Lighting
Lighting
Edge Setup
Edge Setup
HW
HW
Edge Setup
Edge Setup
HW
Rasterization
Rasterization
Rasterization
Rasterization
16Memory BW The problem
- Frame buffer - 3MB
- Z buffer - 3MB
- For each object
- Mesh (vertices and triangle connectivity) 1KB
1MB - Texture(s) - 256KB
- Typical game frame 8MB 20MB
17AGP the Solution
- AGP (Accelerated Graphics Port)
- Larger BW than PCI
- Lower HW cost (less local RAM needed)
- Frame/Z buffers stored in graphics local memory
- Texturing from system memory
18Memory traffic when using AGP
19How does it work
The GART is mapping AGP memory address to the
system memory address (like paging HW in the CPU)
The AGP aperture is mapped as one chunk (11
mapping in CPUs paging HW), both the gfx chip
and the CPU reference the same addresses
20In the future
Multi-texturing More than one texture for
surface, used for details maps, reflections,
refractions, lighting tricks, etc.
21Programmable HW
Helps the developer in customizing its transform,
lighting and texture operations
22Programmable vertex machine
23Programmable HW demos
24backup
25Shading Techniques
- Polygon fill is done across the scanline
- Flat shading
- Color the whole polygon with one color
- Does not show highlights inside polygons
- Gouraud shading
- If the object surfaces are curved, we can
approximate it by polygons - Interpolating vertex intensity values along
scanline - Still does not show highlights inside polygons
26Texture Mapping
1. Texture coordinates (s,t,q) for each vertex.
These are interpolated along polygon edges. 2.
Texture coordinate for each point on scanline is
interpolated. Linear interpolation, or a
quadratic approximation (for perspective
correction) is used. 3. The (s,t) value maps
into the source texture map. It usually does not
fall on the center of a texel. 4. A texture
mapping algorithm is applied to the nearest
texel, and possibly surrounding texels, to
determine the result. Texturing eats CPU MIPS
bandwidth. 20-70 slower than flat shading.