Unity でシェーダを設定するのは比較的簡単ですが、メッシュとテクスチャの入力時の設定に変更をしなければいけないところがあります。ビデオを見るか、下記の詳細を参照してください。

CCボタンをクリックして、日本語サブタイトルをオンにしてご覧ください。

1. シェーダの設定

- 最新版の Game Dev tools を GitHub からダウンロードします。 https://github.com/sideeffects/GameDevelopmentToolset/tree/Development

- ダウンロードした Unity のシェーダを自分の Unity プロジェクトのフォルダにドラッグ&ドロップします。


- マテリアルを作成し、シェーダを希望する頂点アニメーションシェーダに設定します。


2. メッシュとテクスチャをプロジェクトに読み込み、Import Settings を以下のように設定します。

テクスチャ Import Settings


メッシュ Import Settings


3. テクスチャをアサインし、数値設定を Houdini での値に合わせます。 

BBOX Max と BBOX Min の値は、Houdini では UE4 でのスケール設定になっているので、Unity で使う場合、値を100で割る 必要があります。


RBD の回転テクスチャでの問題について

上記の設定は殆どの場合問題なく動作しますが、RBD の回転テクスチャでは問題があります。RBDのマテリアルを作成、スピードを 0 にした場合、下記の簡単な例にあるように、オブジェクトが動く前にすでにヒビが見えてしまっているのがわかります。これは正しくありません。

これを修正するには、プロジェクトのカラー空間設定を変更する必要があります。すでにプロジェクトが始まっていて、ガンマ色空間を使っている場合、変更はすべてのテクスチャとライティングに影響を与えるので問題になります。もし別の良い方をご存知でしたら是非お知らせください。下記は現時点での修正方法です。

カラー空間の変更

カラー空間の変更は Edit > Project Settings > Player メニューから行います。 "Other Settings" 以下の Color Space を Gamma から Linear に変更します。

回転テクスチャ用の Texture Import Settings

Unity がリニアテクスチャをどのように扱っているかをここで読むことが出来ます。 - https://docs.unity3d.com/Manual/LinearRendering-LinearTextures.html

Texture Type を Editor GUI and Legacy GUI に設定、 Wrap Mode が Repeat になっていることを確認してください。

これが最良の解決策だとは思いませんので、もし別の良い方法があれば是非お知らせください。
Mike

コメント

  • JimInziello 11 ヶ月, 2 週間 前  | 

    I'm desperately trying to find a detailed version of this same work flow for UE4. I need a step by step overview, especially in what node I'm exporting and just where I'm supposed to "paste" the code for the material in UE4. The main Luiz Webinar just briefly shows the material network, without a walk through of what is going on.

    I've got this fractured object that I want to put on my VR game, just sitting in Houdini Indie, waiting to get out.

    Always Learning

    -Jim

  • mikelyndon-sesi 11 ヶ月, 2 週間 前  | 

    Hi Jim. Are we looking at the same webinar? Luiz goes into a lot of detail about the general setup for exporting vertex animation data to ue4. At 36:26 he starts talking specifically about rigid bodies and at 47:20 he shows a step-by-step of how the material in ue4 is setup. Anything that he hasn't covered there can be supplemented with his cloth example.
    https://vimeo.com/212982381
    What part of it isn't clear with regards to what is going on?

    Mike

  • reverse 11 ヶ月, 1 週間 前  | 

    I took in fluid information made by Houdini into unity
    After that
    The topology got messed up
    In this case
    How do I set it on the unity side?

    Please create a fluid tutorial from Houdini to unity

  • eco_bach 8 ヶ月, 3 週間 前  | 

    This is a fantastic workflow! Unfortunately in recent test doesn't work with Vuforia. On build-deploy only get static meshes without animation. If I find a solution will post here...any feedback appreciated!

  • eco_bach 8 ヶ月, 3 週間 前  | 

    addendum...this seems to be a mobile deploy issue...at least for iOS can't get vertex animation working. On the desktop or in editor...no issues!

  • eco_bach 8 ヶ月, 3 週間 前  | 

    suggestion to sesi- please allow editing of previous comments. Anyways, the issue was a texture size issue...8192 for some reason simply will not animate although it looks great..4096 is the largest that works for me.

  • stimulant 7 ヶ月 前  | 

    Hi Mike,

    This seems awesome, but I'm getting some issues when I apply the rotation map. It's best if you see it:
    https://streamable.com/mhlf1

    Applying the rotation map causes the pieces to scale up over time and generally not do the right thing. I have my number of frames and bounding box information set correctly from Houdini (dividing by 100 in Unity). I'm on the latest Develoment branch of GameDevelopmentToolset, Houdini 16.0.762 Indie, and Unity 2017.3.0b5. Same thing is happening in Unity 5.6.0f3.

    Any help is appreciated!

  • mikelyndon-sesi 6 ヶ月, 2 週間 前  | 

    It doesn't look like you've set the texture type to "Editor GUI and Legacy GUI". And have you followed the last piece of the tutorial to change your colour space?

  • rossojr92 2 ヶ月, 1 週間 前  | 

    Hi,

    This article is very nice. I'm trying to use Vertex Animation in Unity but it seems that something has changed in Houdini since this article was writed.
    For example, now for rigid body there are 2 bounding box (Bounding Box and Bounding Box 1). Using this steps something does not work correctly in animations.

    Can anyone help me to understand what is changed exactly and how to fix? I don't know if Houndini has changed the texture exporter (and so the shader should be updated accordingly) or if Unity 2017 has some new Texture Importer (from Unity 5) that doesn't work fine with Houdini texture format.

    Thanks very much!

  • mikelyndon-sesi 2 ヶ月, 1 週間 前  | 

    There are 2 bounding box min and max values because one is for the pivot and one is for the position of the vertex. The latest shader in github is correct, and the vertex animation texture sheet ROP also outputs both sets of numbers. I'll update the image above when I get some time.

    Everything still works as expected in Unity 2017 and 2018. Can you be more specific about what isn't working with the texture?

    • rossojr92 2 ヶ月, 1 週間 前  | 

      We have a wood-wall destruction animation.
      Wall is made by two part. The first part of animation brokes the left part of the wall. The second part brokes the right part.

      In Houdini we see the correct animation.

      When we export to Unity we see that everythings is corrected at the frame number 0. When we render frame 1, we have every points shifted.

      I have a question: our model is pretty big. Exported textures have a 24-bit compression. It means that we have 8 bit for red, 8 bit for green and 8 bit for blue. So, we can represent just 255 values in each axis, is it right? Because I was thinking about a precision problem with big models (with a big bounding box).

      Thank you very much for your help. It's really important to us.

      • mikelyndon-sesi 2 ヶ月, 1 週間 前  | 

        An rbd sim with very large bounds will have precision issues. You are correct that the texture limits the precision.

        As for the shift on the second frame, have you set your colour space to linear?

        • rossojr92 2 ヶ月 前  | 

          Sure, I'm using linear color.
          Can I share with you my exported objects so we can both see the situation I have tried to descript above?

          • mikelyndon-sesi 2 ヶ月 前  | 

            Please submit a bug to support@sidefx.com with the necessary files and we can take a look.

            • rossojr92 2 ヶ月 前  | 

              Removing some properties on verticies the situation gets better.
              Now we've done a try; we have exported the same model with just 1 animated point and everything was ok. We've done the same with 10 animated point and everything was ok. The same with 50 points. When we export an animation with more points the base position of other points was different (shidted).

              Is there any limitation on the number of points that we can animate with Vertex Animation?

  • tanyaojushi 2 ヶ月, 1 週間 前  | 

    hi mikelyndon,first of all I use this tool to make rigid body very well
    but there are only a little question:when I break lot of pieces,some of the pieces will shake
    http://note.youdao.com/noteshare?id=6d8087406ed6992a3407917596d5b9b2
    you can see it here
    I use the latest tool

    • mikelyndon-sesi 2 ヶ月, 1 週間 前  | 

      That looks like the colour space issue I mention at the end of the tutorial. Have you set your project to linear?

      • tanyaojushi 2 ヶ月 前  | 

        yes,I set to linear,and i try the editer Gui mod

  • chris rogers2 1 週間, 2 日 前  | 

    Hey
    I had a really tough time getting fluid to work on android so I thought I would share my recipe. I'm not sure all of these parameters are necessary, but it worked for me. I will update this post if I have better info.
    Export out of houdini with:
    target poly count: 1024
    target texture: 4096
    export for mobile unity OFF
    normalize data 0-1 ON
    pack into alpha OFF
    color export ON

    in Unity i found on android the texture needed to be a lightmap to get the hdr data, so my import settings for are:
    Texture type: lightmap
    Non power of 2: none
    Read/Write Enabled ON
    Generate Mip Map OFF
    Wrap Mode: Repeat
    Filter Mode: Point (no filter)
    Max size: 4096
    Compression: None

    Mesh:
    Mesh Compression: Off
    Read/Write enabled: ON
    Optimize, blendshapes, colliders, keep quads, visibility, camera,hiearchy,swap,lightmapUVs: off
    Index Format: 16bit

    My anim is 119 frames of particleFluid sim, I had to wrangle the color back onto the mesh before i could export color per vertex (and it's not the correct color, but it's something)

    • chris rogers2 1 週間, 2 日 前  | 

      And Weld Vertices: ON
      i left the normals and tangent space on its default setting.

      • chris rogers2 1 週間, 2 日 前  | 

        i spoke too soon.
        Now, it looks correct in the editor while build is set to android, but does not actually display anything on my android device, where as the "broken" imports (the demo is broken the same way, the 3D shape looks like its shaped around a box with some triangles or maybe the 4th vert of a quad are missing when build is set to android) would appear the same way on android....

        • mikelyndon-sesi 1 週間 前  | 

          Hi Chris. Can you send me a test scene? I'd like to troubleshoot this with the guys at Unity.
          Mike

Please log in to leave a comment.