1 / 26

Rendering

Rendering. Visibility Lighting Texturing. Pipeline. 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

eugene
Download Presentation

Rendering

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. Rendering • Visibility • Lighting • Texturing

  2. Pipeline • 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

  3. CPU vs. GPU 1996 1997 1998 1999 2000 2002+ From http://www.gamedev.net/reference/programming/features/d3d7im2/page2.asp

  4. VisibilityObject Visibility Tests / Occlusion Tests • Bounding boxes • Approximate objects for quick tests A B Area occluded by bounding box of A Note that B is not fully occluded by object A

  5. VisibilityObject Visibility Tests / Occlusion Tests • QuadTrees • Partition space

  6. VisibilityObject Visibility Tests / Occlusion Tests • QuadTrees/OctTrees • Partition 3D space

  7. VisibilityObject Visibility Tests / Occlusion Tests • QuadTrees/OctTrees/BSP • Partition space to create a binary tree

  8. VisibilityObject Visibility Tests / Occlusion Tests • Portals

  9. View point Near Clipping Plane Far Clipping Plane View Frustum View Space Polygon clipping

  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. Light (Ip) Light (Ip) L N N L 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 I = Ip kd (N•L) (kd is coeff. of diffusion) N Light (Ip) L But this doesn’t look very good … lighting is too harsh (See this example)

  12. Ambient Light • So we add ambient light • Constant term • Crude approximation of light scattering in scene • Independent of object, light, or viewer position I = Ia ka + Ip kd (N•L) From http://www.siggraph.org/education/materials/HyperGraph/shutbug.htm

  13. Specular Reflection • To get more accurate and model highlights off the surface, we add specular reflection. • This adds reflection proportional to cosnα I = Ia ka Ca + Ip [kd Cd(N•L) + ks Cs(R•V)] (C is object color) Reflected ray Light (Ip) N R To viewer L V

  14. Specular coefficients 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

  15. All together Flat Gouraud Phong Note: mach banding in Gouraud

  16. Lights • Ambient • Point sources • Directional lights (infinite source) • Spot lights • Area lights • Local lights X

  17. Texture • uv coordinates 1,1 0,1 0,1 1,1 0,0 1,0 0,0 1,0

  18. Mip Mapping From Gamedev.net

  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. Bump Mapping

  21. Reflection and refraction Snell’s Law : ir1*sin (q1) = ir2*sin (q2) From http://www.gamasutra.com/features/20001110/oliveira_01.htm

  22. Environment Mapping Environment mapped onto cube, then projected onto object

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

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

  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. Reading • 3D pipeline tutorial http://www.extremetech.com/article/0,3396,s=1017&a=2674,00.asp

More Related