+ All Categories
Home > Documents > Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State...

Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State...

Date post: 09-Jul-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
43
Dr. J. Bikker Realistic Image Synthesis 2 lecture Realistic Image Synthesis
Transcript
Page 1: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Dr. J. Bikker

Realistic Image Synthesis

2lecture

Realistic Image Synthesis

Page 2: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Today:

Literature discussion

Whitted-style Ray Tracing

Stochastic Soft Shadows

Stochastic Reflections

Distributed Ray Tracing

Path Tracing

Page 3: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Literature

Turner Whitted: An Improved Illumination Model for Shaded Display.

Cook et al.: Distributed Ray Tracing.

James Kajiya: The Rendering Equation.

Page 4: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Visibility Determination

Rasterization approach: Z-buffer

for each trianglefor each pixel

if zpixel < zbufferplot pixelzbuffer = zpixel

Page 5: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Visibility Determination

Rasterization approach: Z-buffer

for each trianglefor each pixel

if zpixel < zbufferplot pixelzbuffer = zpixel

Page 6: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Visibility Determination

Ray tracing approach

tmin = infinite

for each screen pixelfor each triangle

if ttriangle < tmint = ttriangle

Page 7: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Whitted-style Ray Tracing

In 1980, “State of the Art” consisted of:

Rasterization Shading: either diffuse (N · L) or specular ((N · H)n), both

not taking into account fall-off (Phong) Reflection, using environment maps (Blinn & Newell *) Stencil shadows (Williams **)

Goal:

Solve reflection and refraction

Improved model:

Based on classical ray optics

** : Williams, L. 1978. Casting curved shadows on curved surfaces. In Computer Graphics (Proceedings of SIGGRAPH 78), vol. 12, 270–274.

* : Blinn, J. and Newell, M. 1976. Texture and Reflection in Computer Generated Images. Communications of the ACM 19:10 (1976), 542—547.

Page 8: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Whitted-style Ray Tracing

Page 9: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Whitted-style Ray Tracing

Color at pixel:

sphere material color *refracted ray

+ sphere material color * reflected ray

This is a recursive process.

Page 10: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Whitted-style Ray Tracing

Color at pixel:

sphere material color *refracted ray

+ sphere material color * reflected ray

This is a recursive process.

color Trace( O, D )I, N, mat = NearestIntersection( O, D )if (mat == DIFFUSE)

return mat.color *DirectIllumination( I, N )

if (mat == MIRROR)return mat.color *

Trace( I, reflect( D, N ) )if (mat == GLASS)

return mat.color *(Trace( I, reflect( D, N ) ) +Trace( I, refract( D, N ) ) )

color Trace( O, D )I, N, mat = NearestIntersection( O, D )if (mat == DIFFUSE)

return mat.color *DirectIllumination( I, N )

if (mat == MIRROR)return mat.color *

Trace( I, reflect( D, N ) )if (mat == GLASS)

return mat.color *(X * Trace( I, reflect( D, N ) ) +(1–X) * Trace( I, refract( D, N ) ) )

angle of incidence = angle of reflection

Snell’s law

Fresnel equations

Page 11: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Whitted-style Ray Tracing

Improved model:

Based on classical ray optics

Dust off your BINAS.

Physical basis of Whitted-style ray tracing:

Light paths are generated (backwards) from the camera to the light sources, using rays to simulate optics.

Whitted-style ray tracing is deterministic: it cannot simulate area lights, glossy reflections, and diffuse reflections.

Page 12: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 13: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 14: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 15: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 16: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

The Abyss, 1989

Page 17: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Stochastic Soft Shadows

“Whitted-style ray tracing is deterministic: it cannot simulate area lights, glossy reflections, and diffuse reflections.”

These common phenomena are the main goal of stochastic methods.

Page 18: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 19: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 20: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Stochastic Soft Shadows

?

Page 21: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Stochastic Soft Shadows

Page 22: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Stochastic Reflections

For soft shadows, we want to know the visible area of a light source, which can be 0..100%.

The light source could be (partially) obscured by any number of objects.

We can approximate the visibility of the light source using a number of random rays.

Using 6 rays:

V = 1/6 * Σi=1..6 Vi

Page 23: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Stochastic Reflections

In general:

We replace an integral with the expected value of a random variable.

E(x) = ∫ f ( x )

Ω

≈ 1/N Σi=1..N xi

When N approaches infinity, E(x) approaches the integral.Until that time, E(x) exhibits variance.

Page 24: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Distributed Ray Tracing

Problem:

“Ray tracing is currently limited to sharp shadows, sharp reflections, and sharp refraction.”

Goal:

Augment Whitted-style ray tracing with glossy reflections and refractions, as well as soft shadows.

Page 25: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Distributed Ray Tracing

Sampling the area light:

Average the transported light for multiple paths Combine with anti-aliasing

Sample glossy reflections the same way.

Page 26: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Distributed Ray Tracing

Integrating over area of light sources: soft shadows

Integrating over pixel: anti-aliasing

Integrating over reflection cone: glossy reflections

Integrating over time: motion blur

Integrating over film: depth of field

Integrating over wavelength: dispersion

Page 27: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Distributed Ray Tracing

Improved model:

Still based on classical ray optics Combined with probability theory to solve integrals

Physical basis of distributed ray tracing:

Light paths are generated (backwards) from the camera to the light sources, using rays to simulate optics.

Distributed ray tracing requires many rays to bring down variance to acceptable levels.

Page 28: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Distributed Ray Tracing

“Distributed ray tracing requires many rays to bring down variance to acceptable levels.”

This is a real problem:

We still need a shadow ray per non-specular surface interaction per light For dielectrics, we split the path in a transmitted ray and a reflected ray

These problems are finally solved in the path tracing algorithm.

Page 29: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 30: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 31: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 32: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Path Tracing

Problem:

Distributed ray tracing requires many rays to bring down variance to acceptable levels.

Goal:

Efficient stochastic approximation of the path integral.

Page 33: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Path Tracing

Observations:

1. We can trace paths forward (from the light) or backward (from the camera) without consequence.

2. Nature works with particles (photons).

Approach:

Fire particles through each pixel, let them randomly bounce around the scene, until a light is encountered; when this happens, calculate the energy transfer for the path.

Random:

A particle does not split itself, it always picks one direction.

But: with a certain probability.

E.g., when encountering glass: a particle could go into the glass, or reflect off it. The probability is calculated using Fresnel. The new direction using Snell.

More on path tracing in a later lecture.

Page 34: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 35: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 36: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 37: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 38: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Physically Based

What is physically based?

Whitted:

Use optics as a basis for ray / scene interaction Add attenuation to Phong shading model

Cook:

Acknowledge the fact that the real world does not use ideal mirrors and lenses Support area lights instead of just point lights Work around the ‘point sampling’ nature of ray tracing: use the average of many point samples to integrate.

Page 39: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Physically Based

What is physically based?

Kajiya:

Simulate particle transport

What is physically based?

Did we cover all relevant real-world light transport phenomena?

What else is there? Can we render photorealistic now?

Page 40: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Next week:

Find a graphics-related paper that claims to make something ‘physically correct’ or ‘physically based’. Prepare a 10 minute presentation:

1. Explain the contribution of the paper;2. Explain the ‘physical’ part of the contribution;3. Reflect on strengths and weaknesses.

The paper may cover: geometry, materials, light transport, audio.The paper may introduce partial physical correctness to an otherwise incorrect approach.

Page 41: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

THE ENDnext week: ‘physically based’ digest

Page 42: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular
Page 43: Realistic Image Synthesis - Utrecht University 2.pdf · Whitted-style Ray Tracing In 1980, “State of the Art” consisted of: Rasterization Shading: either diffuse (N ·L) or specular

Recommended