0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Robust Iterative Find-Next-Hit Ray Traversal のメモ

Last updated at Posted at 2019-12-05

Robust Iterative Find-Next-Hit Ray Traversal

透過マテリアルがあったり, 計上のふちなどで, 距離が近い順(front-to-back)で N 個の交点をリストアップしたいときがあります.

特に alpha 付き polygon でレイを減衰させてトレースしたい(shadow ray 含む), subsurface scattering で媒体内にある (alpha があるかしれない) blocker geometry を適切に扱いたいとき, コップに注がれた水とガラスの境界を適切な扱いたい, など.

mult-hit ray traversal というのがありますが, 現状の Embree では対応していません(v3.6.1 時点).

Embree には intersection filter 機能がありますが, これはかならずしも front-to-back で交点がレポートされるわけではないのと, intersection filter で渡ってくる potentially hit な geom/prim の詳細は取れないため(v3.6.1 時点), intersection filter でも front-to-back で N 個の交点リストアップというのもできません(ものすごいトリッキーなことをすれば限られたケースでは実現できるが...)

基本的には毎回レイをトラバースすることになります.

Find-Next-Hit Ray Traversal

上記の問題にもからんで, たとえば複数のポリゴンがちょうど重なっているなどのケースでも, ロバストに交点を出したいという需要があります.

簡易版

t が同じ場合は, primID/geomID の若い順でどちらを採用するか決める.
レイのリスタート(再トラバース)が必要.

Embree など既存のフレームワークで実装しやすい.

より効率いい版

queue で bvh traverse を管理します. 詳細は論文参照ください(OSS OSPray にも実装されているかな?).
そのため, traversal に手をいれる必要がありますが, 効率よく動くのが期待されます.

TODO

  • NanoRT で実装する(一応 multi-hit ray traversal, any-hit ray traversal は NanoSG(シーングラフ)用に一応実装されている)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?