1 / 43

Shadows & Visibility

Learn efficient techniques for eliminating insignificant details, rendering shadows, and optimizing visibility in 3D graphics. Explore occlusion culling, from-point visibility, and pre-computation methods. Discover the duality of shadows and visibility in complex scenes.

edillard
Download Presentation

Shadows & Visibility

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. Shadows & Visibility 3D Modeling, Graphics, and Animation Prof. Jarek Rossignac College of Computing Georgia Institute of Technology Jarek Rossignac, CoC, IIC, GT

  2. Graphic acceleration • Eliminate insignificant details • Use lower resolution approximations computed through simplification • Use images instead of geometry • Texture maps instead of details • Imposters (billboards) • Panoramas • Images + depth • Don’t render what is not visible • Things that fall outside of viewing frustum • Back faces • Parts occluded by others Jarek Rossignac, CoC, IIC, GT

  3. Motivation • Visibility • Most objects in a scene are hidden from any given view point • Rendering them wastes GPU cycles • Need efficient techniques for rejecting what is obviously hidden • Rejection tests can be exact, conservative (reject more), approximate • Shadows • Objects in the shadow do not reflect direct illumination • Want to know which light sources illuminate an object • Need a quick test for being “in the shadow” • Visibility and shadows are defined in terms of occluders • Surfaces or objects that may block the passage of light when placed between the object and the viewer/light Jarek Rossignac, CoC, IIC, GT

  4. Occlusion culling in urban walkthrough • From Peter Wonka • Need only display a few facades--the rest is hidden Jarek Rossignac, CoC, IIC, GT

  5. Shadows / visibility duality FROM POINT • Point light source • Shadow (volume): set of points that do not see the light • From-point visibility • Occluded space: set of points hidden from the viewpoint FROM AREA • Area light source (assume flat for simplicity) • Umbra: set of points that do not see any light • Penumbra: set of points that see a portion of the light source • Clearing: set of points that see the entire light source • From-cell visibility (cell C) • Hidden space: set of points hidden from all points in C • Detectable space: set of points seen from at least one point in C • Exposed space: set of points visible from all points in C Jarek Rossignac, CoC, IIC, GT

  6. From-point visibility • What is visible from a given viewpoint • Not from a given area • Usually computed at run-time for each frame • Should be fast, and (reasonably) accurate (no popping) • Or done in background before the user starts looking around • May be pre-computed for a set of important viewpoints • Pre-computation can be slow • User will be invited to jump to these (street crossings, vistas) • or to drive along pre-computed paths (videos) • May be useful for pre-computing from-cell visibility • Identifies all objects B that are invisible when the viewpoint is in a cell A • The cell may be a cube or volume, a 2D area, or a trajectory (taxi metaphor) Jarek Rossignac, CoC, IIC, GT

  7. From-point visibility pre-computation • Select a set of viewpoints or do it when you arrive to a new one • Make 6 images (on the walls of a small cube around viewpoint) • Write object Ids instead of colors in the frame buffer • Collect all Ids from the 6 images • Objects with Ids not collected will not be displayed Can there be errors? Can we make any guarantees about accuracy? Jarek Rossignac, CoC, IIC, GT

  8. Outline for from-point-visibility • Simple shapes (triangle, ball) • Simple occluders (triangle, ball) • Convex occluders • Hoops (non convex surfaces) Jarek Rossignac, CoC, IIC, GT

  9. From-point visibility • Viewpoint/light ={a}(a single point) HIDDEN DETECTED CLEAR Jarek Rossignac, CoC, IIC, GT

  10. Zen break • The moon is a perfect ball • It is full and perfectly clear • You see it through your window • You wonder about the meaning of life • You trace its outline on the glass Is is a circle? Can you prove it? Jarek Rossignac, CoC, IIC, GT

  11. Nothing is perfect • In general, the outline of the moon is an ellipse • Proof: • The pencil of rays from your eye to the moon is a cone • The intersection of that cone with the window if a conic • If the moon is clear and visible through the window: it is an ellipse • When the window is orthogonal to the axis of the cone: it is a circle Jarek Rossignac, CoC, IIC, GT

  12. Cherchez la lune • The moon is a ball B(c,r) of center c and radius r • The occluder is a triangle with vertices d, e,and f • Assume viewer is at point a • Write the geometric formulae for testing whether the moon is hidden behind the triangle f c e d HIDDEN DETECTED CLEAR Jarek Rossignac, CoC, IIC, GT

  13. A triangle appear clockwise when • The vertices d, e, f, of a triangle appear clockwise when seen from a viewpoint a when s(a,d,e,f) is true • Procedures(a,d,e,f) {RETURN (ad•(aeaf)>0);}; • ad•(aeaf) is a 3x3 determinant • It is called the mixed product (or the triple product) f f e d d e clockwise counter-clockwise a a Jarek Rossignac, CoC, IIC, GT

  14. Testing a point against a half-space • Consider the plane through points d, e,and f • Consider the half-space H of all points that see d, e, f clockwise • A point c isin H whens(c,d,e,f) s(c,d,e,f) {RETURN cd•(cecf)>0} f Also remember that s(c,d,e,f)==0 implies that all 4 points are co-planar! e d clockwise c Jarek Rossignac, CoC, IIC, GT

  15. c f Clockwise from a e d a Test whether a point is hidden by a triangle • To test whether c is hidden from a by triangle d, e, f do • IF NOT s(a,d,e,f) THEN swap d and e • IF NOT s(a,d,e,c) THEN RETURN FALSE • IF NOT s(a,e,f,c) THEN RETURN FALSE • IF NOT s(a,f,d,c) THEN RETURN FALSE • IF s(c,d,e,f) THEN RETURN FALSE • RETURN TRUE Jarek Rossignac, CoC, IIC, GT

  16. c e d Clockwise from a f Testing a ball against a half-space • Consider the half-space H of all points that see(d, e, f) clockwise • A ball of center c and radius r is in H when: ec • (edef) > r ||edef|| Jarek Rossignac, CoC, IIC, GT

  17. c f Clockwise from a e d a Is the moon hidden by a triangle? • To test whether the ball of center c and radius r hidden from a by triangle with vertices d, e,and f do: • IF NOT s(a,d,e,f) THEN swap d and e • IF ac • (adae) < r || adae || THEN RETURN FALSE • IF ac • (aeaf) < r || aeaf || THEN RETURN FALSE • IF ac • (afad) < r || afad || THEN RETURN FALSE • IF ec • (edef) < r || edef || THEN RETURN FALSE • RETURN TRUE • Explain what each line tests • Are these test correct? • Are they sufficient? Jarek Rossignac, CoC, IIC, GT

  18. Is the moon hiding a triangle? • Triangle d, e, f is hidden from viewpoint a by a ball of center c and radius r when its 3 vertices are hidden. • Proof? • How to test it? f f c c d e d e Hidden moon Hidden triangle Jarek Rossignac, CoC, IIC, GT

  19. Is a convex occluder hiding a polyhedron? • A polyhedron is hidden if all of its vertices are • Proof? • Will this work for subdivision surfaces? • We do not need to test all of the vertices • Only those of a container (minimax box, bounding ball, convex hull) • Proof? • Only those on the silhouette of a convex container • Proof? • What if the occluder is not convex • Can it still work? Jarek Rossignac, CoC, IIC, GT

  20. Non-convex occluders? What if O is not convex? • replace O by an interior ball • Not easy to compute a (nearly) largest ball inside O • The average of the vertices of O may be outside of O • replace O by an interior axis-aligned box • Not easy to compute a largest box inside • replace O by a convex set it contains • O may be too thin • use a Hoop! • See next Andujar, Saona Navazo CAD, 32 (13), 2000 Jarek Rossignac, CoC, IIC, GT

  21. The problem Some occluders are too thin to contain large convex objects. Jarek Rossignac, CoC, IIC, GT

  22. The Hoops solution The occluder does not have to be convex, provided that its outline seems convex from the viewpoint Jarek Rossignac, CoC, IIC, GT

  23. Hoops: 3D Curves as Conservative Occluders for Cell-Visibility P. Brunet, I. Navazo, J. Rossignac, C. Saona-Vázquez Software Department, Polytechnic University of Catalonia GVU Center, Georgia Institute of Technology Manchester, 7th September 2001 Jarek Rossignac, CoC, IIC, GT

  24. When does a 3D polyloop appear convex? Each pair of consecutive edges defines a linear half-space from where their common vertex appears convex. Jarek Rossignac, CoC, IIC, GT

  25. Testing against a hoop • Given a hoop, we can easily test whether the viewpoint or a whole cell sees it as convex. • Test whether the viewpoint, or whether all the vertices of the cell, lie in the intersections of all half-spaces. • If so, then any simply connected surface bounded by the hoop is an occluder • Or is it? Jarek Rossignac, CoC, IIC, GT

  26. How to grow hoops? • Grow a patch on the surface • Grow a curve on the boundary of interior octree cells and simplify it Jarek Rossignac, CoC, IIC, GT

  27. Cell-to-cell visibility Now, let us look at the problem of pre-computing whether any portion of a cell A is visible from a viewpoint in cell B. Why? (Applications?) Jarek Rossignac, CoC, IIC, GT

  28. O b a A B O b a A B Notation and assumptions • Two sets, A and B • Two points aA, bB • O is the occluder • A, B, and O are disjoint • ab is the line segment from a to b • a–b  O ab = , a sees b (ignore self-occlusion) • a | b  O ab ≠ , a is occluded from by O Jarek Rossignac, CoC, IIC, GT

  29. A B O b a O A B A B O a b B A O Definitions • HIDDEN: HO(A,B) • B is entirely hidden from A • HO(A,B) a, b: a | b • DETECTED: DO(A,B) • B can be detected from any point of A • DO(A,B) a, b: a–b • GUARDED: GO(A,B) • B can be guarded from a single point of A • GO(A,B) a, b: a–b • CLEAR: CO(A,B) • B can be guarded from any point of A • CO(A,B) a, b: a–b Jarek Rossignac, CoC, IIC, GT

  30. Occlusion Jarek Rossignac, CoC, IIC, GT

  31. ShieldTester:Cell-to-cell visibility test for surface occludersIsabel Navazo, Jarek Rossignac, Joan Jou, Rahim Shariff Jarek Rossignac, CoC, IIC, GT

  32. The Occlusion Theorem Thesurface S occludes cell A from cell B, if and only if: There exists a connected component, C, of ST that is bounding a portion D of S and has no boundary in the interior of R. (The portion, DR, of the boundary of D that lies in R is exactly C.) 2. Given an arbitrary ray, RAB, from a point, a, in A to a point, b, in B, RAB has an odd number of none tangential intersections with the closed subset, DC, of S. Jarek Rossignac, CoC, IIC, GT

  33. Various cases Jarek Rossignac, CoC, IIC, GT

  34. ShieldTester for triangle meshes Obtain an edge eABof T from a vertex of A to a vertex of B IF eABS =  THEN RETURN (“visible”) FOR EACH triangle x of S that is stabbed by eABDO{ Start a WALK that traces a connected component C of ST IF the WALK did not run into a boundary of STHEN { INVADE the portion of S to the left of the triangles crossed by the WALK along C IFthe invaded portion has no holeTHEN IF the number of triangles that were stabbed by eAB and visited by the WALK and the INVADE is odd THENRETURN (“occluded”)} RETURN (“undecided”) Jarek Rossignac, CoC, IIC, GT

  35. c a b d e Detecting ray/triangle clash Jarek Rossignac, CoC, IIC, GT

  36. Walking one step Jarek Rossignac, CoC, IIC, GT

  37. c f f Clockwise from a e d e d clockwise a c Testing for ray/triangle intersection s(c,d,e,f) {RETURN cd•(cecf)>0} • To test whether c is hidden from a by triangle d, e, f do • IF NOT s(a,d,e,f) THEN swap d and e • IF NOT s(a,d,e,c) THEN RETURN FALSE • IF NOT s(a,e,f,c) THEN RETURN FALSE • IF NOT s(a,f,d,c) THEN RETURN FALSE • IF s(c,d,e,f) THEN RETURN FALSE • RETURN TRUE Jarek Rossignac, CoC, IIC, GT

  38. Turning left on S Jarek Rossignac, CoC, IIC, GT

  39. Invade process Jarek Rossignac, CoC, IIC, GT

  40. Hot edges Jarek Rossignac, CoC, IIC, GT

  41. Results Jarek Rossignac, CoC, IIC, GT

  42. Can’t grow a patch of edge-connected triangles Leaves/branches are small and disjoint Use approximate shadow fusion Render tree(s) Mark area of rendered pixels Construct big rectangle inside it (how?) Let M= max(z-buffer inside rectangle) Push back rectangle to z=M Use it as occluder for other objects (behind the tree) Accuracy depends on screen resolution Can be improved by splitting the screen into 4 Do this recursively (quad-tree) Use bounding spheres around objects to test them Conservative part Use a hierarchy of bounding sphere (hierarchical z-buffer) Lots of small occluders Jarek Rossignac, CoC, IIC, GT

  43. Polygons cast curved shadows! Jarek Rossignac, CoC, IIC, GT

More Related