## Vector displacement from arbitrary geometry : Houdini to Terragen

Started by paq, December 21, 2017, 02:55:09 pm

#### Artice-3d

##### January 03, 2018, 02:38:28 am #15
Dune mudbox is good, but for really good result this technique is much better.. When i'll finish, i'll show you what we can do with this !!!

#### Artice-3d

##### January 03, 2018, 04:34:00 am #16
Paq thanks for your answer, but...  one more question -  When a pelted object i transfered it's uvs to mesh points by point node, but it's doesn't match with original object's position and orientation why?!!  Thanks you help me a lot!! At your image with dinosaur original object position and orientation look absolutely exactly as pelted!!

#### paq

##### January 03, 2018, 08:58:41 am #17 Last Edit: January 03, 2018, 09:12:03 am by paq
Hi Artice-3d,

Here's my way to align the 2 geometries (attach .hip) :

- In a vop, I compute the angle between point 0 of mesh A and mesh B using the Align operator. I receive a transformation matrix that I can use to orient Mesh A (P * Matrix)
- For the size I use the matchsize sop.

(blendshapes_TEST_RESULT can be used to check if the transformation is right).

I still such a noob in Houdini, let me know if you find a easiest way
Gameloft

#### Artice-3d

##### January 03, 2018, 12:00:22 pm #18 Last Edit: January 03, 2018, 12:04:43 pm by Artice-3d
Thanks Paq i'm very appreciate!!! I'm a square noob in houdini, if it's help to you  Your solution is too complicated for me    I did it different (use simple orientation option in UVpelt), but don't know if it will work at all.. Need an export to see...  So thanks for all your help - next question how to project colors from original mesh to uvpelted (mine all blue).. Tell me please that it's not as difficult as with orientation !!!

#### paq

##### January 03, 2018, 10:43:25 pm #19
Hi Artice,

(1) (2) (3) (4)
Attribute wrangle

v@vdisp=point(1,"P",@ptnum)-@P;

In the input (1) : pelted (flatten) meshed
In the input (2) : original mesh point position (not flatten)

This way you will store an attribute called @vdisp, storing the vector displacement.

If you want to test the displace :

On the pelted mesh :

Point wrangler
@P+=v@vdisp;

Maybe a solution is to use the frame input (second input of the pelt operator), but I don't get yet how to use it to have a consistency in the pelt orientation.

//

Hopefully I'm on holiday next week, I will get some time to continue this vdisplace project

Gameloft

#### Artice-3d

##### January 03, 2018, 10:57:46 pm #20
Hello Paq, mine still blue !!  Something went wrong

#### paq

##### January 03, 2018, 11:12:46 pm #21
No idea, could you post the .hip ?
Gameloft

#### Artice-3d

##### January 03, 2018, 11:18:34 pm #22 Last Edit: January 03, 2018, 11:30:40 pm by Artice-3d
Yep!!    Correct it please and send me back final version, i won't wanna bother you anymore   You help me a lot already!!!    Thanks for that you're a man!!

#### paq

##### January 03, 2018, 11:27:44 pm #23
Ok, at that point you have to use @Cd=v@vdisp; to display the vector displacement, sorry for the confusion.
Gameloft

#### Artice-3d

##### January 03, 2018, 11:30:28 pm #24
Oh god thanks !!! And now you're just render it in .exr file and that's it ?!!!

#### paq

##### January 03, 2018, 11:57:44 pm #25
Yup.

But you need to avoid negative value (I can't manage to write signed .exr with Houdini).
So the model need to be moved (normalized) in 3d space between 0-1 ... and that's a bit annoying because if you need to push point below the level0, you need to refit the vector inside Terragen
https://www.planetside.co.uk/forums/index.php/topic,23958.0.html

I also did a bit of upscaling after this first pass,  using the divide operator, and the ray operator to re-project the fine detail.

Gameloft

#### Artice-3d

##### January 04, 2018, 12:14:47 am #26 Last Edit: January 04, 2018, 12:59:11 am by Artice-3d
Paq 0-1 on x-z or y too?!!!  And thank you very much for all.. I'm happy with results... THANK YOU SO MUCH ONE MORE TIME

#### paq

##### January 04, 2018, 12:25:13 am #27 Last Edit: January 04, 2018, 12:31:20 am by paq
(you're welcome)

Now that's intriguing, because I had lot's of trouble exporting my .exr image.

How did you setup your render ? (it's my turn to learn something )
I have never touched Mantra, so I'm using one of those game baking tool, and maybe lot's of my problems are coming from that

Gameloft

#### Artice-3d

##### January 04, 2018, 12:40:05 am #28 Last Edit: January 04, 2018, 12:44:20 am by Artice-3d
I used camera positioned vertically  90 degree than used mantra output to .exr file and rendered it to 3000*3000 px than import in terragen and make it beautiful!!!!
images for understanding below!!!

And one more - i used glow shader to luminance displacement !!!

#### paq

##### January 04, 2018, 12:52:34 am #29 Last Edit: January 04, 2018, 01:01:40 am by paq
Ho nice, so simple ... and, as far as I can see, signed .exr is working, there is no need to refit the data.
Thanks a lot !

(Strata pig is cool  )

//edit

glow shader to luminance displacement  ?¿ ( I'm nowhere when it comes to render in Houdini)
Gameloft