[自制]Houdini导出DOP到VAT Rigid常见问题和解决
Warning:I'm newbee to Japanese,so the Japanese is mainly translared by Google.
私の日本語は本当に下手です
Common Issue about Houdini export DOP to VAT Rigid.
Houdini の VAT Rigid への DOP エクスポートに関する一般的な問題
1,the exported vertex position is messed.
第一,导出动画位置混乱。
1、エクスポートされた頂点の位置がおかしくなります。
Since our exported VAT mesh is a single mesh,so all the fragments must come from one chopped mesh,which has been UV Unwrap.You may delete some Attributes and merge all parts into one mesh if your VAT mesh is combining multiple imported meshes.
由于我们最终输出到一个VAT Mesh上,所以所有在DOP中模拟的碎块部分必须来自预先切割好,UV Unwrap好的一个模型。如果你的VAT是若干个外部导入mesh的集合,也许你需要手动删除一些它们原先带的Attribute,然后预先融合成一个Mesh。
エクスポートされた VAT メッシュは単一のメッシュであるため、すべてのフラグメントは、UV アンラップされた 1 つの切り刻まれたメッシュから取得されている必要があります。VAT メッシュが複数のインポートされたメッシュを結合している場合は、いくつかのアトリビュートを削除し、すべてのパーツを 1 つのメッシュにマージできます。
2.the exported VAT mesh has big cracks.
第二,导出的VAT Mesh有比较大的缝隙。
2.輸出されたVATメッシュに大きな亀裂があります。
The reason of that is VAT is normalized to [0-1] when exported,but then restored in game engine.Float number is divided and than multiplied during the process, which cause a systematic error. Solution:lerp with vertex original position in the early short time of the animation,which ensures vertex is on original position when time=0,without cracks.Following shows an example with Houdini18.04.499 exporting to Unity URP.Where I changed codes of Sidefx's VAT package.
这是由于VAT在export的时候被归一化到0-1范围,而在引擎中使用时又需要还原到正常大小,一来一回除法乘法了float,有不可避免的系统性数值误差。解决办法是在VAT shader中在动画的初始小段时间与Mesh原顶点位置做lerp,这样去保证在time=0的时候顶点一定在原位置,没有缝隙。下面用Houdini18.04.499的Unity URP情况做个示范。对Sidefx的VAT package代码进行了改动。
その理由は、VAT はエクスポート時に [0-1] に正規化されますが、その後ゲーム エンジンで復元されるためです。プロセス中に浮動小数点数が除算され、さらに乗算されるため、体系的なエラーが発生します。解決策: アニメーションの初期の短い時間で頂点の元の位置を指定して lerp を実行します。これにより、時間 = 0 のときに亀裂が発生せずに頂点が元の位置にあることが保証されます。以下は、Houdini18.04.499 を Unity URP にエクスポートする例を示しています。Sidefx のコードを変更した場所VATパッケージ。

Never the less,the error is related to size of bouding box.So we try to reduce BBox size as much as possible.In the example of fracture simulation,some small pieces may fly away very far,which makes BBox too large.One way to solve this is to hide these peices to a position where players cannot see.(You can't delete them directly,which makes pieces return to original positions when exported to VAT).Following is an example of that.
其次,由于这个误差和包围盒大小有关,所以我们要尽量减少DOP模拟过程中BBox的大小。以破碎模拟为例,一些小碎块可能飞得特别远,使得BBox特别大。一种解决办法是将超过范围的碎块隐藏到某个玩家看不见的位置(不能直接删除,因为删除的顶点导出到VAT后会回到顶点原先位置)。下面是一段示例。
それでもなお、誤差は境界ボックスのサイズに関連しています。そのため、BBox のサイズをできる限り小さくしようとします。破壊シミュレーションの例では、いくつかの小さな破片が非常に遠くに飛び散る可能性があり、そのため BBox が大きくなりすぎます。これを解決するには、これらのピースをプレイヤーが見えない位置
に非表示にします。(直接削除することはできないため、VAT にエクスポートするとピースが元の位置に戻ります)。以下はその例です。


Now we have solved several problems when exporting VAT.Thanks,that'll be all.
至此,导出VAT的一些问题就解决了。谢谢。
これで、VAT を輸出する際のいくつかの問題が解決しました。ありがとうございます。これですべてです。
PS:
I wrote this because I used to use VAT in former company business,but when I want to use Houdini VAT to do some simple VAT for personal interest,the problems still get me,so I decided to record the solutions.Thanks for former company,former coworkers and boss,helped me a lot with this.Thanks for 五十嵐 孝司さん and 渡辺さん from Artplay for teaching me about Houdini when I was in former company.
写这篇是因为我以前在前公司接触过VAT,个人开发时想用Houdini VAT做简单动画,没想到又碰到了一堆问题,于是记录。感谢前公司同事和领导,当时给予了很多帮助。感谢前公司合作的五十岚孝司和Artplay的TA渡边先生当时的教学。
以前の会社で VAT を使用していたのでこれを書きましたが、個人的な利益のために Houdini VAT を使用して簡単な VAT を実行したい場合、依然として問題が発生するため、解決策を記録することにしました。前の会社に感謝します。元同僚と上司が、この件で私を大いに助けてくれました。前の会社にいたときに Houdini について教えてくれた Artplay の五十嵐 孝司さんと渡辺さんに感謝します。