Advanced ray tracing
1 / 47

Advanced Ray Tracing - PowerPoint PPT Presentation

  • Uploaded on

Advanced Ray Tracing. Mani Thomas CISC 440/640 Computer Graphics. Review. Ray tracing Compute 3D ray into the scene for each 2D image pixel Compute 3D intersection point of ray with nearest object in scene Test each primitive in the scene for intersection Find nearest intersection

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' Advanced Ray Tracing' - shiela

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Advanced ray tracing

Advanced Ray Tracing

Mani Thomas

CISC 440/640

Computer Graphics


  • Ray tracing

    • Compute 3D ray into the scene for each 2D image pixel

    • Compute 3D intersection point of ray with nearest object in scene

      • Test each primitive in the scene for intersection

      • Find nearest intersection

    • Recursively spawn rays from the point of intersection

      • Shadow Rays

      • Reflected rays

      • Transmitted rays

    • Accumulate the color from each of the spawned rays at the point of intersection


  • Ray object intersection

    • Intersection with a plane

      • Implicit form

      • Intersection

    • Intersection with a sphere

      • Implicit form

      • Intersection


  • “Shadow feelers”

    • Spawn a ray from P to the light sources

    • If there is an intersection of the shadow ray with any object then P is in shadow

  • Reflection

    • Angle of incidence = angle of Reflection


  • Refraction

    • Ray passing through media of different refractive indices bend towards/away from the normal

    • Snell’s Law

      • ni and nr are the refractive indices of the two media

    • Transmitted ray

Road map
Road map

  • Super sampling

  • Acceleration techniques

  • Monte Carlo methods

    • Distributed ray tracing

  • Bidirectional ray tracing

    • Caustics

  • POV-ray

Anti aliasing
Anti aliasing

  • Ray tracing gives a color for every possible point in the image

  • But a square pixel contains an infinite number of points

    • These points may not all have the same color

    • Sampling: choose the color of one point (center of pixel)

  • This leads to aliasing

    • jaggies

    • moire patterns

  • Aliasing means one frequency (high) masquerading as another (low)

    • e.g. wagon wheel effect

Super sampling

  • Ray tracing is a point-sampling process

    • Take discrete looks at the scene along individual rays passing through each pixel

  • Reduce aliasing due to this discrete signal sampling

Courtesy F.S. Hill, “Computer Graphics using OpenGL”

Adaptive super sampling
Adaptive Super-sampling

  • Instead of shooting one ray per pixel, shoot four rays through the corners of a pixel

    • Color at the pixel is the average of the colors at each corners

  • Adaptive super-sampling (Whitted’s approach)

    • Compute the intensity variation between the four corners with the average

    • Shoot more rays through corners with higher intensity variation

    • Compute final color as a weighted average rather than the regular average

Courtesy of C. Rasmussen, CISC 640

Stochastic super sampling
Stochastic Super sampling

  • Visible aliasing is possible even with adaptive super-sampling

    • sampling grid interacts with regular structures

    • objects aligned with sampling grid

  • Stochastic sampling

    • instead of a regular grid, subsample randomly

    • keep taking samples until the color estimates converge

    • jittering: perturb a regular grid

Courtesy of C. Rasmussen, CISC 640

Using extents
Using Extents

  • Ray tracing is slow, performing the same functions.

  • Most of the time is spent in computing intersections

    • Each ray should be intersected with every object in the scene

    • Each ray, spawns out reflected/transmitted rays which have to be interested with the objects in the scene

Using extents1
Using Extents

  • Extent of an object is a shape that encloses the object

  • Compute complicated intersections if and only if the ray hits the extent

  • Two shapes most commonly used as extents

    • Sphere – specified by a center and radius (C , r)

    • Box – specified by sides aligned to the coordinate axis

Distributed ray tracing
Distributed Ray Tracing

  • Distributed ray tracing is NOT ray tracing on a distributed system.

  • Distributed ray tracing is a ray tracing method based on randomly distributed oversampling to reduce aliasing artifacts in rendered images (Allen Martin,

Distributed ray tracing1
Distributed Ray Tracing

  • Developed by Cook, et. al. (“Distributed Ray Tracing”, Computer Graphics, vol. 18, no. 3, pp 137-145, 1984)

  • Stochastic Oversampling (

    • Pixel for antialiasing

    • Light source for soft shadows

    • Reflection function for soft (glossy) reflections

    • Time for motion blur

    • Lens for depth of field

Distributed ray tracing2
Distributed Ray tracing

  • Gloss (fuzzy reflections)

    • Partially reflecting surfaces

    • Traditional ray tracing

      • reflections look identical to the scene they are reflecting

      • reflections are always sharp

    • Randomly distributing the rays reflected by the surface

    • Send out a packet of rays around the reflecting direction.

    • The actual value of reflectance is the statistical mean of the values returned by each of these rays

Distributed ray tracing3
Distributed Ray tracing

  • Distributing a set of reflection rays by randomly perturbing the ideal specular reflection ray.

  • The spread of the distribution determines the glossiness where a wider distribution spread models a rougher surface.  

taken from

Distributed ray tracing4
Distributed Ray tracing

  • first image is from the traditional ray tracer

  • second one uses 16 rays in place of the single reflected ray

  • third image uses 64 rays

taken from

Distributed ray tracing5
Distributed Ray tracing

taken from

Distributed ray tracing6
Distributed Ray tracing

  • Fuzzy translucency

    • Same as glossy reflections, but you jitter the refracted ray

    • Analytical function similar to the shading

      • A transmission function is used instead of a reflectance function

      • Light is gathered from the other side of the surface.

    • Cast randomly distributed rays in the general direction of the transmitted ray from traditional ray tracing.

    • The average value computed from each of these rays the true translucent component.

Distributed ray tracing7
Distributed Ray tracing

  • first image is obtained from a traditional ray tracer

  • Second image uses 10 rays for the transmitted ray

  • third image uses 20 rays

taken from

Distributed ray tracing8
Distributed Ray tracing

  • first image is from the traditional ray tracer

  • second one uses 16 rays in place of the single reflected ray

  • third images uses 64 rays

taken from

Distributed ray tracing9
Distributed Ray tracing

  • Penumbras (soft shadows)

    • Traditional ray tracing shadows are discrete

      • Shadow feelers used to check if a point is in shadow with respect to a point light source

    • Incorrect for large light sources and/or light sources that are close to the object

    • The transition from fully shadowed to partially shadowed is gradual.

      • Due to the finite area of real light sources, and scattering of light of other surfaces

Distributed ray tracing10
Distributed Ray tracing

  • Penumbras (soft shadows)

    • A set of rays are cast about the projected area of the light source.

      • The projected area helps tackle the large area light source

    • The amount of light transmitted by the ratio of the number of rays that hit the source to the number of rays cast

Distributed ray tracing11
Distributed Ray tracing

  • In case of a point source, the occluder would create a sharp shadow boundary

  • In an area light source or if the light source is closer to the object

    • Creation of a penumbra region

  • Sending out shadow feelers to capture the penumbra region

taken from

taken from

Distributed ray tracing12
Distributed Ray tracing

taken from

Distributed ray tracing13
Distributed Ray tracing

  • Depth of field - the distance that objects appear in focus

    • Objects that are too far away or two close will appear unfocused and blurry

    • pinhole camera model does not truly mimic the real world situation

      • Pinhole assumed to be infinitely small

      • Changing focal length change field of view but does not change focus

Distributed ray tracing14
Distributed Ray tracing

  • Distributed ray tracing creates depth of field by placing an artificial lens in front of the view plane.

  • Randomly distributed rays are used once again to simulate the blurring of depth of field.

    • The first ray cast is not modified by the lens.

      • focal point of the lens is at a fixed distance along this ray

    • Rest of the rays sent out for the same pixel will be scattered about the surface of the lens

    • Points in the scene that are close to the focal point of the lens will be in sharp focus.

    • Points closer or further away will be blurred

taken from

Distributed ray tracing15
Distributed Ray tracing

taken from

Distributed ray tracing16
Distributed Ray tracing

  • Motion blur

    • Temporal sampling rather than spatial sampling

    • A Frame represents an average of the scene during the time that the camera shutter is open

    • Before each ray is cast, objects are translated or rotated to their correct position for that frame.

    • The rays are averaged to give the actual value.

    • Objects with the most motion will have the most blurring in the rendered image.

Distributed ray tracing17
Distributed Ray tracing

taken from

Distributed ray tracing18
Distributed Ray tracing

taken from

Bidirectional ray tracing
Bidirectional Ray tracing


Created by H. Wann Jensen

Bidirectional ray tracing1
Bidirectional Ray tracing

  • Caustic - (Concentrated) specular reflection/refraction onto a diffuse surface

  • Standard ray tracing cannot handle caustics


Created by H. Wann Jensen

Light paths
Light Paths

  • Interactions of the light ray can be expressed using regular expressions

    • L is the light source

    • E is the eye/camera

    • D is a diffuse surface

    • S is a specular surface

from Sillion & Puech

Light paths1
Light Paths

  • Direct visualization of the light: LE

  • Local illumination: LDE, LSE

  • Ray tracing: LS*E, LDS*E

  • Caustics: LS+DE

from Sillion & Puech

Taken from cisc 440/640 – Fall 2005

Diffuse surfaces
Diffuse Surfaces

  • Uncertainty in the direction that a photon will take for diffuse surfaces

  • For specular surfaces, the BRDF (probability that incoming photon will leave in a particular direction) has a thin profile

    • We can predict the direction of the outgoing photon

  • For an ideal diffuse surfaces, the BRDF would be spherical

    • The photon can travel along any of the direction with equal probability

from Sillion & Puech

Bidirectional ray tracing2
Bidirectional Ray tracing

from P. Heckbert

  • Idea: Trace forward light rays into scene as well as backward eye rays

    • At diffuse surfaces, light rays additively “deposit” photons in radiosity textures, or “rexes”, where they are picked up by eye rays

  • The rays of the forward and backward pass "meet in the middle" to exchange information.

Paul S. Heckbert, “Adaptive radiosity textures for bidirectional ray tracing “, SIGGRAPH 1990


  • Handling cases such as LD*E

  • “Color Bleeding”

courtesy of Cornell


  • Two beautiful rendering/modeling softwares

  • POV-ray (

    • Persistence of Vision - ray tracer

    • A free rendering tool (not a modeling tool)

      • Uses a text based scene description language (SDL)

    • Available on Windows/linux/MAC OS

  • Blender (

    • Modeling, Animation, rendering tool

      • Especially useful in 3D game creation

    • Available for Windows, Linux, Irix, Sun Solaris, FreeBSD or Mac OS X under GPL

Pov ray

created using POV-ray,

Pov ray1

created using POV-ray,

Pov ray2

created using POV-ray,

Pov ray3

created using POV-ray,


  • Traditional Ray tracing

    • Shadow feelers

    • Reflection

    • Refraction

  • Distributed Ray tracing

    • Jittered sampling

  • Bidirectional Ray tracing

    • Caustics

Thank you

Thank you