33
Project Raytracing

Project Raytracing

  • Upload
    tamar

  • View
    30

  • Download
    0

Embed Size (px)

DESCRIPTION

Project Raytracing. Content. Goals Idea of Raytracing Ray Casting Therory Practice Raytracing Theory Light model Practice Output images Conclusion. Specifications. Ray tracer depends on how to represent objects Parametric equation for precision, not rapidity - PowerPoint PPT Presentation

Citation preview

Project Raytracing

Content• Goals• Idea of Raytracing• Ray Casting

– Therory– Practice

• Raytracing– Theory– Light model– Practice

• Output images• Conclusion

SpecificationsRay tracer depends on how to represent objects

Parametric equation for precision, not rapidity

Develop a Ray Tracer in order to explore a new intersection algorithm

Two teams :

- for mathematics

- for code

Main principleCreate 3D pictures

Mathematical equation

Throw ray from eye to pixels

Not FROM source light: TO it

Number of reflections

Great pictures but slow

AlgorithmsRay casting

- first method

- no bounce

Ray tracing

- from eye to pixels

- reflection

- refraction

- shadow

Fields of useAnimation studio

Pixar: with parsimony

→ light effects

Video games

→ with triangles

→ faster and great

Ray casting

For each pixel:

● Shoot a ray from the observer to the position of the pixel

● Test if the ray hits an object in the scene

● If there is a hit:

the color of this pixel will be the color of the object● If there is no hit:

the pixel receives the color of the background

Ray casting

What do we need ?● A position for the observer (eye, camera)● A direction/object to look at (and a « way

up »)● An object to show on screen● A representation of the 2D screen in the 3D

space

Ray casting

Our Ray Caster

From Ray Casting to Ray Tracing

From Ray Casting to Ray Tracing

We add :● Lights

ambient, diffuse, specular● Shadows● Reflexion

=> recursion : another ray is shot from the intersection

● Material properties

ambient, diffuse, and specular coefficients

Lightmodel• Used: Phong reflection model• 3 types of light: ambient, diffuse, specular

=

Ambient and Diffuse

The coefficient is specific for a material

Specular

Shadows• Only add diffuse and

specular light, if a lightsource is visible

• Test for intersections between a point on the sphere and the lightsource

From Ray Casting to Ray Tracing

We add :● Lights

ambient, diffuse, specular● Shadows● Reflexion

=> recursion : another ray is shot from the intersection

● Material properties

ambient, diffuse, and specular coefficients

Video link 1

Video link 2

Interesting modules● Positionning of the screen in 3D space● The RayTracer class

● That's the core of the program (light model)● Shadows

● The use of inheritance to compute intersections● Obtaining an animation

● Camera and lights movement● Export a sequence of images, make a movie

● The Draughtboard

Difficulties

- math libraries- C++, compilation, building environment- Screen implementation- Unexpected results (debugging)

Achievements

Light effectsAnimation renderingDifferent shapesAntialiasing

ImprovementsRefraction and transparencyTextures and noiseDepth of FieldImage mappingBounding VolumeRadiometry (power, energy, radiance...)Photon mapping

Thanks!

Thank you for your attention!

Questions?