Ray Tracing 22

Embed Size (px)

Citation preview

  • 8/8/2019 Ray Tracing 22

    1/15

    PRESENTED BY:MUGDHA CHHAPARWAL

    ROLL NO. 22

  • 8/8/2019 Ray Tracing 22

    2/15

    ` Ifwe consider the line ofsight from a pixel positionon the view plane through ascene, we can determine

    which objects in the sceneintersect this line.

    ` From the intersection pointswith different object, we can

    identify the visible surfaceas the one whoseintersection point is closestto the pixel.

    ` In Ray tracing, instead ofidentifying for visiblesurface for each pixel, wecontinue to bounce the ray

    around the picture.

    ` When ray bounces, itcontributes to intensityforthat surface.

    ` This technique is useful forobtaining global reflectionand transmission effects.

  • 8/8/2019 Ray Tracing 22

    3/15

  • 8/8/2019 Ray Tracing 22

    4/15

    ` Pixel positions are designated

    in x-y plane.` Projections reference point lie

    on z axis.` With is coordinate system,

    the contributions to a pixel isdetermined by tracing a lightpath BACKWARD from thepixel to the picture.

    ` For each pixel ray, eachsurface is tested, whicharises following cases:

  • 8/8/2019 Ray Tracing 22

    5/15

    `

    Ifsurface is intersected:(i) Smallest distance between pixel to surfaceintersection point identifies the visible surface for thatpixel.

    (ii) Once visible surface identified, ray is reflected offthe

    visible surface along a specular path where i =r.

    ` Secondary ray: The ray reflected from the visiblesurface or passed through the transparent surface inrefraction direction.

    ` The ray after reflection/refraction strikes anothervisible surface recursively producing Ray TracingTree.

  • 8/8/2019 Ray Tracing 22

    6/15

    ` Recursion depth is

    determined by theamount ofstorageavailable or by the user.

    ` Ray path is terminated

    when predetermineddepth is reached or theray strikes a light source.

    ` The surface intensities ofall the nodes are added

    traversing the tree frombottom to top todetermine pixel intensity.

  • 8/8/2019 Ray Tracing 22

    7/15

    ` Path along L is calledShadow Ray.

    ` Specular reflection:R= u (2u.N)N

    ` In transparent material,intensity contribution

    nu

    nnu

    nunT

    !

    !

    !

    i

    r

    i

    r

    r

    i

    ri

    r

    i

    r

    i

    i

    r

    i

    r

    n

    n

    n

    n

    n

    n

    n

    n

    n

    n

    UU

    UU

    UU

    coscos

    coscos

    coscos

  • 8/8/2019 Ray Tracing 22

    8/15

    Ray equation:P = Po + s.u

    Ray equation gives thecoordinates ofany point Palong the ray path at adistance s from Po.

    u = Ppixel Pprp

    | Ppixel Pprp |

    S = u. P +-(u. P)2 - | P|2+r2

  • 8/8/2019 Ray Tracing 22

    9/15

    ` Aliasing is used to definejagged edges i.e.boundaries are not thatsharp, reflections are not

    that perfect and things canbe in and out offocus.` Three techniques are used

    to perform Antialiased ray

    tracing.` In these, pixel is treated as

    finite square area instead ofsingle point.

  • 8/8/2019 Ray Tracing 22

    10/15

    ` Super Sampling: Instead ofshooting one ray

    per pixel, shoot four raysthrough the corners ofa pixel.

    Color at the pixel is the average ofthe colors at each corners.

    ` Adaptive Sampling: Compute the intensity variation

    between the four corners withthe average

    Shoot more rays throughcorners with higher intensityvariation

    Compute final color as aweighted average rather thanthe regular average

  • 8/8/2019 Ray Tracing 22

    11/15

    ` Distributed Ray tracing /Stochastic sampling:

    Is based on randomly distributed

    rays over the pixel area used toreduce aliasing effect.

    Multiple samples are taken andaveraged together.

    Random distribution ofa numberofa number ofrays over the pixelsurface is achieved by Jittering.

    Initially pixel area is divided into16 subareas. Then randompositions are obtained by jitteringthe center coordinates ofeachsub pixel area by small amounts(x and y)

  • 8/8/2019 Ray Tracing 22

    12/15

  • 8/8/2019 Ray Tracing 22

    13/15

  • 8/8/2019 Ray Tracing 22

    14/15

  • 8/8/2019 Ray Tracing 22

    15/15