Transcript Slides

Multiple vertex merging
Kun Xu
Previous works
• Photon mapping
– Generate various light sub-paths and eye subpaths
– Merge a light sub-path and an eye sub-path to a
full path
– But, merge at ONLY ONE vertex
Our idea
Light sub-path vertex
Eye sub-path vertex
𝒚𝟎
• Merge any
paths when possible
• Example:
𝒙𝟎
𝒙𝟐
𝒙𝟏
𝒛𝟏
𝒚𝟏
𝒆𝟎
𝒚𝟐
𝒚𝟑
𝒛𝟎
𝒆𝟑
𝒛𝟐
𝒆𝟏
𝒆𝟐
𝒛
𝟑
– We have one eye sub-path: 𝒆𝟎 𝒆𝟏 𝒆𝟐 𝒆𝟑 ,
three light sub-paths: 𝒙𝟎 𝒙𝟏 𝒙𝟐 , 𝒚𝟎 𝒚𝟏 𝒚𝟐 𝒚𝟑 , 𝒛𝟎 𝒛𝟏 𝒛𝟐 𝒛𝟑
– We also know: (𝒙𝟏 , 𝒚𝟏 ), (𝒚𝟐 , 𝒆𝟏 ), (𝒛𝟐 , 𝒆𝟐 ) are near and can
be merged
– Then we can generate several new paths by merging:
𝒛𝟎 𝒛𝟏 𝒛𝟐 𝒆𝟏 𝒆𝟎 ,𝒚𝟎 𝒚𝟏 𝒚𝟐 𝒆𝟎 , 𝒙𝟎 𝒙𝟏 𝒚𝟐 𝒆𝟎
Our idea
Light sub-path vertex
Eye sub-path vertex
𝒚𝟎
• Example:
𝒙𝟎
– Then we can generate
𝒚𝟐
𝒆𝟎
several new paths by merging:
𝒛𝟎 𝒛𝟏 𝒛𝟐 𝒆𝟏 𝒆𝟎 ,𝒚𝟎 𝒚𝟏 𝒚𝟐 𝒆𝟎 , 𝒙𝟎 𝒙𝟏 𝒚𝟐 𝒆𝟎
𝒚𝟑
– Difference from “vertex merging”[siga 2012]
and Photon Mapping
𝒙𝟐
𝒙𝟏
𝒛𝟎
𝒛𝟏
𝒚𝟏
𝒆𝟑
𝒛𝟐
𝒆𝟏
𝒆𝟐
𝒛𝟑
• They only merge once alone the path (merge the end vertex of light sub-path and
the end vertex of eye sub-path)
• But we can merge multiple times along the path
E.g., in the path 𝒙𝟎 𝒙𝟏 𝒚𝟐 𝒆𝟎 , two points (𝒙𝟏 , 𝒚𝟐 ) are merged points
• Hence, our method re-use existing paths more
Naïve implementation of our approach
• First, We use the multiple importance sampling framework
• For each merged path
– Calc. a probability p for that path
– Calc. a weight w for that path
– Calc. contribution f
𝒆𝟑
𝒆𝟎
𝒆𝟏
𝒆𝟐
• The outgoing radiance can be naively simply evaluated as:
𝑖
𝑓𝑖
𝑤𝑖 ⋅
𝑝𝑖
• Merging policy:
– Similar to PM, when distance of two points smaller than a given radius
Fast evaluation by caching
• Since we allow merge at multiple vertices at a path, the
number of new generated paths grow exponentially
– E.g., path of length 10, assume each vertex averagely has 100
neighboring vertices to be merged,
– Then, we get 100^10 new paths, too many to evaluate
• Idea
– Note that many new path
share sub-paths
e.g. paths 𝒚𝟎 𝒚𝟏 𝒚𝟐 𝒆𝟎 and 𝒙𝟎 𝒙𝟏 𝒚𝟐 𝒆𝟎
share the same latter part 𝒚𝟏 (𝒙𝟏 )𝒚𝟐 𝒆𝟎
– So, we can cache sub-contributions,
sub-weights, and sub-probabilities at
position 𝒚𝟏
– Then, we can reduce a lot of costs
𝒚𝟎
𝒙𝟎
𝒙𝟐
𝒙𝟏
𝒛𝟏
𝒚𝟏
𝒆𝟎
𝒚𝟐
𝒚𝟑
𝒛𝟎
𝒆𝟑
𝒛𝟐
𝒆𝟏
𝒆𝟐
𝒛𝟑
Details
• How to calculate weight, probability and
contribution?
– Details coming soon …
• How to exactly do the caching scheme
– Like walking on a “graph”
Discussion
• Will the proposed scheme better work for
scattering media?
Probability Evaluation
𝒍∗𝟏
• Let’s see how to define the probability of a merged path:
𝒍𝟏
∗
𝑙0 𝑙1 𝑙2 𝑙2 𝑙3 𝑒1 𝑒0
𝒍𝟐
• The final probability :
𝒍∗𝟐
• 𝑃 = 𝑃 𝑙0 𝑃 𝑙0 → 𝑙1 𝑃 𝑙1 → 𝑙2 ⋅ 𝜋𝑟 2 𝒆
𝒍𝟑
𝟎
∗
∗
∗
2
⋅ 𝑃 𝑙1 → 𝑙2 (𝑃 𝑙2 → 𝑙3 ⋅ 𝜋𝑟 ) 𝑃(𝑒0 → 𝑒1 )
𝒆
• For a general path (𝑙0 𝑙1 … 𝑙𝑠 (𝑒𝑡 )𝑒𝑡−1 … 𝑒0 ) (𝑙𝑠 is merged𝟏 with 𝑒𝑡 )
𝑃 = 𝑃𝑒 ⋅ 𝑃𝑙
• Eye sub-path probability: 𝑃𝑒 =
𝑡−1
𝑖=1 𝑝(𝑒𝑖 )
𝒍𝟎
, 𝑝 𝑒𝑖 = 𝑝(𝑒𝑖−1 → 𝑒𝑖 )
• Light sub-path probability: 𝑃𝑙 = 𝑝 𝑙0 𝑠𝑖=1 𝑝(𝑙𝑖 )
• If 𝑙𝑖 is not a merged vertex (𝑖 ≥ 1) : 𝑝 𝑙𝑖 = 𝑝(𝑙𝑖−1 → 𝑙𝑖 )
• Else if 𝑖 < 𝑠 (𝑙𝑖 is a merged vertex):
∗
𝑝 𝑙𝑖 = 𝑝 𝑙𝑖−1 → 𝑙𝑖 ⋅ 𝜋𝑟 2 ⋅ 𝑝 𝑙𝑖,𝑝𝑟𝑒𝑣
→ 𝑙𝑖∗
∗
𝑙𝑖∗ is merged with 𝑙𝑖 , 𝑙𝑖,𝑝𝑟𝑒𝑣
denotes the previous vertex of 𝑙𝑖∗ in its original path
• Else (𝑖 = 𝑠) 𝑝 𝑙𝑠 = 𝑝 𝑙𝑠−1 → 𝑙𝑠 ⋅ 𝜋𝑟 2 ⋅ 𝑝(𝑒𝑡−1 → 𝑒𝑡 )
𝒍∗𝟏
Weight
𝒍𝟏
𝒍𝟎
𝒍𝟐
• For a general path (𝑙0 𝑙1 … 𝑙𝑠 (𝑒𝑡 )𝑒𝑡−1 … 𝑒0 )
(𝑙𝑠 is merged with 𝑒𝑡 )
𝒍∗𝟐
𝒆𝟎
𝒍𝟑
𝒆𝟏
– Totally 𝑠 + 𝑡 − 1 vertices (except two end points)
– Totally 2𝑠+𝑡−1 methods to sample this path (This is because each vertex has two choices:
merged or not merged)
– Rewrite the path as : 𝑧0 𝑧1 … 𝑧𝑠+𝑡
– Sub-weight:
𝑤𝑚𝑒𝑟𝑔𝑒 𝑧𝑖 = 𝜋𝑟 2 ⋅ 𝑒 −𝑛𝑖 , 𝑤𝑐𝑜𝑛𝑛𝑒𝑐𝑡 𝑧𝑖 = 1, 𝑛𝑖 is the glossiness parameter
– Overall weight
𝑠+𝑡−1
𝑤=
𝑖=1
𝑤𝑚𝑒𝑟𝑔𝑒
𝑤 𝑧𝑖
𝑧𝑖 + 𝑤𝑐𝑜𝑛𝑛𝑒𝑐𝑡 𝑧𝑖