## Introduction

In using standard rendering methods the effect of lighting on the relations between objects is not considered. The effect of lighting is calculated for every object separately. This means that for every object the effects of light are locally calculated. But from a global view for a photo-realistic model also the effect of light reflected from other objects which are situated in the given scene is calculated. The are two methods (photo-realistic rendering) aimed at achieving a photo-realistic model as realistic as possible. This approach is, however, highly time-consuming compared to simpler models.

## Ray tracing

In displaying objects and scenes a quality outcome means that it looks as far as possible photo-realistic. For this it is necessary that the scene considers all physical phenomena which are in effect here. The first method based on searching for light rays, passing through the given scene, is the ray tracing method. An assessment of the resulting intensity of a point in the screen is the assessment of amplitude of the intensity of rays passing through a given point, and following from the observer's eye. In calculating a scene, it is necessary to integrate for a realistic outcome also the removal of hidden surfaces, the calculation of shade and the refraction of a ray.

### Lighting model

For every pixel we apply two steps [1]:

• To form a tree of reflected and refracted rays
• To evaluate, in accordance with a lighting model, the resulting intensity from leaves to the root of the tree.

The equation for the intensity of lighting is given in [1].

### Ray tracing algorithm

The most simple variant of algorithms is ray tracing to an intersection with the closest objects, and then, to find out the color for this point. The classic version of this algorithm is given in [1]. The most simple variant of algorithms is ray tracing to an intersection with the closest objects, and then, to find out the color for this point. The classic version of this algorithm is given in [1]. The most simple variant of algorithms is ray tracing to an intersection with the closest objects, and then, to find out the color for this point. The classic version of this algorithm is given in [1].

\$\$\$APPLET

Applet Raytracing Author: Juraj Onderik

First row of options:

First choice selects view panels
Second choice selects the number of reflections (TraceCount)
Next two choices defines the size of rendered image

Second row of options:
First choice selected object type to create
Clear button removes all objects from the scene

In the view panels:
Zooming - mouse wheel
Panning - right mouse button

By clicking in the camera view a ray visualization is shown.

### General

Version 1.2

• Raycater Draw mode Menu bug fixed
• Raycaster Draw mode "Draw All" improved

Version 1.1

• Added rectangle for moving the whole raycaster
• Moving on scene now with clicking on the rendered image
• Interface improved
• 2D - 3D render option added
• Normalize to screen option added

The main goal is to demostrate functionality of raytracing, more about raytracing on http://de.wikipedia.org/wiki/Raytracing and http://de.wikipedia.org/wiki/Raycasting

### Help

• First start by creating a scene, go to Scene -> Demo Scene -> Empty (you can use this anytimeif you want to clear your scene)
• Continue by adding some objects from Scene -> Add Object -> choose 1 of 4 objects
• Drag and drop the single filled red point with mouse, to change te position of the raycaster
• Drag and drop the two red nonfilled points to change the viewport
• The two big circles (Raycaster in the middle) represents the perspective of view, for most natural render, keep the two circles over each other, so they form one circle
• The single filled red point, with 8 rays, represents the light, you can change its position by drag and drop
• By draging the red rectangle, you move the whole raycaster
• You can move in the scene, by clicking on the 4 rectangle areas in the right render image
• If you change an option (like "enable Light"), you have to raytrace the whole scene again, by going to Actions -> Raycast
• If you want to achive a high end render (better resolution), place the viewport behind the object, try the 3 cubes demos

\$\$\$APPLET

Applet Raytracing 2D Author: Peter Paulis

### Ray tracing acceleration methods

Because the ray tracing algorithm is highly time-consuming, there have been several methods designed for its acceleration. The issue of acceleration can be split into two approaches:

• to accelerate the calculation of an intersection with a ray
• to reduce the number of intersections with objects of the scene

One method for acceleration of the calculation of an object intersection with a ray is based on the use of limit bodies.

### Envelope use

Objects in the scene are arranged according coordinates x, y, z. If the ray is in the direction x, then we take the list of objects arranged by x. After finding out the first object on which the ray falls, the test is finished.

\$\$\$APPLET

### Limiting object use

Because objects are often complex, and have many edges, it is, in order to find object penetrations quickly, advantageous to minimize testing also of those objects which are outside the scene or which are hidden by others. Therefore, we can, instead of complex bodies, use more simple objects, which limit them.

\$\$\$APPLET

Accordingly, where the objects are located in a scene, we can proceed as follows: we establish for each object a limiting body, we establish a limiting body for a group of objects, we establish several limiting bodies for one object, we establish a hierarchy of limiting bodies.