Details, Explanation and Meaning About Ray tracing

Ray tracing Guide, Meaning , Facts, Information and Description

Ray tracing is one of the most popular methods used in 3D computer graphics to render an image. It works by tracing the path taken by a ray of light through the scene, and calculating reflection, refraction, or absorption of the ray whenever it intersects an object in the world - hence the name.

For example, starting at a light source, we may trace a ray of light to a surface. At this point, one or more of three things might happen with this light ray: absorption, reflection, and refraction. If the surface has any transparent or translucent properties, it refracts a portion of the light beam into itself in a different direction while absorbing some (or all) of the spectrum (and possibly altering the color). It may also reflect all or part of the light ray, in one or more various ways. It can also absorb part of the light ray, resulting in a difference in color or intensity of the reflected and/or refracted light (Note: Between absorption, reflection, and refraction, all of the incoming light must be accounted for, and no more. A surface cannot, for instance, reflect 66% of an incoming light ray, and refract 50%, since the two add up to be 116%.) From here, the reflected and/or refracted rays may strike other surfaces, where their absorptive, refractive, and reflective properties are again calculated based on the incoming rays, and eventually contribute to the final rendered image.

Ray tracing's popularity stems from its realism over other rendering methods (such as scanline algorithms); effects such as reflections and shadows, which are difficult to simulate in other algorithms, follow naturally from the ray tracing algorithm. The popularity of the ray tracing method also benefits from the fact that it is relatively simple to implement and yet yields fairly impressive graphical results; it thus often represents a first entry into graphics programming for many individuals.

The main drawback of ray tracing is that it can be an extremely slow process, due mainly to the large numbers of light rays which need to be traced, and the larger number of potentially complicated intersection calculations between light rays and geometry (the result of which may lead to the creation of new rays). Since very few of the potential rays of light emitted from light sources might end up reaching the camera, a common optimization is to trace hypothetical rays of light in the opposite direction. That is, a ray of light is traced starting from the camera into the scene, and back through interactions with geometry, to see if it ends up back at a light source. This is usually referred to as backwards ray tracing.

Ray tracing for producing computer graphics was first used by scientists at Mathematical Applications Group, Inc., (MAGI) of Elmsford, New York, in the late 1960s under contract with the defense department. At that time, the "Rays" traced were gamma rays emited by hypothetical sources of radiation. MAGI's software calculated not only how the gammma rays bounced off of surfaces, but also how they penetrated and refracted within. These studies helped the government to determine certain military applications, such as how to construct military vehicles that would protect troops from radiation, but also how to design re-entry vehicles for space exploration. Under the direction of Dr. Philip Mittelman, the scientists developed a method of generating images using the same basic software, and started a commercial animation studio in 1972. This studio used ray tracing to generate 3-D computer animation for television commercials, educational films, and eventually feature films -- they created much of the animation in the film "Tron" -- using ray tracing exclusively. MAGI went out of business in 1985.

Since this time, much research has been done on acceleration schemes for it. Many of these schemes focus on speeding up the determination of whether a light ray has intersected an arbitrary piece of geometry in the scene, often by storing the geometric database in a spatially organised data structure. Ray tracing has also shown itself to be very versatile, and in the last decade ray tracing has been extended to global illumination rendering methods such as photon mapping and Metropolis light transport.

Ray tracing in computer graphics derives its name and principles from a much older technique used for lens design since the 1900s. Geometric ray tracing is used to describe the propagation of light rays through a lens system or optical instrument, allowing the properties of the system to be modelled. This is used to optimise the design of the instrument (e.g. to minimise effects such as chromatic aberration) before it is built.

The principles of ray tracing for computer graphics and optical design are similar, but the technique in optical design usually uses much more rigorous and physically correct models of how light behaves. In particular, optical effects such as dispersion, diffraction and the behaviour of optical coatings are important in lens design, but are less so in computer graphics.

Before the advent of the computer, ray tracing calculations were performed by hand, but now they are common features of optical design software such as Zemax. A simple version of ray tracing known as ray transfer matrix analysis is often used in the design of optical resonators used in lasers.

Algorithm

For each pixel in image {
  Create ray from eyepoint passing through this pixel
  Initialize NearestT to INFINITY and NearestObject to NULL

  For every object in scene {
     If ray intersects this object {
        If t of intersection is less than NearestT {
           Set NearestT to t of the intersection
           Set NearestObject to this object
        }
     }
  }

  If NearestObject is NULL {
     Fill this pixel with background color
  } Else {
     Use NearestObject and NearestT to compute shading function
     Fill this pixel with color result of shading function
  }
}

Free raytracing tools

  


This is an Article on Ray tracing. Page Contains Information, Facts Details or Explanation Guide About Ray tracing


Google
 
Web www.E-paranoids.com

Search Anything