ray tracing pov

Post on 12-Jan-2016

53 Views

Category:

Documents

4 Downloads

Preview:

Click to see full reader

DESCRIPTION

Ray Tracing POV. Oz Levy Yulia Shnaider 06.01.2014. What is Ray Tracing?. A method of creating visual art in which a description of an object or scene is mathematically converted into a picture - PowerPoint PPT Presentation

TRANSCRIPT

Ray Tracing POVRay Tracing POV

Oz LevyYulia Shnaider

06.01.2014

What is Ray TracingWhat is Ray Tracing??

A method of creating visual art in which a description of an object or scene is mathematically converted into a picture

Ray tracing is capable of simulating a wide variety of optical effects, such as reflection and refraction, scattering, and dispersion phenomena

Persistence Of Vision – Ray Persistence Of Vision – Ray (POV-Ray)(POV-Ray)

A three dimensional rendering free and open source software

The program derives information from an external text file, that contains the description of the scene

Scenes in ray tracing are described mathematically by a programmer or may also incorporate data from digital photography

Example for inputExample for input::

To create a scene we will need: objects, light sources, camera

The objects are defined mathematically or using an image, several types of cameras, sources of lights

Examples for types of light sources: point light, spotlight,  cylindrical, spotlight, parallel light, area light, soft shadows

background { blue 1 }

camera} location <0.0, 0.5, -4.0< look_at <0.0, 0.0, 0.0 <

{

light_source} -< 30 ,30- ,30<

color rgb <1, 1, 1<{

plane} < 0 ,1 ,0- ,<1

pigment { color rgb <0, 1, 0< }{

sphere} < 0 ,0 ,0 ,<1

texture} pigment { color rgb <1, 1, 0< }

finish{ specular 0.6 }{ {

• Surface patterns: wrinkles bumps

• Atmospheric effects: fog, clouds, haze, mist, rainbows and skies

• Show and hide options: shadows, reflection, no image, no body

Next stage - RenderingNext stage - Rendering

Calculating per pixel

The algorithm works line by line with an horizontal scan of each pixel

The direction of the rays is opposite to the physical direction – no calculations for the rays that will not reach our point of sight

IllustrationIllustrationFor each pixel in the image we “shoot” a ray through the pixel until it heats one of the objects, from there we direct rays to all the light sources and use superposition to get the final value for that specific pixel.

Work flowWork flow

End

Parsing

Tracing

Input file

Last line

?

Output line Video\file

Distant shores by Christoph Gerber

A few examplesA few examples::

Norbert Kern for the International Ray Tracing Competition

Still with Bullets by Jaime Vives Piqueres

Call of the Wild by Gilles Tran

Glasses by Gilles Tran

Problems and SolutionsProblems and SolutionsMotivation to ParallelizationMotivation to Parallelization

Determining the color of each pixel requires a large amount of calculations depending on the complexity of the scene

Antialiasing – a method of calculation in which we consider not only basic calculations but also the relationship and compatibility of the pixel to the nearby pixels

The algorithm we described enables working in an embarrassingly parallel method

Now that the motivation is cleared…

What are we going to talk about now ?

Approaches to parallelize

Results

Static PartitioningStatic PartitioningEach node is assigned a section of

the line to elaborate

They send it to a master processor that, after processing its section, reconstructs the complete line

This procedure is repeated up to the last line of the image

This approach assumes that all processors are similar…

In fact a line is completed only when the slowest processor finishes the computation of its section while the faster processors remain idle

Wasting useful time of elaboration…

Second ApproachSecond ApproachThe load of each process is

dynamically balanced

More work is assigned to the faster processes

In this way we try to find a solution to the slower process limitation, optimizing the use of each processor

Each line of the image is now divided into a number of sections greater than the number of the available processes

Initially each processor is assigned a single section of the line to be computed

Here, the master process does not have any section to elaborate. It has the task to assign a new section to the first process that end its work

The procedure is iterated, also in this case, line after line

DisadvantagesDisadvantages……

In antialiasing approach, each slave has to know the complete line previously elaborated and some information concerning the antialiasing of the same line (all this is sent from the master)

Getting complicated…

Tests and ResultsTests and ResultsThe examples have been tested

on:

◦ The distributed architecture ParMa2(composed of four Dual Pentium II 450 MHz interconnected by a 100Mbit/s switched Fast Ethernet network, forming an 8-processor system)

◦ A commercial multiprocessor machine: SGI Onix2 (with 8 R10000 195 MHz processors).

::FOR THE STATIC PARTITIONINGFOR THE STATIC PARTITIONING

- Linear speedup

-The best time is obtained with ParMa2.

::FOR THE DYNAMICFOR THE DYNAMIC

- speedup and performances are better for the Onix2

Additional aspects to Parallel Additional aspects to Parallel ComputingComputing

Divide by frames (in video, animation)

Divide by areas in the image (depends on optical/graphical parameters)

“Superposition” of two light sources..

REFERENCESREFERENCES

1) MPIPOV: a Parallel Implementation of POV-Ray Based on MPI Alessandro Fava1,

Emanuele Fava1, and Massimo Bertozzi21 Dipartimento di Ingegneria Industriale,

Universit`a di Parma Parco Area delle Scienze 181/A, I-43100 Parma, Italy

2) Dipartimento di Ingegneria dell’Informazione, Universit`a di Parma

Parco Area delle Scienze 181/A, I-43100 Parma, Italy

bertozzi@ce.unipr.it

3) Wikipedia

Thank you for listening.Thank you for listening.

Any questionsAny questions? ?

top related