1 / 32

2IV60 Computer graphics set 11: Ray-tracing

2IV60 Computer graphics set 11: Ray-tracing. Jack van Wijk TU/e. John Tsiombikas. Caustic Graphics. Overview. Ray-tracing: Based on geometric optics; Mirroring, transparency, cast shadows; Many other effects… And very time consuming…. H&B 21-1:639-647. Normalized view volume. z.

hrobbins
Télécharger la présentation

2IV60 Computer graphics set 11: Ray-tracing

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. 2IV60 Computer graphicsset 11: Ray-tracing Jack van Wijk TU/e

  2. John Tsiombikas

  3. Caustic Graphics

  4. Overview Ray-tracing: • Based on geometric optics; • Mirroring, transparency, cast shadows; • Many other effects… • And very time consuming… H&B 21-1:639-647

  5. Normalized view volume z front = visible pixel Ray casting (reprise) Algorithm: Per pixel: - Calculate intersections - Determine first yv xv zv View plane H&B 21-1:639-647

  6. opaque mirroring Mirroring and transparent Ray-tracing principle 1 light source Ray-tracing: projection point view plane H&B 21-1:639-647

  7. Ray-tracing principle 2 light source Ray-tracing: projection point pixel view plane H&B 21-1:639-647

  8. Ray-tracing algorithm 1 varfbuf: array[N,N] ofcolor; { frame-buffer } For all 1<= i, j <=N do { for all pixels } fbuf [i,j]:= RayTrace((0,0,0),(i,j,d), 1) projection point pixel d H&B 21-1:639-647

  9. N H R P L u Q T Ray-tracing algorithm 2 functionRayTrace(P: point;u:vector; level: integer): color; iflevel > MaxLevel orGetIntersections (P,u, t, N) = 0 thenreturnBkColor; level := level+1; col := famb*Iamb; Q := P+ ut; if (L Q).N > 0 and GetIntersections (Q,L  Q) = 0 then col := col + fdif*I + fspec*I*power(N.H(u,N), nspec); col := col + fspec*Raytrace(Q, R(u,N), level); col:= (1–ftra)*col + ftra*Raytrace(Q, T(u,N), level); returncol; H&B 21-1:639-647

  10. Calculation intersections functionGetIntersections (P: point; u: vector; t: array of real; N: array ofvector): integer; { Get the intersections of a line with the scene } For all objects do: Calculate intersection points with surface; Store the results in the arrays t and N, sorted for t. Return the number of intersection points. Equation line: P u t H&B 21-1:639-647

  11. Line/Sphere intersections Equation line: Equation sphere: P u t Q Substitute (1) in (2): C r H&B 21-1:639-647

  12. Equation plane polygon: Substitute (1) in (2): Line/polygon intersection Equation line: N P u t Q Check if Q is inside polygon H&B 21-1:639-647

  13. Bounding Boxes Bounding Spheres Ray-tracing acceleration 1 Limit intersection calculations: Hierarchy of Bounding Volumes H&B 21-1:639-647

  14. Regular Adaptive (Octtree, quadtree) Ray-tracing acceleration 2 Limit intersection calculations: Space-subdivision H&B 21-1:639-647

  15. Aliasing 1 • Generic problem of raster graphics • Shapes are continuous, pixels are discrete • Jagged edges, Moiré patterns, flickering textures, … • Especially annoying during animation • More pixels? • More samples! H&B 21-1:639-647 Aliased Anti-aliased

  16. 1 ray/pixel: blocky patterns Aliasing 2 pixel ray H&B 21-1:639-647

  17. average 5 rays/pixel: smoother transitions Anti-aliasing 1 pixel ray H&B 21-1:639-647

  18. adaptive sampling: more efficient, not fail save Anti-aliasing 2 pixel ray H&B 21-1:639-647

  19. Anti-aliasing 3 pixel dense patterns give problems ray H&B 21-1:639-647

  20. Anti-aliasing 3 pixel dense patterns give problems ray H&B 21-1:639-647

  21. Anti-aliasing 3 pixel dense patterns give problems ray H&B 21-1:639-647

  22. Anti-aliasing 4 pixel random sampling gives a better result ray H&B 21-1:639-647

  23. Anti-aliasing 4 pixel random sampling gives a better result ray H&B 21-1:639-647

  24. Anti-aliasing 4 pixel random sampling gives a better result ray H&B 21-1:639-647

  25. More optical effects…

  26. Imperfect reflection Non-point light source Cook, Porter, Carpenter, 1984

  27. Distributed ray tracing 1 Motion blur Cook, Porter, Carpenter, 1984

  28. Distributed ray tracing 1 • Monte Carlo sampling • Typically 16 rays/pixel; • Each ray is shifted along a small random vector (jitter) • rough reflecting surfaces, non-point light sources, depth of field, motion blur pixel ray H&B 21-1:651-653

  29. R L T Distributed ray tracing 2 • rough reflecting surfaces, non-point light sources, depth of field, motion blur P u H&B 21-1:651-653

  30. Radiosity • Surface-surface interreflection • Physically based simulation • Calculate for each polygon the balance between incoming and outgoing light • Important for architecture and indoor scenes • Cornell box

  31. Cohen et al., 1988

  32. Finally • That concludes our tour through the world of 2D and 3D graphics

More Related