Kirkjufell mountain

Started by digitalguru, March 01, 2016, 10:08:57 AM

Previous topic - Next topic

TheBadger

QuoteI am hoping that in TG4 we will be able to export from TG via vector

sounds interesting - what's that?

I thought you used vector maps to make your image?

Well I think that if we get it, then we will be able to export anything we make in tg as a vector displacement map, So we will be able to easily use TG as a way to create incredibly detailed brushes for sculptures and what ever other soft lets you use vector to displace. Also, I guess that TG will become much more useful for real time.

8)
It has been eaten.

digitalguru

 
QuoteI thought you used vector maps to make your image?
see what you mean now, long day yesterday...

yes, that would be very useful, it's a bit of a mission to export a mesh, clean it up and you always lose a little in translation.

don't think it would be a trvial thing to implement though

inkydigit

thanks for all info.. great job! :)

Dune

Well, there is a 'displacement to vector' function, but it's not working (yet) for export.

Matt

Quote from: Dune on March 03, 2016, 02:55:08 AM
Well, there is a 'displacement to vector' function, but it's not working (yet) for export.

You should be able to use that to colour a plane (luminosity channel) and render it with a camera looking down from above. The rendered image is then a usable vector displacement map, as long as you save to EXR to record negative values. But I haven't tried it.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Dune

Okay, thanks Matt, I'll do some experimantation.

digitalguru

#21
Hey Dune, The Badger and Matt,
I tried Matt's suggestion to get vector displacement output from Terragen and it works.

First I tried regular scalar displacement, heres the Terragen render:
[attach=1]

and a Maya render of a flat plane displaced with an Exr from Terragen
[attach=2]

and a flat plane displaced with the same Exr in Mudbox:
[attach=3]

And also but not least!

The same terrain with some fake stones rendered from Terragen:
[attach=4]

and the Maya scene rendered with vector displacement on a flat plane:
[attach=5]

and finally a plane in Mudbox, using vector displacement  (using Absolute Tangent as the vector displacement type):
[attach=6]

Set up in Terragen as Matt suggested, the trick was to use a Displacement shader to vector piped into a Surface shaders luminosity, but making sure the Displacement shader to vector is taken before the Compute Terrain. Also, making sure the Plane object is sitting at 0 in Y coordinate.

Then used a Render Layer to isolate the plane so the terrain was hidden and did a top down ortho render out to OpenExr.

Works really well!

I used to use the Micro Exporter to get terrain geometry out of Terragen, and I just found a post from Paq about the vertex merging problem, I used a free program called Meshlab to fix those duplicate verts easily and also do a nice decimation, but the meshes from the Mudbox displacement are great, very clean and quads too! (a little on the large side though :-), but you can choose the level of detail you need.

I guess the same process would work with something like Zbrush too, once you've got the vector displacement map.

Here's a link to the Terragen TGD files if you want to have a play:
https://dl.dropboxusercontent.com/u/81475291/terragen_vector_displacement.zip

Graham

p.s vector map is rendered at 4k and a little detail is lost, but I like what it does to the fakes stones!

TheBadger

oh man. Its like christmas, only I did not need to be good at all, and winter is over too.

Which version was this added in?

Gonna down your files so I can see exactly how you set up the nodes so I don't waste any time wit dat   :D 8)

It has been eaten.

TheBadger

Quotep.s vector map is rendered at 4k and a little detail is lost, but I like what it does to the fakes stones!

We definitely need to have a max test too! At some point it needs to be known how many pix is needed to get a one to one result.
It has been eaten.

TheBadger

Much thanks for this chain, guys!

:-*
It has been eaten.

zaxxon

This is very, very cool! Almost an 'oh by the way', look what's just sitting there in TG. To be able to take TG terrains out to Mud and other DCC apps has been a problem for sure, but this may be the missing link to accomplish many things on my wish list. Thanks Digital Guru for jumping on this and providing the files.

TheBadger

ok

This is a bit confusing to me. Was the same with bringing in vectors at first too though, so hope I will get this. (in the case of bringing in vectors, it took a bunch of nodes at first, but then someone figured that it only took two)

[attach=1]

So for the broken headed among us (mostly me) slow and steady now... How to make this work? I don't feel like I am seeing what was described.
It has been eaten.

Matt

Quote from: digitalguru on March 04, 2016, 03:05:56 PM
Hey Dune, The Badger and Matt,
I tried Matt's suggestion to get vector displacement output from Terragen and it works.

Living up to your name, Guru :)

Thanks for trying it out and confirming that it really works. This technique could be really useful.

I don't understand why it wouldn't work when connected after the Compute Terrain, but that suggests there could be a bug in Displacement To Vector.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

digitalguru

QuoteI don't understand why it wouldn't work when connected after the Compute Terrain, but that suggests there could be a bug in Displacement To Vector.

That had me going for a while, when I rendered the exr it looked like there was diifuse shading in the map.

Plugging it in before the Compute Terrain produced a render that looked like a proper greyscale luminance map (this was when I was testing a straight displacement to scalar before trying out the vector method)

digitalguru

#29
Badger.
No worries, here you go:
•   Set up your terrain displacements. In this instance, all of the terrain is defined before the Compute Terrain node. I haven't tested it yet with any major displacement after that node.
•   Create a Plane object in Terragen.
•   Line it up so it covers the terrain you want to capture in X and Z coordinates, and covers the area needed. In this instance the Plane is 8000 x 8000.
•   Create a camera, set it to Orthographic and line it up over the Plane. Set the Ortho width to 8000 to match the Plane (and the Terrain).
•   Create a Displacement shader to vector node and connect it to the last node under the Terrain group before the Compute Terrain node.
•   Go into the Internal Network for the Plane, where you'll find the Default shader attached to the plane.
•   Open up the Default shader and turn Diffuse Color down to zero, we only want to see the luminosity from the shader.
•   Create a Vector to Color node and pipe it into the Luminosity Function of the Default Shader.
•   Connect the Displacement shader to vector from outside the Planes internal network to the input of Vector to Color shader. Now the displacement from the terrain is piped into the Luminosity of the Planes shader.
•   Now go up a level into the Main node network.
•   This part had me going for a while, I could see the vectors projected on the plane successfully, but I thought I should move to the Plane up in Y so it would occlude the terrain in the final render. But the rendered image didn't match the original terrain.  So I translated the Plane down to 0 in Y and it worked - not sure why! Maybe it's because the Displacement tests against the ground level of the Planet to see what is positive and what is negative displacement, Matt would know more about this one.
•   So, make sure the Planes Y coordinate is 0.
•   All that's needed now is to make only the Plane renders and not the Terrain.
•   Create a new group and move the Plane node into the group. Right click on the Group and select Group:Capture Nodes.
•   Create a new Render node and attach the Ortho Camera.
•   Create a Render Layer and attach it to the new Render node.
•   In the Objects tab of the Render Layer add the Group containing the Plane to Object Group 1.
•   Turn off Cast shadows and other rays for the Object Group 1.
•   At the bottom of the Objects tab, make sure Render is set to Invisible and Cast shadows and other rays is turned off.
•   The original terrain will now not be visible in the final render.
•   Set the Render node to a square format, for example 4096 x 4096.
•   Turn off Do Shadows, Atmos/Cloud Visible and set the output to OpenExr.
•   Render was relatively quick, I left Detail and Anti-aliasing to the defaults of 0.5 and 0.3, don't think they are that crucial when rendering displacement for a map, but Matt can correct me on that one.