24
Ray Tracing Ray Tracing POV POV Oz Levy Yulia Shnaider 06.01.2014

Ray Tracing POV

  • Upload
    chaka

  • View
    43

  • Download
    4

Embed Size (px)

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

Citation preview

Page 1: Ray Tracing POV

Ray Tracing POVRay Tracing POV

Oz LevyYulia Shnaider

06.01.2014

Page 2: Ray Tracing POV

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

Page 3: Ray Tracing POV

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

Page 4: Ray Tracing POV

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

Page 5: Ray Tracing POV

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

Page 6: Ray Tracing POV

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

Page 7: Ray Tracing POV

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.

Page 8: Ray Tracing POV

Work flowWork flow

End

Parsing

Tracing

Input file

Last line

?

Output line Video\file

Distant shores by Christoph Gerber

Page 9: Ray Tracing POV

A few examplesA few examples::

Norbert Kern for the International Ray Tracing Competition

Page 10: Ray Tracing POV

Still with Bullets by Jaime Vives Piqueres

Call of the Wild by Gilles Tran

Page 11: Ray Tracing POV

Glasses by Gilles Tran

Page 12: Ray Tracing POV

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

Page 13: Ray Tracing POV

Now that the motivation is cleared…

What are we going to talk about now ?

Approaches to parallelize

Results

Page 14: Ray Tracing POV

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

Page 15: Ray Tracing POV

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…

Page 16: Ray Tracing POV

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

Page 17: Ray Tracing POV

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

Page 18: Ray Tracing POV

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…

Page 19: Ray Tracing POV

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).

Page 20: Ray Tracing POV

::FOR THE STATIC PARTITIONINGFOR THE STATIC PARTITIONING

- Linear speedup

-The best time is obtained with ParMa2.

Page 21: Ray Tracing POV

::FOR THE DYNAMICFOR THE DYNAMIC

- speedup and performances are better for the Onix2

Page 22: Ray Tracing POV

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..

Page 23: Ray Tracing POV

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

[email protected]

3) Wikipedia

Page 24: Ray Tracing POV

Thank you for listening.Thank you for listening.

Any questionsAny questions? ?