Presentation is loading. Please wait.

Presentation is loading. Please wait.

May 20121 Visible Surface Detection Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.

Similar presentations


Presentation on theme: "May 20121 Visible Surface Detection Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty."— Presentation transcript:

1 May 20121 Visible Surface Detection Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty

2 May 20122 Back-Face Detection

3 May 20123 Depth-Buffer Methods Three surfaces overlapping pixel position (x,y) on the view plane. The visible surface, S 1, has the smallest depth value. view plane

4 May 20124

5 5 Efficient Depth Calculation Given the depth value in a vertex of a polygon, the depth of any other point in the plane containing the polygon can be calculated efficiently (additions only).

6 May 20126 Scanning can start at the top vertex of polygon and obtain the first depth value. Progressing from scan line to next one y is decreased by 1, which eases the depth calculation of first pixel along the scan line. top scan line y scan line y+1 scan line xx`

7 May 20127

8 8 A-Buffer Method It is named so since z-buffer is used for depth semantics and in some sense a-buffer has the nature of the other end of alphabet. It is an extension using antialiasing, area-averaging visibility detection method, supporting transparency. background opaque surface foreground transparent surface

9 May 20129 Projection reference point Ray Tracing opaque transparent

10 May 201210 Highly realistic. It detects visibility, transparency, shadows, illumination effects, and generates perspective views. Computational intensive.

11 May 201211 transparent opaque Projection reference point Binary Ray-Tracing Tree

12 May 201212 Left branches represent reflection paths, right branches represent transmission paths. A path is terminated if any of the following occurs: The ray intersects no surface. The ray intersects a light source that is not a reflecting surface. The tree reached a depth limit.

13 May 201213 u – incoming ray R – unit reflected ray L – unit vector pointing to light source N – unit surface normal H – unit vector half way between –u and L

14 May 201214 The paths along the direction of L is referred as the shadow ray. source. If any object intersects the shadow ray between the surface and the point light source, the surface position is in shadow with respect to that source.

15 May 201215 In transparent surface light is transmitted through material. The unit transmission vector T is obtained from u and N and refraction indices.

16 May 201216 Calculating Pixel Intensity It works bottom up, where the intensity at a child node is added to parent with an attenuation relative to the distance of the child’s surface from the parent’s surface. The intensity assigned to the pixel is the sum of attenuated intensities at the root. If the primary ray for a pixel doesn’t intersect with an object of the scene, the ray-tracing tree is empty and the pixel is assigned the background intensity.

17 May 201217 Ray-Surface Intersection Calculations projection reference point pixel point

18 May 201218 Ray-tracing is computations intensive, requiring root finding to get the value of parameter s at ray-surface incidence point. Efficient techniques exists for spherical, planar and also spline surfaces. Ray-Sphere Intersections

19 May 201219 If the discriminant is negative then either the ray doesn’t intersect the sphere or the sphere is behind P 0. In either case the sphere is eliminated from further consideration.

20 May 201220

21 May 201221 Ray-Polyhedron Intersections Computing intersection with polyhedron is expensive. It is useful to include polyhedron in the smallest enclosing sphere and exclude any intersection calculation if the ray doesn’t intersect the sphere.

22 May 201222 To find whether the point is within the face an odd- even test is in order. Among all the faces intersected by the ray, the one with the smallest s is chosen. If there’s no intersection with any face, the polyhedron is excluded from further consideration.

23 May 201223 Reducing Intersection Calculations Ray tracer consumes 95% time on intersection calculations. It is possible to enclose groups of adjacent objects in spheres, calculate intersection with enclosing sphere first, and proceed to real objects only if intersection exists. Another approach is space-subdivision, where the entire scene is enclosed with a cube. The cube is successively divided into smaller cubes until the number of spaces contained in a cube exceeds a predefined limit or the size of cube reaches some threshold.

24 May 201224 pixel ray Cells are traced through the individual cells. intersection tests are performed only for cells containing surfaces. The first intersected surface is the visible for that ray.

25 May 201225

26 May 201226

27 May 201227 3 7 8 0 2 4 1 6 5 Consider the cube plane attempted for exit point calculation. The cube face divides the plane into nine sectors. If the exit point is falling in sector 0 we are done. If it is falling in any of 1, 3, 2 or 4 we know the face containing the exit point and then can find it. In case of 5, 6, 7 and 8 further test is required.


Download ppt "May 20121 Visible Surface Detection Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty."

Similar presentations


Ads by Google