Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presented by: Bhavna Agarwal. Given a bunch of 3D objects predefined in x,y,z; order them in geometry.

Similar presentations


Presentation on theme: "Presented by: Bhavna Agarwal. Given a bunch of 3D objects predefined in x,y,z; order them in geometry."— Presentation transcript:

1 Presented by: Bhavna Agarwal

2 Given a bunch of 3D objects predefined in x,y,z; order them in geometry

3

4  Back faces (Back-face Culling)  Hidden faces (Hidden Surface Removal) VNIf V.N>0 =>back-face Surface normal

5  Ray Casting  Looks through the stack of pixels lying on the ray  O(p logn) p = # pixels; n = # polygons  Z-Buffer (Catmull, 1975)  For a point (x,y) holds the smallest z scanned so far  Space = O(X.Y) X = frame width; Y = frame height

6 The color value is stored in the rendering surface Depth-buffer (same dimensions as the rendering surface) The depth value is stored in the depth-buffer. (x,y) Too much Memory!!

7 Warnock(PL in vp1, vp1) Warnock(PL in vp2, vp2) Warnock(PL in vp3, vp3) Warnock(PL in vp4, vp4) Runtime = Ɵ (p.n) vp1 vp3vp4 vp2

8  Paint the farthest objects 1 st  Overlap the occluded regions with paint  Sort polygons in depth = O(nlgn)  Order from largest z to smallest z 1 2 3

9  Piercing polygons  Cyclic chain XX YY SOLUTION  Split and Sort

10  Binary Space Partitioning tree

11 1. Select a partition plane. 2. Partition the set of polygons with the plane. 3. Recurse with each of the two new sets. X 1 2 3 4 5

12 Classify the eye-point wrt the plane at the root  If (eye-point lies in left-sub)  Render the polygons in the right-sub  Render the polygons on the root plane  Render the polygons in the left-sub  If (eye-point lies in right-sub)  Vice-versa  If (eye-point lies on the splitting plane)  Render the polygons in the right/left sub  Render the polygons on the left/right sub

13  A bad splitting plane cuts too many polygons  This means expensive rendering  A bad splitting plane gives an unbalanced tree  This means expensive tree traversal  Measure of success: # poly in left-subtree # poly in right-subtree <= Accepted threshold

14 T(n) = 2.T(n/2) + O(time to find the best dividing polygon) % each polygon tried against others = 2.T(n/2) + O(n 2 lgn) = O(n 2 lgn)

15  The good  Draws the polygons precisely  No undershoot/overshoot problems DesiredUndershootOvershoot  The bad  Draws the same pixel many times  Inefficient if used for the whole image

16  Reverse of Painters  Front to back!  Uses a BSP tree to resolve conflicts.  Saves a mask that stores the span not written to for each scan line.  Advantage  Never writes the same pixel again!  Disadvantage  What about transparent polygons?

17 THANK YOU! * easy ones please


Download ppt "Presented by: Bhavna Agarwal. Given a bunch of 3D objects predefined in x,y,z; order them in geometry."

Similar presentations


Ads by Google