1
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.

Patch textures(mesh colors)のメモ

Last updated at Posted at 2020-01-05

CyHair で有名な Cem Yuksel 先生のところから

概要

ptex のような感じですが, より既存パイプラインに乗せやすい & 効率化 & HW 化しやすい感じの texture mapping 手法です.
初出論文(Mesh colors)では, ptex と比べて, meshcolors では triangle 対応が利点とありますが, ptex も実装のほうは triangle 対応しているので, この点についてはあまり advantage は無くなったと思います.

手法の発展

Mesh colors : 初出 http://www.cemyuksel.com/research/meshcolors/meshcolors_techreport.pdf
Mesh Color Textures : 既存の 2D texture に mesh color をコンバートすることで, でより効率的な HW 化(ただし HW 化は完全ではない. たとえば anisotropic filtering 未対応
Patch Textures: Hardware Implementation of Mesh Colors : Mesh colors の完全な HW 対応(aniso filtering 対応) http://www.cemyuksel.com/research/meshcolors/patchtextures_hpg2019.pdf

実装

face ごとに texture を持つため, 隣接 face との補間をどうするかが
特に GPU(rasterizer)ですとこの辺りが面倒です

edge, 隣接 face を求める

入力形状が subdivision surface(quad mesh)でしたら, OpenSubdiv などで求めることができますが, 任意 polygon の場合は half-edge を計算するなどして edge, 隣接 face のデータ構造を求める必要があります.

単に隣接関係だけでよければ, std::map<std::pair<int, int>> でやってしまうのが一番楽かも?ですが,

meshcolors などに使える half-edge ライブラリを作りました.

ただ, 隣接関係を求めるのは half-edge を walk する必要がありちょっと面倒です.

既存のものを使うのであれば, libigl, OpenMesh など形状処理ライブラリはいくつかありますが, pmp-library

が組み込みが楽かと思います.
ただ, pmp-library や libigl は三角形限定とかだったりします(tinymeshutils は三角形や四角形, 多角形混在にも使えます)

offline raytrace レンダラでの実装

特段大きな変更はありません.
ptex のように, 隣接 face の情報をみて, filtering します.

bindless texture

bindless texture でやってしまうというのが一番楽ですが, HW に制約がでます(最新 NVIDIA/AMD GPU では対応しているかと思いますが). また, Vulkan では bindless texture に対応する機能が標準機能としてはまだありません https://community.khronos.org/t/bindless-textures/103941/13

SSBO

GPU の場合, SSBO(全体を 1D/2D array として扱う)でやるのが楽でしょうか.
tinymeshutils では, index ベースで half-edge を作っているので, SSBO 化はやりやすいと思います.

問題点

  • mesh colors という名称がわかりづらいし検索性も低い(patch textures も同様)
1
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
1
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?