![Page 1: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/1.jpg)
x86 and 3D graphics
![Page 2: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/2.jpg)
Quick 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
![Page 3: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/3.jpg)
For 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)
![Page 4: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/4.jpg)
Rendering Processlightsource
objects
viewing planeX
Y
Z
incident light
perspective projection
Mathematical modelsfor light, objects & viewercreate a 2D image viaa 3D process
![Page 5: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/5.jpg)
Coordinate Systems
xw
yw
zw
world xo
yo
zo
object
xv
yv
zv viewer
xl
yl
zl
light
![Page 6: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/6.jpg)
Transformation
• 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
![Page 7: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/7.jpg)
NL R
S
Lighting Process
Surface
Diffuse Light scatters in all directions
Specular Light reflects in direction of reflection vector R
V
![Page 8: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/8.jpg)
Rasterization
• 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!
![Page 9: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/9.jpg)
Textures
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)
![Page 10: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/10.jpg)
Rasterization (again)
![Page 11: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/11.jpg)
Flat Fill
![Page 12: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/12.jpg)
Some lighting
![Page 13: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/13.jpg)
And textures
![Page 14: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/14.jpg)
DemoSkinnedMesh.exe
![Page 15: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/15.jpg)
History of 3D Pipeline Partitioning
Geometry
Lighting
Edge Setup
Rasterization
Application
Software 3DProcessor Does All
First Generation3D HW Accelerators
Rasterization
HW
Geometry
Lighting
Edge Setup
Application
2nd Generation HW (1998-99)
HW
Geometry
Lighting
Edge Setup
Rasterization
Application
3rd Generation HW (1999-2000)
HW
Geometry
Lighting
Edge Setup
Rasterization
Application
![Page 16: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/16.jpg)
Memory 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
![Page 17: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/17.jpg)
AGP: 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
![Page 18: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/18.jpg)
Memory traffic when using AGP
![Page 19: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/19.jpg)
How does it work
The AGP aperture is mapped as one chunk (1:1 mapping in CPU’s paging HW), both the gfx chip and the CPU reference the same addresses
The GART is mapping AGP memory address to the system memory address (like paging HW in the CPU)
![Page 20: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/20.jpg)
In the futureMulti-texturing: More than one texture for surface, used for details maps, reflections, refractions, lighting tricks, etc.
![Page 21: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/21.jpg)
Programmable HW
Helps the developer in customizing its transform, lighting and texture operations
![Page 22: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/22.jpg)
Programmable vertex machine
![Page 23: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/23.jpg)
Programmable HW demos
![Page 24: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/24.jpg)
backup
![Page 25: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/25.jpg)
Shading Techniques
Scan Line
A
B
C
L R
P
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
![Page 26: X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that](https://reader030.vdocuments.us/reader030/viewer/2022032704/56649d485503460f94a247bb/html5/thumbnails/26.jpg)
Texture Mapping1. 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.
(s0, t0 , q0)
(s1, t1, q1)
(s2, t2 , q2)
(si, ti)
1
2
3
4
s = 0, t = 0 s = 1, t = 0
s = 1, t = 1