stride3d/stride

Add Triplanar Mapping as UV Coordinate source

開放

#964 建立於 2020年12月14日

 (2 則留言) (0 個反應) (0 位負責人)C# (886 個分叉)batch import
area-Shadersenhancementgood first issue

倉庫指標

星標
 (6,001 顆星)
PR 合併指標
 (平均合併 10天 11小時) (30 天內合併 22 個 PR)

描述

I often encounter 3d models which have no texture coordinates. Unwrapping them with e.g. blender only works if the geometry is static, but if the geometry is being modified at runtime, offline unwrapping is no solution.

Tri planar projected mapping to generate texture coordinates is an easy way to add texture coordinates (e.g. it would be great if there was an entry in the texture coordinate source dropdown "triplanar mapped" in order to select this kind of mapping). Here is an article about it with unity:

https://www.martinpalko.com/triplanar-mapping/

Using a Shader as source for maps and implementing the triplanar mapping there might work as well, but i could not find documentation about whether it was possible to change uv coordinates in a way that they could also be reused for other maps (computing the uv coordinates for every map again and again seems a bit wasteful to me)

One might also consider triplanar mapping in world coordinates, or in "local" coordinates (e.g. the models bounding box).

貢獻者指南