Principle

Navigation:  Introduction > Overview > SPRAY algorithm >

Principle

Previous pageReturn to chapter overviewNext page

Widely used ray tracing algorithms for a more or less realistic simulation of pictures ('virtual reality') start with rays from an observation point, send them through the pixels of a pixel array and trace back which object of the collection of things in the defined scenery is hit first (see the figure below).

 

principle_1

 

The color and brightness of the pixel is set according to the color and brightness of the hit point which - in turn - depends on its illumination from the surrounding light sources and the light reflections due to neighboured objects. In case of polished surfaces one has to split up the ray into a reflected and a transmitted contribution and follow up their paths through the scenery - typically not more than five propagation iterations are taken into account. Usually quite crude assumptions on the specular or diffuse reflection properties of the surfaces are made - the quality of the result depends of course on the quality of the component's optical properties that are input to the software.

The 'virtual reality ray tracing method' discussed above is used in SPRAY only for taking pictures of the setup (called 'rendered views'). For a quantitative simulation of optical devices a different approach is more appropriate which is sketched below. A direct simulation of what happens in reality is done: The light source emits light (rays) in various directions and the objects in the scenery absorb or re-direct rays until finally the rays are absorbed or vanish to 'infinity' (if no object is hit any more).

 

Principle_2

 

Working with rays is of course only an approximation: Actually light sources emit quite complex radiation fields and generally one must take into account phase relations between partial waves (as is apparent in optical interferometry or diffraction effects). The ray-tracing approach neglects phases of electric and magnetic fields and describes light propagation in terms of 'intensity needles' with well defined direction and negligible dimensions perpendicular to the propagation direction.

 

Using light rays the quite complex 'real life' (inter)actions can be separated into actions of distinct objects characterized by certain geometric properties and abilities to process incoming rays. This is a situation tailored for object oriented programing (OOP) which has been used to realize the SPRAY program. OOP allows the definition of objects with certain properties and possible actions which directly correspond to real objects: The SPRAY actors are light sources, mirrors, detectors and so on which are controlled and coordinated by an object manager sending and receiving messages.