Planetside Software Forums

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

Title: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on December 21, 2017, 02: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, 03:35:35 PM
That is amazing!  :)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: N-drju on December 21, 2017, 03: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, 04: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, 05: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, 07: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, 03: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, 07:12:29 AM
Great work!
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Kadri on December 23, 2017, 08:31:51 AM

Nice.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on December 24, 2017, 01: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, 03:28:20 AM
simply wow
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 02, 2018, 11:31:46 PM
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 02, 2018, 11:52:51 PM
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, 12: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, 02: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, 02: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, 04: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, 08:58:41 AM
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, 12: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 03, 2018, 10:43:25 PM
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 03, 2018, 10:57:46 PM
Hello Paq, mine still blue !!  Something went wrong   :-\
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: paq on January 03, 2018, 11:12:46 PM
No idea, could you post the .hip ?
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 03, 2018, 11:18:34 PM
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 03, 2018, 11:27:44 PM
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 03, 2018, 11:30:28 PM
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 03, 2018, 11:57:44 PM
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, 12: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, 12: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, 12: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, 12: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, 01: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, 12: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, 07: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, 09:06:10 AM
Great thread guys!
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Artice-3d on January 07, 2018, 12:25:01 PM
bobbystahr - Thanks  ;D ;) ::)
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Hetzen on January 07, 2018, 02:25:20 PM
Quote from: bobbystahr on January 07, 2018, 09:06:10 AM
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, 01:02:31 AM
Quote from: Hetzen on January 07, 2018, 02:25:20 PM
Quote from: bobbystahr on January 07, 2018, 09:06:10 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, 06: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, 12: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, 06: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, 01: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?
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: micvswind on March 16, 2020, 02:05:09 AM
@Artice-3d 

Hi Artice-3d.i have readed you master thread and that's awesome.i try a lot and can not get the expecting result.


here is the .hip file,

VdMap_test.7z

could you give me some tips about how to export the vdmap correctly and it is appreciate.

regards.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: micvswind on March 25, 2020, 01:28:18 AM
Hi,i try this some times but still get the correct result.i render the vdisp map from houdini and input to terragen.the result is the geometry is intersect as the pic show below.
may you guys could give me some tips.that will be appreciated.

regards


000.jpg111.jpg
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Dune on March 25, 2020, 02:17:07 AM
How do you mean, intersect? If the displacements point the wrong way, the vdsip map may originally not be done in the right 'definition' (can't remember the right word). Or you could try flipping the X or Z by splitting the vdisp up into color channels, and reattaching them to a build vector, but with other inputs (X to Z, Z to X). At least that is what I had to do sometimes in the past.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: micvswind on March 25, 2020, 03:19:23 AM
Quote from: Dune on March 25, 2020, 02:17:07 AMHow do you mean, intersect? If the displacements point the wrong way, the vdsip map may originally not be done in the right 'definition' (can't remember the right word). Or you could try flipping the X or Z by splitting the vdisp up into color channels, and reattaching them to a build vector, but with other inputs (X to Z, Z to X). At least that is what I had to do sometimes in the past.
Hi dune.thank you very much .you are so passion and professional in the forum.
i alter the X  and Z axis and get this.it is a great upgrade.but still is not the right result.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: micvswind on March 25, 2020, 03:23:25 AM
here is the screenshot.
111.jpg
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: j meyer on March 25, 2020, 01:39:27 PM
Did you already try to flip the whole map vertically or horizontally?
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: WAS on March 25, 2020, 03:06:05 PM
Quote from: Dune on March 25, 2020, 02:17:07 AMHow do you mean, intersect? If the displacements point the wrong way, the vdsip map may originally not be done in the right 'definition' (can't remember the right word). Or you could try flipping the X or Z by splitting the vdisp up into color channels, and reattaching them to a build vector, but with other inputs (X to Z, Z to X). At least that is what I had to do sometimes in the past.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: Matt on March 27, 2020, 01:01:15 AM
Coming from Houdini, you don't need to swap any channels, but you need to flip the Z.

Either: Flip the Z value in the Image Map Shader simply by enabling "Multiply RGB" and changing the 3rd value to -1.

Or: Flip the Z value in the Vector Displacement Shader by changing the Z multiplier to -1.
Title: Re: Vector displacement from arbitrary geometry : Houdini to Terragen
Post by: micvswind on March 29, 2020, 05:34:49 AM
@j meyer  @WAS  @Matt

Hi guys.thank you very much finally i get the right result.it touble me some days.

i flip the y axis in the flip/repeat tab and alter "date is linear" in the colour table of the image colour node.the it works.

111.jpg111.jpg
i am appreciated very much and you kind guys save me lot of time.

regards.