Top Banner
Photon Mapping Not to scale
27

Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Dec 16, 2015

Download

Documents

Bruce Cole
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Photon Mapping

Not to sc

ale

Page 2: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Photon Mapping

How did I use it 10 years ago? Why might you want to use it

tomorrow?

Page 3: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Ever increasing complexity(For an approximation!)

Warning: Contains Math

Page 4: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Photon map creation

• Emit photon from light sources in turn based on relative energy output, until ‘n’ emitted.

• Photons all emit at same power but power and color may vary after reflectance.

• Stored AND / OR reflected at each hit surface.• Adjust photon energy based on number of

actual emitted photons.• Heavy use of random probability based on

surface material (drand48)

Page 5: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Photon Map – Raw samples

Page 6: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Sampling photons

• Incorrect density estimates = dark corners & edges• Problem: Photon map does not store geometry• Impractical… for direct visualization

Page 7: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Kd-tree

From efficientstorage to critical tool.

Can be dynamizedfor generic use

Page 8: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Why do indirect lights work?

• Photon Map stores energy to emit ‘The Final Bounce’• Ray tracers use photon map to accelerate ‘Final Gathering’• Light Energy is conserved

Page 9: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Indirect Lights

Sampled from top levels ofkd-tree

Page 10: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Direct lights close to surfaces

Page 11: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Spatial structuresfor visibility testing

• Hybrid BSP• Top levels are octree• Lower levels arbitraryplanes• Stored as binary tree• Not balanced• Polys in leaves as edges

Page 12: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Packing texturesGood enough

• Many ways to generate texture atlas• Can be part of seam reduction• I used simple, largest first box packing with empty

space reclamation

Page 13: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

There seems to be a problem

• The map makers problem… how to map a round surface to a flat plane, and hide the evidence.

• Biliner filtering worksagainst you.• There is no perfect solution.

Page 14: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

(Feature) Size Matters

• Texel size vs Geometry wall thickness means choosing sample points wisely.

• Shift sample points within texel.• Use multiple sample point locations.

Page 15: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Direct Lights can look coarse

• Not enough of them to look like indirect light

Page 16: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Direct lights can look soft

• When considered a surface instead of a point.

Page 17: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Why can’t I see the stars during the day time?

• Exposure control to the rescue… map infinite floating point light range to 8 bits.

• Pics show 0.5, 1.0, 2.0 K values for equation Klightebrightness 1

Page 18: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Area lights

• Pretend it’s Radiosity• Light polys sampled as jittered grid, texel receivers• How much energy from one area to another

Page 19: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Final Results (1 of 3)

Page 20: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Final Results (2 of 3)

Page 21: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Final Results (3 of 3)

Page 22: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

How fast is it?

Operation Test 1 Test 2 Test 3 Test 4 Test 5 Test6 Num Photons 100,000 1,000,000 1,000,000 2,000,000 2,0000,000 2,000,000 Lightmap resolution 0.05m 0.025m 0.025m 0.01m 0.1m 0.5m Multisamples per direct light 20 50 50 200 200 200 Number Indirect lights 100 1,000 5,000 10,000 10,000 10,000 Total texels 685,682 1,892,375 1,892,375 7,317,169 327,842 158,387 Total Tex sample points 569,454 1,392,430 1,392,430 5,987,230 299,660 157,030 Total Light sample points 200 1,250 5,250 11,000 11,000 11,000 Total process time 2m 8.5s 19m 26.7s 1h 18m 57s 10h 40m 18s 40m 5s 24m 43s Prepare Geometry 17s 17s 17s 17s 17s 17s Create Smoothgroups 722ms 722ms 729ms 725ms 722ms 723ms Create Lightmaps 4.9s 4.9s 4.9s 5.15s 4.9s 4.9s Build Photon Map 2.8s 20.66s 20.71s 41.7s 41.8s 41.25s Balance kd-tree 152ms 1.73s 1.72s 3.56s 3.58s 3.59s Create indirect lights 104ms 1.16s 1.15s 2.13s 2.12s 2.17s Build Polygon BSPs 11.3s 11.3s 11.3s 11.3s 11.3s 11.3s Light World (& Calc Sample Points)

1m 48.3s 18m 46.4s 1h 18m 17s 10h 39m 15s 39m 3s 23m 40s

Pack Lightmap textures 78ms 522ms 523ms 714ms 31ms 13ms

Page 23: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Real-time?

• Deferred lighting / shading for many direct light sources.

• May not need shadows / occlusion per light.• Photon map creation (sample scene energy) and

prepare virtual lights takes ‘seconds’.• As background process, get results with latency.• Energy changes when lights OR geometry move.• Represent geometry with LOD mesh or voxels.

Page 24: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Screens fromMy Virtual Home (1 of 3)

Page 25: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

What if we changed the kitchen? (2 of 3)

Page 26: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

MVH Looking good (3 of 3)

Page 27: Photon Mapping. How did I use it 10 years ago? Why might you want to use it tomorrow?

Questions?

From self published paper:Diffuse Global Illumination via Direct and Virtual Indirect Light Sources (2003) Download from citeseer or gmscript.com http://www.gmscript.com/gamemonkey/downloads/misc/LightingTechnique1.pdf

Some images used without permission… Thanks Google.

Thank you for staying awake and not texting.