Upgrade to Pro — share decks privately, control downloads, hide ads and more …

こうろせつだん!

Avatar for ushiostarfish ushiostarfish
November 16, 2025
78

 こうろせつだん!

レイトレ合宿 11(https://sites.google.com/view/rtcamp11) でのセミナー資料です

Avatar for ushiostarfish

ushiostarfish

November 16, 2025
Tweet

Transcript

  1. こうろせつだん! I N T R O D U C T

    I O N T O P A T H C U T S ushiostarfish
  2. 2 Crypto: investing & trading C a u s t

    i c s i s a n E n d l e s s D r e a m o n R a y T r a c i n g 山梨・金精軒 水信玄餅 おいしかった レイトレ合宿7 shockerさんからのもらいもの レイトレ合宿10 宿の池
  3. 3 D I F F I C U L T

    Y O F C AU S T I C S I N PAT H T R AC I N G A tiny light BRDF sampling Rarely find a path…  A tiny light Light sampling Never valid path… 
  4. 4 G E N E R A L L I

    G H T T R A N S P O R T A L G O R I T H M S S U I TA B L E F O R C AU S T I C S o Photon Mapping o Bidirectional path tracing o Vertex connection and merging o Metropolis light transport
  5. 5 L I G H T T R A N

    S P O R T A L G O R I T H M S D E D I C AT E D F O R C AU S T I C S o Walter, et al. “Single Scattering in Refractive Media with Triangle Mesh Boundaries” [2009] o Just 1 refraction o Newton-Raphson to find a contributable path o Minimize the cost function o Fully deterministic to find all of the contributable path☺ Figure 7 on the paper An Example of Cost Function 𝐶𝑡 = ෝ 𝒏 − ℎ𝑡 |ℎ𝑡 | ℎ𝑡 = −(𝜂𝑖 𝜔𝑖 + 𝜂𝑜 𝜔𝑜 ) where Super Simple !! ☺ light Refractive Surface Shading point initial Converged!
  6. 6 A F U N DA M E N TA

    L I S S U E o Newton-Raphson itself is for the local minimum for finding minimum o high sensitivity to initial conditions Shading point light Converged Overlooked  Specular Manifold Sampling (Talk Video) Converged at green solution Converged at red solution
  7. 7 T W O T Y P E S O

    F A P P ROAC H E S F O R M U L T I P L E S O L U T I O N S o Walter, et al. “Single Scattering in Refractive Media with Triangle Mesh Boundaries” [2009] Point Sampling • Jakob and Marschner, ”Manifold Exploration” [2012] • Hanika, et al., ”Manifold NEE” [2015] • Hanika et al., “Specular Manifold Sampling” [2020] Primitive Search • Wang, at al, “Path Cuts” [2020] • Extending to multi dimensions • Fan, at al, ”Specular Polynomials” [2024] • Fan, at al, “Bernstein Bounds for Caustics” [2025] • Stochastic Culling Today’s Focus How do you handle multiple solutions?
  8. 8 A S S U M P T I O

    N S F O R PAT H C U T S o Triangle only o Phong normal interpolation only o No normal mapping o A weak point of the current primitive approach
  9. 9 O V E RV I E W O F

    PAT H C U T S o Two-phases approach o [Stage 1] Enumerate admissible tuples of triangles o [Stage 2] Newton-Raphson iterations to find a valid path P P -> B -> D -> Q looks admissible D A B C E F Q Stage 1. Finding Admissible Tuples P D B Q Stage 2. Newton-Raphson iterations
  10. 10 [ S TA G E 1 ] F I

    N D I N G A D M I S S I B L E T U P L E S o Brute force search works, but prohibitively expensive o Search using a bounding volume hierarchy for mesh P Q Check if an admissible path is contained Yes P Q Go down the tree and do the same recursively Check this box too This can be seen as a cut of non-admissible path space. Path Cuts
  11. 11 A D M I S S I B L

    E C H E C K o Treat AABB as an interval of a point -> interval arithmetic is a good-fit tool o Use interval arithmetic for all values and vectors o Incident/outgoing direction, half vector, normal can be expressed with “interval” o The cost function can be expressed with interval struct intr { float lower; float upper; }; Keep track of minimum and maximum of the value. @ykozw88 https://speakerdeck.com/ykozw/ahuin yan-suan @Shocker_0x15 https://qiita.com/shocker- 0x15/items/f2d7f6135c1bbfa16859 P Q Triangle T The cost function to interval arithmetic intr3 wi = normalize( P - make_intr3( Triangle T ) ); intr3 wo = normalize( Q - make_intr3( Triangle T ) ); intr3 ht = normalize( - eta_i * wi - eta_o * wo ); if ( zeroIncluded( normal - ht ) ) { // may contain admissible path } The interval of the cost function 𝐶𝑡 = ෝ 𝒏 − ℎ𝑡 |ℎ𝑡 |
  12. 12 B A D N E W S 1,368 tuples…

    TT ( 2 refractions ) TTT ( 3 refractions ) 146,598 tuples…
  13. 13 B A D N E W S o The

    algorithm sounds reasonable; however, unfortunately VERY EXPENSIVE. o Too loose interval bounds o Combination explosion A B An Evil Example: overlapped bounds A – B vector can be ANY DIRECTION!!! The admissible check is totally useless… P Q M at the first, N at the second = MN candidates!!
  14. 14 A N Y T H I N G W

    E C A N D O ? o Specialize some functions interval arithmetic o Square, normalize, reflection, etc.. o Affine Arithmetic o Combination explosion still there..
  15. 16 A D M I S S I B L

    E T U P L E F I N D I N G - P H O T O N T R AC I N G o Trace photons but store a path “tuples” instead of contributions o Look up them during eye path ray tracing similarly to photon mapping light B D Store Tuple B->D Pros o Simple and Fast! o Less false-positive tuples o Can be used as a good initial path for Newton-Raphson Cons ( open problems ) o Some tuples may be missed o Need infinite photons to enumerate all of admissible tuples o Difficulty to support volume o Expensive to store tuples along rays
  16. 17 [ S TA G E 2 ] RO O

    T F I N D I N G o Assumes there is only 1 solution for each tuple for simplicity o Assumes the scene geometry is subdivided enough o The resolution dependency is a weak point of primitive search algorithms o We can use subdivision but appropriate depth are not clear
  17. 18 T H E C O S T F U

    N C T I O N O N PAT H C U T S o Path vertex can be parameterized by a barycentric coordinate 𝐶𝑡 = ෝ 𝒏 − ℎ𝑡 |ℎ𝑡 | ℎ𝑡 = −(𝜂𝑖 𝜔𝑖 + 𝜂𝑜 𝜔𝑜 ) where Cost function for Refraction 𝐶𝑟 = ෝ 𝒏 − ℎ𝑟 |ℎ𝑟 | ℎ𝑟 = 𝜔𝑖 + 𝜔𝑜 |𝜔𝑖 + 𝜔𝑜 | where Cost function for Reflection light shading point 𝛼0 , 𝛽0 2 parameters for each vertex Find the value where the cost to be zero
  18. 19 N E W T O N - R A

    P H S O N o Let’s think the local relationship between 𝛼0 , 𝛽0 and 𝐶 like 1d Newton's method Δ𝐶0 Δ𝐶1 Δ𝐶2 = 𝜕𝐶0 𝜕𝛼0 𝜕𝐶0 𝜕𝛽0 𝜕𝐶1 𝜕𝛼0 𝜕𝐶1 𝜕𝛽0 𝜕𝐶2 𝜕𝛼0 𝜕𝐶2 𝜕𝛽0 Δ𝛼0 Δ𝛽0 Δ𝐶0= 𝜕𝐶0 𝜕𝛼0 Δ𝛼0 + 𝜕𝐶0 𝜕𝛽0 Δ𝛽0 1st dim Δ𝐶1= 𝜕𝐶1 𝜕𝛼0 Δ𝛼0 + 𝜕𝐶1 𝜕𝛽0 Δ𝛽0 2st dim Δ𝐶2= 𝜕𝐶2 𝜕𝛼0 Δ𝛼0 + 𝜕𝐶2 𝜕𝛽0 Δ𝛽0 3st dim Note that the derivatives can be obtained by forward auto diff derivatives
  19. 20 N E W T O N - R A

    P H S O N 𝜕𝐶0 𝜕𝛼0 𝜕𝐶0 𝜕𝛽0 𝜕𝐶1 𝜕𝛼0 𝜕𝐶1 𝜕𝛽0 𝜕𝐶2 𝜕𝛼0 𝜕𝐶2 𝜕𝛽0 −1 Δ𝐶0 Δ𝐶1 Δ𝐶2 = Δ𝛼0 Δ𝛽0 Δ𝐶0 Δ𝐶1 Δ𝐶2 = 𝜕𝐶0 𝜕𝛼0 𝜕𝐶0 𝜕𝛽0 𝜕𝐶1 𝜕𝛼0 𝜕𝐶1 𝜕𝛽0 𝜕𝐶2 𝜕𝛼0 𝜕𝐶2 𝜕𝛽0 Δ𝛼0 Δ𝛽0 What we want to know 𝛼0 𝑥+1 𝛽0 𝑥+1 = 𝛼0 𝑥 𝛽0 𝑥 − 𝜕𝐶0 𝜕𝛼0 𝜕𝐶0 𝜕𝛽0 𝜕𝐶1 𝜕𝛼0 𝜕𝐶1 𝜕𝛽0 𝜕𝐶2 𝜕𝛼0 𝜕𝐶2 𝜕𝛽0 −1 𝐶0 𝐶1 𝐶2 Newton-Raphson step Is it solvable??? The inverse of a matrix is only defined for square matrices
  20. 21 T H E P RO B L E M

    𝑦0 𝑦1 𝑦2 = 𝑎11 𝑎12 𝑎21 𝑎22 𝑎31 𝑎32 𝑥0 𝑥1 We want this x 𝒚 = 𝐴𝒙 However, the closest point can be defined 𝐴𝒙 𝐴 1 0 𝐴 0 1 𝐴 0 0 𝐴𝒙 𝒀 The Condition: 𝒚 − 𝐴𝒙 ⋅ 𝐴 1 0 = 0 𝒚 − 𝐴𝒙 ⋅ 𝐴 0 1 = 0 Rarely 𝒚 = 𝐴𝒙 is satisfied…  Observation: > called overdetermined system Normal Equation Square matrix 𝑎11 𝑎21 𝑎31 𝑇 𝒚 − 𝐴𝒙 = 0 𝑎12 𝑎22 𝑎32 𝑇 𝒚 − 𝐴𝒙 = 0 𝑨𝑻 𝒚 − 𝐴𝒙 = 0 𝑨𝑻𝑨𝒙 = 𝑨𝑻𝒚
  21. 22 S O LV I N G N O R

    M A L E Q U AT I O N o 𝒙 = 𝑨𝑻𝑨 −𝟏 𝑨𝑻𝒚 is a straight-forward way o Path Cuts paper uses this approach o Requires inverse of large matrix  ( 6x6 for 3 bounces ) o Calculation of 𝑨𝑻𝑨 is generally not recommended o Numerically unstable ( increase of conditional number ) o QR decomposition can be used o Good balance of stability and cost o Used in Pytorch o Alternatives o SVD ( Jacobi SVD ) o Cholesky decomposition (need 𝑨𝑻𝑨)
  22. 23 S O LV I N G N O R

    M A L E Q U AT I O N V I A Q R o Decompose matrix 𝑨 into Orthogonal matrix 𝑸 and upper triangular matrix 𝐑 o I used householder QR decomposition (𝑸𝑹)𝑻(𝑸𝑹)𝒙 = (𝑸𝑹)𝑻𝒚 𝑹𝒙 = 𝑸𝑻𝒚 … 𝑹𝒙 = 𝒚′ 𝑟11 𝑟12 0 𝑟22 0 0 𝑥0 𝑥1 = 𝑦0 ′ y1 ′ 𝑦2 ′ Very easy to solve ☺ 𝑟11 𝑥0 + 𝑟12 𝑥1 = y0 ′ 𝑥0 = y0 ′ − 𝑟12 𝑥1 𝑟11 𝑨𝑻𝑨𝒙 = 𝑨𝑻𝒚 Normal Equation 𝑨 = 𝑸𝑹 = 𝑞11 𝑞12 𝑞13 𝑞21 𝑞22 𝑞23 𝑞31 𝑞32 𝑞33 𝑟11 𝑟12 0 𝑟22 0 0 Orthogonal 𝑥1 = y1 ′ 𝑟22 𝑟22 𝑥1 = y1 ′
  23. 24 B A D N E W S o Really

    Unstable!!!!!! o It’s not too bad if the initial condition is good to be fair o Some techniques are proposed The Initial condition Manifold Exploration Specular Manifold Sampling Angle based They are not game changer..
  24. 25 C AT C H o Since we use the

    local relationship between parameters and the cost function o The strong nonlinearity looks SUS o More specifically, normalizations of vectors Δ𝐶0 Δ𝐶1 Δ𝐶2 = 𝜕𝐶0 𝜕𝛼0 𝜕𝐶0 𝜕𝛽0 𝜕𝐶1 𝜕𝛼0 𝜕𝐶1 𝜕𝛽0 𝜕𝐶2 𝜕𝛼0 𝜕𝐶2 𝜕𝛽0 Δ𝛼0 Δ𝛽0 𝐶𝑡 = ෝ 𝒏 − ℎ𝑡 |ℎ𝑡 | ℎ𝑡 = −(𝜂𝑖 𝜔𝑖 + 𝜂𝑜 𝜔𝑜 ) where Cost function for Refraction in Path Cuts Current 0
  25. 26 N O R M A L I Z AT

    I O N F R E E F O R M o reflection 𝜔𝑟 = 𝑛 2𝜔𝑖 ⋅ 𝑛 𝑛 ⋅ 𝑛 − 𝜔𝑖 𝜔𝑖 𝑛 𝜔𝑜 normalization free o refraction 𝜔𝑡,𝑃𝐵𝑅𝑇 = − ෝ 𝜔𝑖 𝜂 + cos𝜃𝑖 𝜂 − cos𝜃𝑡 ො 𝑛 𝜔𝑡,𝑃𝐵𝑅𝑇 , 𝜔𝑖 , 𝑛 are not normalized 𝜂 = 𝜂𝑜 𝜂𝑖 , ෝ 𝜔𝑖 = 𝜔𝑖 |𝜔𝑖 | , ො 𝑛 = 𝑛 |𝑛| Required normalize vectors… https://www.pbr-book.org/4ed/Reflection_Models/Specular_Reflection_and_Transmission#eq:refracted-direction
  26. 27 M A K E I T N O R

    M A L I Z AT I O N F R E E 𝜔𝑡,𝑃𝐵𝑅𝑇 = − ෝ 𝜔𝑖 𝜂 + cos𝜃𝑖 𝜂 − cos𝜃𝑡 ො 𝑛 𝜂 = 𝜂𝑜 𝜂𝑖 , ෝ 𝜔𝑖 = 𝜔𝑖 |𝜔𝑖 | , ො 𝑛 = 𝑛 |𝑛| 𝜔𝑖 𝑛 2𝜂𝜔𝑡,𝑃𝐵𝑅𝑇 = 𝜔𝑖 𝑛 2𝜂 − ෝ 𝜔𝑖 𝜂 + cos𝜃𝑖 𝜂 − cos𝜃𝑡 ො 𝑛 𝜔𝑜 = −(𝑛 ⋅ 𝑛)𝜔𝑖 + 𝜔𝑖 ⋅ 𝑛 − 𝜔𝑖 ⋅ 𝜔𝑖 𝑛 ⋅ 𝑛 𝜂2 − 1 + 𝜔𝑖 ⋅ 𝑛 2 𝑛 normalization free
  27. 28 N E W C O S T F U

    N C T I O N F O R R E F R AC T I O N 𝐶𝑡,𝑛𝑒𝑤 = 𝜔𝑡 × (𝒗𝑖+1 − 𝒗𝑖 ) 𝜔𝑡 𝒗𝑖 𝒗𝑖+1 Next Triangle Current Triangle 𝜔𝑖 𝜔𝑖 = 𝒗𝑖−1 − 𝒗𝑖 𝒗𝑖−1 𝑛 𝜔𝑡 = −(𝑛 ⋅ 𝑛)𝜔𝑖 + 𝜔𝑖 ⋅ 𝑛 − 𝜔𝑖 ⋅ 𝜔𝑖 𝑛 ⋅ 𝑛 𝜂2 − 1 + 𝜔𝑖 ⋅ 𝑛 2 𝑛 Cross product can check directional equality without normalization ☺
  28. 29 R E A L LY S TA B L

    E A N D Q U I C K T O C O N V E R G E ! ! ! T Never converged with cost function on path cuts TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT ( 30 refractions ) The Initial condition
  29. 31 Path Cuts Cost Function My Implementation The initial params

    are 𝛼, 𝛽 = (1 3 , 1 3 ) mesh/slab1sss.obj Specular Polynomials Norm Free Cost Function Note that color calc is not accurate on my impl
  30. 32 My Implementation The initial params are 𝛼, 𝛽 =

    (1 3 , 1 3 ) Specular Polynomials Norm Free Cost Function mesh_pool_rotate/pool_inside.obj sp_pool/opsr_new.obj Path Cuts Cost Function
  31. S UMMARY 33 o Introduced Path Cuts o Built by

    basic techniques( interval arithmetic, auto diff, least squares ) o fully deterministic o Proposed alternative solutions o Photon Tracing for admissible tuples o Better convergence with normalization free form o Open Problems o Cons of photon tracing o Still difficult path for newton’s method o Thank you, linear algebra
  32. R E F E R E N C E S

    34 • きなこもち, Pathtracing technics for Caustics ( https://speakerdeck.com/kinakomoti321/pathtracing-technics- for-caustics-f93e343a-2d66-4d7c-a78f-23a20a7968af ) • きなこもち, Specular Polynomial ( https://scrapbox.io/ShaderMemorandom/Specular_Polynomial ) • @ykozw88, Interval Arithmetic, Affine Arithmetic ( https://speakerdeck.com/ykozw/ahuinyan-suan ) • @Shocker_0x15, アフィン演算で求める三角形上の関数の範囲 ( https://qiita.com/shocker- 0x15/items/f2d7f6135c1bbfa16859 ) • Walter, et al. “Single Scattering in Refractive Media with Triangle Mesh Boundaries” [2009] • Jakob and Marschner, ” Manifold exploration: a Markov Chain Monte Carlo technique for rendering scenes with difficult specular transport” [2012] • Hanika, et al., ”Manifold Next Event Estimation” [2015] • Hanika et al., “Specular Manifold Sampling for Rendering High-Frequency Caustics and Glints” [2020] • Wang, at al, “Path Cuts: Efficient Rendering of Pure Specular Light Transport” [2020] • Fan, at al, ”Specular Polynomials” [2024] • https://github.com/mollnn/spoly • Fan, at al, “Bernstein Bounds for Caustics” [2025] とってもとってもありがとうございます
  33. 37 D I F F U S E S H

    A D I N G F O R A P O I N T L I G H T Illustration of the generalized geometric term(GGT) Bernstein Bounds for Caustics 𝐿𝑜 = 𝐸 𝑅 𝜋 𝐸 = 𝑑Φ 𝑑𝐴 : Irradiance 𝑅 𝜋 : Diffuse BRDF light Δ𝜔 Δ𝐴 = 𝑑2 cos𝜃 Δ𝜔 𝑑 Δ𝐴 = 𝑑Φ 𝑑𝐴 𝑅 𝜋 = 𝑑Φ 𝑑𝜔 cos𝜃 𝑑2 𝑅 𝜋 = 𝐼 cos𝜃 𝑑2 𝑅 𝜋 𝐼 = 𝑑Φ 𝑑𝜔 : light intensity 𝑑𝜔 𝑑𝐴 Auto diff or something clever method can be used
  34. 38 O P E N P RO B L E

    M 2 o A specular path is actually defined by the first vertex o Variable reduction could be possible like specular polynomials o However, it can’t handle TIR situation… 𝛼0 , 𝛽0 No parameter No parameter True Path Current Path Oops, can’t be refraction due to TIR No valid derivatives… A corner case