Presentation is loading. Please wait.

Presentation is loading. Please wait.

02/04/03 Page 1 Rendering Visibility Lighting Texturing.

Similar presentations


Presentation on theme: "02/04/03 Page 1 Rendering Visibility Lighting Texturing."— Presentation transcript:

1 02/04/03 Page 1 Rendering Visibility Lighting Texturing

2 02/04/03 Page 2 1. Application/Scene –Description of the contents of the 3D world –Object Visibility Check including possible Occlusion Culling 2. Geometry –Transforms (rotation, translation, scaling) –Transform from Model Space to View Space –View Projection –Trivial Accept/Reject Culling –Transform to Clip Space –Clipping –Transform to Screen Space 3. Triangle Setup –Back-face Culling (or can be done in view space before lighting) –Scan-Line Conversion 4. Rendering / Rasterization –Shading –Texturing –Fog –Alpha Translucency Tests –Depth Buffering –Z-buffer Pipeline

3 02/04/03 Page 3 CPU vs. GPU From http://www.gamedev.net/reference/programming/features/d3d7im2/page2.asp Move Object and Camera (AI, Realistic Physics) CPU Scene Level Calculations, High order surface tessellation CPU GPU TransformsCPU GPU LightingCPU GPU Triangle Setup and ClippingCPU GPU Rendering Graphics Processor GPU 1996 1997 1998 1999 2000 2002+

4 02/04/03 Page 4 Visibility Object Visibility Tests / Occlusion Tests Bounding boxes –Approximate objects for quick tests Area occluded by bounding box of A A Note that B is not fully occluded by object A B

5 02/04/03 Page 5 Visibility Object Visibility Tests / Occlusion Tests QuadTrees –Partition space

6 02/04/03 Page 6 Visibility Object Visibility Tests / Occlusion Tests QuadTrees/OctTrees –Partition 3D space

7 02/04/03 Page 7 Visibility Object Visibility Tests / Occlusion Tests QuadTrees/OctTrees/BSP –Partition space to create a binary tree

8 02/04/03 Page 8 Visibility Object Visibility Tests / Occlusion Tests Portals

9 02/04/03 Page 9 View Space Near Clipping Plane Far Clipping Plane View Frustum View point Polygon clipping

10 02/04/03 Page 10 Shading models Simple model has 3 basic elements –Diffuse (direct reflection) –Ambient (reflected and scattered light from the environment) –Specular (highlights from surface) Notes –not physically-based and inaccurate –nevertheless, a decent approximation –fast to compute

11 02/04/03 Page 11 Shading models Diffuse (Lambertian) Reflection –Dull, matte surfaces –Viewer position independent –Dependent on position and intensity of source Reflection is product of light ray L and surface normal N Light (I p ) N L N L N L But this doesn’t look very good … lighting is too harsh (See this example)example I = I p k d (N L) ( k d is coeff. of diffusion )

12 02/04/03 Page 12 Ambient Light So we add ambient light –Constant term –Crude approximation of light scattering in scene –Independent of object, light, or viewer position From http://www.siggraph.org/education/materials/HyperGraph/shutbug.htm I = I a k a + I p k d (N L)

13 02/04/03 Page 13 Specular Reflection To get more accurate and model highlights off the surface, we add specular reflection. This adds reflection proportional to cos n α I = I a k a C a + I p [k d C d (N L) + k s C s (R V)] (C is object color) Light (I p ) N L R V Reflected ray To viewer

14 02/04/03 Page 14 Shininess: 0 Shininess Strength: 0 Shininess: 0 Shininess Strength: 33 Shininess: 33 Shininess Strength: 66 Shininess: 66 Shininess Strength: 100 Shininess: 100 Shininess Strength: 100 From http://cts.rice.edu/~shisha/projects/ravl/3ds/materials/shininess.html Specular coefficients

15 02/04/03 Page 15 All together Note: mach banding in Gouraud FlatGouraudPhong

16 02/04/03 Page 16 Ambient Point sources Directional lights (infinite source) Spot lights Area lights Local lights Lights X

17 02/04/03 Page 17 Texture uv coordinates 0,1 1,1 0,01,0 0,11,1 1,0 0,0

18 02/04/03 Page 18 From Gamedev.net Mip Mapping R GB R GB R GB

19 02/04/03 Page 19 Multi passes Provides application of “textures” to texttures Quake III uses 10 passes: –(passes 1 - 4: accumulate bump map) –pass 5: diffuse lighting –pass 6: base texture (with specular component) –(pass 7: specular lighting) –(pass 8: emissive lighting) –(pass 9: volumetric/atmospheric effects) –(pass 10: screen flashes) (From: Brian Hook, course 29 notes at SIGGRAPH '98)

20 02/04/03 Page 20 Bump Mapping

21 02/04/03 Page 21 Reflection and refraction From http://www.gamasutra.com/features/20001110/oliveira_01.htm Snell’s Law : ir 1 *sin ( 1 ) = ir 2 *sin ( 2 )

22 02/04/03 Page 22 Environment Mapping Environment mapped onto cube, then projected onto object

23 02/04/03 Page 23 Light mapping X = From http://www.gamedev.net/reference/programming/features/d3d7im3/page4.asp Pre-computed “texture map” Simulates light sources

24 02/04/03 Page 24 Alpha blending FinalColor = SourcePixelColor * SourceBlendFactor + DestPixelColor * DestBlendFactor From http://www.gamedev.net/reference/programming/features/d3d7im3/page5.asp

25 02/04/03 Page 25 Z buffer Each pixel in the buffer contains the distance from the viewpoint of the object rendered at that pixel If the next object to be drawn at that pixel is further then the value at the pixel, then don’t write the pixel. Note: ATI Radeon’s Hierarchal Z-buffering

26 02/04/03 Page 26 Reading 3D pipeline tutorial http://www.extremetech.com/article/0,3396,s=1017&a=2674,00.asp


Download ppt "02/04/03 Page 1 Rendering Visibility Lighting Texturing."

Similar presentations


Ads by Google