Computer Graphik

Transcrição

Computer Graphik
How to make a PIXAR movie
Photon Mapping
computer graphics & visualization
Motivation
Quelle [1]
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Index
1 – Einführung
2 – Photon Mapping
3 – Photon Tracing
4 – Radiance Estimate
5 – Rendern
6 – Irradiance Caching
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Kaustiken
Entstehen durch Spiegelung/Brechung
Quelle [2]
Quelle [3]
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Renderequation
Gesamt = Emittiert + Reflektiert
Reflektiert = Strahlung aus allen Richtungen
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Globale Beleuchtung
Direkte
Diffus
Kaustik
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Lösung mit Pathtracing
• Viele Samples pro Pixel
• Diffuse indirekte Beleuchtung sehr
langsam
• Partiell extremer Aufwand für
Kaustiken
Problem:
• Indirekte Beleuchtung generell möglich aber langsam
• Bildqualität bei Kaustiken unakzeptabel
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Beispiele
Quelle [4]
Quelle [5]
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Index
1 – Einführung
2 – Photon Mapping
3 – Photon Tracing
4 – Radiance Estimate
5 – Rendern
6 – Irradiance Caching
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Photon Mapping
• Tracing von Lichtquellen aus
• Particle Tracer
• Simuliert Brechung, Streuung
und Spiegelung
Vorteile:
• Unabhängig von der Geometrie
• Unabhängig vom Betrachter
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Two-Pass Algorithm
Quelle [6]
1. Schritt:
Photon Map
Quelle [7]
2. Schritt:
Rendern
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Index
1 – Einführung
2 – Photon Mapping
3 – Photon Tracing
4 – Radiance Estimate
5 – Rendern
6 – Irradiance Caching
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Photon Tracing
1. Aussenden
2. Tracen
3. Speichern
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Lichttypen
Pointlight
Area Light
Spherical Light
Directional Light
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Projection Maps
• Photonen ohne Treffer
• Kein gezieltes Photon
Tracing möglich
• Lösung: Projection Maps
Wie sieht die Lichtquelle die Szene?
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Projection Maps
• Hemisphäre partitionieren
• Nur in Partitionen mit
Objekten Tracen
• Tracen von ausgewählten
Objekten möglich
• Spezielle Caustics Map
möglich
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Photon Scattering
Diffus
Spiegelnd
Neues Photon mit:
Neues Photon mit:
• Zufälliger Richtung
• Spiegelrichtung
• Skalierter Leistung
• Skalierter Leistung
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Russian Roulette
Problem:
• Viele Photonen
• Unterschiedliche Leistung
Lösung:
• Komplett absorbieren oder Komplett weiterleiten
• Alle Photonen haben gleiche Leistung
• Ingesamt bessere Verteilung
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Speicherung
Wann werden Photonen gespeichert?
• Nicht auf spiegelnden Flächen
• Liefert keine sinnvollen
Informationen
• Nur auf diffusen Flächen
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Datenstruktur
Photon:
struct photon {
float x,y,z;
//position
float p[3];
char phi, theta;
//power
//incident direction
short flag;
//flag for kdtree
}
kd-Baum:
• Beliebiges Photon in O(log n)
• kompakte Speicherung möglich
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Index
1 – Einführung
2 – Photon Mapping
3 – Photon Tracing
4 – Radiance Estimate
5 – Rendern
6 – Irradiance Caching
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Radiance Estimate
Auswertung an Punkt x?
→
Näherung:
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Probleme
Dunkle Ecken
Color Bleeding
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Index
1 – Einführung
2 – Photon Mapping
3 – Photon Tracing
4 – Radiance Estimate
5 – Rendern
6 – Irradiance Caching
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Rendern
Welche Werkzeuge haben wir?
• Pathtracing
• Photon Mapping
Was brauchen wir?
• Direkte Beleuchtung: Raytracing
• Kaustiken: Photon Mapping
• Indirekte Beleuchtung:
- Pathtracing: genau aber langsam
- Photon Mapping: schnell aber ungenau
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Rendern der direkten Beleuchtung
• Berechnung trivial
• kein Pathtracing nötig
Raytracing
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Zwischenergebnis
Quelle [8]
Nur direkte Beleuchtung
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Rendern der Kaustiken
• Viele Photonen in der
Caustic Map
• Radiance Estimate
reicht
Radiance Estimate mit der Caustic Map
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Zwischenergebnis
Quelle [9]
Direkte Beleuchtung + Kaustiken
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Rendern der indirekten Beleuchtung
• Pathtracing zu
aufwändig
• Radiance Estimate zu
ungenau
Pathtracing mit wenigen Samples +
Radiance Estimate mit der Photon Map
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Endergebnis
Quelle [10]
Globale Beleuchtung
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Weiteres Beispiel
Quelle [11]
Pathtracing mit 1000
Samples
Quelle [12]
Photon Mapping mit
10.000 Photonen
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Index
1 – Einführung
2 – Photon Mapping
3 – Photon Tracing
4 – Radiance Estimate
5 – Rendern
6 – Irradiance Caching
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Irradiance Caching
Beobachtung:
• Indirekte Beleuchtung ändert sich langsam
• Kaustiken werden getrennt berechnet
Kriterien:
• Abstand zwischen x und xi
• Verhältnis der Normalen
Zusätzlich wichtig:
• Wie sieht Szene um xi aus?
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Beispiel
Quelle [13]
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Fazit
Photon Mapping...
...erweitert Raytracing basierte Verfahren
...beschleunigt indirekte Beleuchtung
…ermöglicht effiziente Kaustiken
Offene Fragen?
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Bildquellen
[1] - http://www.kraytracing.com/gallery/scaled/room_A.jpg
[2] - http://graphics.ucsd.edu/~henrik/images/metalring.jpg
[3] - http://fc05.deviantart.net/fs13/f/2007/065/a/3/Glass___VRay_Caustics_Test
[4] - http://www.ocf.berkeley.edu/~yjia/pathtracer/caustics-refl-4000-2hr.png
[5] - http://www.ocf.berkeley.edu/~yjia/pathtracer/caustics-10000-3hr.png
[6] - http://jgt.akpeters.com/papers/Christensen99/Fig2a.jpg
[7] - http://jgt.akpeters.com/papers/Christensen99/Fig2e.jpg
[8] - http://graphics.ucsd.edu/~henrik/images/imgs/cboxsoft.jpg
[9] - http://graphics.ucsd.edu/~henrik/images/imgs/cboxcau.jpg
[10] - http://graphics.ucsd.edu/~henrik/images/imgs/cboxgi.jpg
[11] - http://www.cs.rpi.edu/~cutler/classes/advancedgraphics/S09/lectures/
19_irradiance_caching_photon_mapping.pdf
[12] - http://www.cs.rpi.edu/~cutler/classes/advancedgraphics/S09/lectures/
19_irradiance_caching_photon_mapping.pdf
Photon Mapping
Leonhard Rabel
computer graphics & visualization
Bildquellen
[13] - http://graphics.stanford.edu/courses/cs348b-00/lectures/lecture15/talk.pdf
Photon Mapping
Leonhard Rabel
computer graphics & visualization