Planetside Software Forums

General => Terragen Discussion => Topic started by: paq on December 21, 2017, 06:55:09 PM

Title: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on December 21, 2017, 06:55:09 PM
Hello,

This is a first proof of concept about generating a vector displacement from any arbitrary model.
There is still a lot of unknown, and areas I need to test :

- Trying different smooth algorithm to remove overlapping geometry when flattening the model in Houdini.
(Maybe using the one used to flatten uv texture). This is the area that takes a bit a computing time.

- I wish to find a way to write negative value in .exr generated in Houdini, to avoid to do a refit from a normalized texture in Terragen (seems to work, but Min and Max value to re-apply the vector displacement map have to be entered by hand)
- Terragen smooth interpolation in the image map shader seems to wash a lot of details (especially around the ears in this case). Disable it make the model too ugly (faceted). Furthers test need to be done, maybe an higher resolution from Houdini model can helps a lot.

The result is not that bad so far  8)
[attachimg=1]
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: luvsmuzik on December 21, 2017, 07:35:35 PM
That is amazing!  :)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: N-drju on December 21, 2017, 07:40:48 PM
Hehe, looks cool. I guess complicated terrain generation can be made easier with your solution? Unless the same amount of work is needed in Houdini for the same effect.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Hetzen on December 21, 2017, 08:47:35 PM
That's really interesting. Turning geo into vector displacements. How does Houdini do that?
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on December 21, 2017, 09:41:46 PM
Hello,

Well the idea is to create a uniform skin around the object and a plane. I use voxels for that (vdb). (image 2)
That's the model A.

Then I flatten the model (scale y = 0) (image3) , and I relax the point until there is no overlapping : model B. (image 4)

Finally I subtract point position from model A with point position from model B, and that creates the vector displacement (display as vertex color in image 5)

Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: KyL on December 21, 2017, 11:32:01 PM
I've been thinking about this for some time now.

Glad to see it's doable, even more in such an elegant way. Looking forward to the development on this!
Very exciting  :)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: bobbystahr on December 22, 2017, 07:04:33 PM
Right on paq...freakin brilliant...
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: mhaze on December 23, 2017, 11:12:29 AM
Great work!
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Kadri on December 23, 2017, 12:31:51 PM

Nice.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on December 24, 2017, 05:42:55 AM
[Hello and thanks !

I have a better system now, using an uv unwarp (uv-pelt) to flatten the model. (mid resolution)
Works much better, and I'm starting to  keep much more detail than the previous prototype.

For a 2K output, it takes a little while to process, about 5-10 minutes, ... mainly because I use a very slow operator in Houdini.
It's far to be a digital asset that anyone could use with predictable result,but I will share a scene and maybe a little video to explain the process.

But first I have to test more advanced structure 8)

[attachimg=2]

[attachimg=1]
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: bobbystahr on December 24, 2017, 07:28:20 AM
simply wow
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 03, 2018, 03:31:46 AM
Hello Paq !! I like your vector displacement workflow.. One question - Tell me please - What node did you use to vector colorization ??!! ??? ::)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 03, 2018, 03:52:51 AM
Hello Artice-3d,

Just add a point wrangler, with @Cd=@P;
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 03, 2018, 04:13:45 AM
Mine not looking good as yours :( Geometry lost all details at all !!! Your geometry clean and beautiful!!  Please, maybe you'll make a little tutorial with your dinosaur results, it looks very good!! I even don't know how to export from houdini in proper way  :(((


Ok update--- i've got clean geometry !! Need to pelt it correctly ;)))
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Dune on January 03, 2018, 06:33:14 AM
Brilliant work. I did some experiments in mudbox quite a while ago, but there you have to use 2 planes with equal amount of vertices, work your magic on one and subtract to vector displacement map.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 03, 2018, 06:38:28 AM
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 !!!   8) :o ;D ;)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 03, 2018, 08:34:00 AM
Paq thanks for your answer, but...  ;D :o 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!!
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 03, 2018, 12:58:41 PM
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  ;)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 03, 2018, 04:00:22 PM
Thanks Paq i'm very appreciate!!! I'm a square noob in houdini, if it's help to you  ;D ;D Your solution is too complicated for me  :o ;D  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 !!!  ;D ;D :o
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 04, 2018, 02:43:25 AM
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;

About the pelt rotation,
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  ;)


 
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 04, 2018, 02:57:46 AM
Hello Paq, mine still blue !!  Something went wrong   :-\
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 04, 2018, 03:12:46 AM
No idea, could you post the .hip ?
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 04, 2018, 03:18:34 AM
Yep!!  ;)  Correct it please and send me back final version, i won't wanna bother you anymore ;D ;)  You help me a lot already!!!  ::) ;D  Thanks for that you're a man!!
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 04, 2018, 03:27:44 AM
Ok, at that point you have to use @Cd=v@vdisp; to display the vector displacement, sorry for the confusion.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 04, 2018, 03:30:28 AM
Oh god thanks !!! And now you're just render it in .exr file and that's it ?!!!
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 04, 2018, 03:57:44 AM
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.

Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 04, 2018, 04:14:47 AM
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  ;D 8) :o ;) ;) ;) ;)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 04, 2018, 04:25:13 AM
(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  :'(

Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 04, 2018, 04:40:05 AM
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 !!!
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 04, 2018, 04:52:34 AM
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  8) )

//edit

glow shader to luminance displacement  ? ( I'm nowhere when it comes to render in Houdini)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 04, 2018, 05:01:31 AM
Thanks Paq, now it will be a whole new dimention for terrains creation!!!  8) :o ;)

--------------------------------------------

Paq about luminance... You need to create a glow shader in material browser and assign it to your flatten object, to create model without diffuse, shadow and reflection stuff.. I'll post images a bit later!!
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 06, 2018, 04:48:24 PM
Thanks for the update Artice !  8)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 07, 2018, 11:58:26 AM
No problem!!!   ::) ;) ;D  If you'll have any questions, ask me  ;) !!!  8)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: bobbystahr on January 07, 2018, 01:06:10 PM
Great thread guys!
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 07, 2018, 04:25:01 PM
bobbystahr - Thanks  ;D ;) ::)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Hetzen on January 07, 2018, 06:25:20 PM
Great thread guys!

Agree! Very art 'directable'.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 08, 2018, 05:02:31 AM
Great thread guys!

Agree! Very art 'directable'.

That's the most clever answer my friend..  :o ::) ;)  That's why i need this, to create what i want  ::) 8) 
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 08, 2018, 10:53:09 AM
Paq hello! Do you know how to relax uv after pelting?? Smooth SOP and point relaxing doesn't relax much!!!  ::) ;)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 10, 2018, 04:51:39 AM
Hi Artice,

No, I don't know.
Well you can indeed smooth the point position after the uv's to mesh transfer.

Never get any result from the relax, but smooth can do a very good job, if you set quality on 1, and strength pretty high (100 - 500 - 1500).
The other operator is the attribute blur, but I don't think it will help you better than the smooth one.

Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 10, 2018, 10:43:08 AM
Thanks Paq i tried already all this stuff with no success, but it's ok.. thanks for answer!!  ;) ;D
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: iaminonsiner on January 18, 2019, 05:44:47 PM
Really nice tool ! But you talk about houdini... can I do the same in another software like Blender ? Do you have a tutorial so I can try this at home?