Nice case study of Terragen / Unity workflow (by Veselin Efremov)

Started by paq, September 03, 2015, 01:01:50 PM

Previous topic - Next topic

TheBadger

That is a very nice show of your workflow, paq. Thank you.

I don't have Z, but the workflow chris showed me is much less work, with what I think is the same end results. I will send him a PM after this post, I think that you will be interested to read his instructions. It would be good to hear from you about them in the greater context of this thread.

My short comment is just me repeating my self, Vector solves all of this. But in the mean time, it may be of use to continue as we are. Perhaps if you and another Z user see the workflow from chris than You can broaden the discussion, and perhaps another Mud user will be able to better adapt it for Mud than I was able to. Please check back on this topic in a day or two, assuming he answers my message. Would be good to hear from him in this thread anyway, since he works with TG and Z all of the time. Maybe you guys can solve problems a little more rather than just waiting for some added power in TG? Would be cool.
It has been eaten.

Matt

Quote from: Tangled-Universe on September 04, 2015, 07:43:10 AM
I don't know which of the 2 options you propose is the fastest in terms of performance in TG?
Perhaps also to develop?

In terms of development, a vector map equivalent of the heightfield export will be easier than the other approach. It really only requires a 3-channel version of a 1-channel workflow that already exists in TG, i.e. bake to a vector field instead of a heightfield, then right click on the heightfield/vectorfield node to save to an image.

In terms of render/generate performance it's probably quicker too, because there's less overhead dealing with micropolygons and the render engine, and maybe easier for the user to set up. But you would be limited to selecting a rectangular region just like you are with a heightfield.

At the moment heightfield generation is only single-threaded, so I will need to make it multi-threaded to make sure it's faster than a micropoly render export, but that won't be difficult.

Quote
Remember the strange raster/grid 'secondary' mesh underneath the main mesh, due to render bucket tiles?
For exporting a seamless (no raster/grid) and gap free mesh I needed to render the micro exporter without "fully adaptive" and as a single thread.
Because of disabling "fully adaptive" there was much less detail compared to rendering with "fully adaptive" enabled.
So I needed to render it single threaded at detail 4 or 5 @ 1-1.5k resolution. That took usually around 12-20 hours.
Not desired.

So if the problems with micro exporter are not easy to fix and thus still require these adjustments in render settings etc., then performance wise the first option would be the easiest and fastest way?

Well, the main advantage of "fully adaptive" is that it increases resolution where the surface stretches due to displacement. If we're talking about a fixed-resolution vector displacement map, it won't be able to put extra detail in these areas either. So there won't be any advantage here. You'll need to increase the overall resolution until you get enough detail in these stretched regions. This is where micropolygon export can theoretically be better at producing uniform detail (barring these issues/faults with the subdivision algorithm which you ran into).

Quote
I like it though that with option 2 you get more different types of output at once.

And it would aim to eliminate a few steps in the pipeline, if the desired product is low-res or mid-res geometry + displacement map. But whenever using any kind of fixed resolution 2d texture map (displacement map, colour map), stretching issues are going to occur depending on the UV mapping, and in this case the UV map will be based on the undisplaced plane/planet, just like with the "vector field" baking and export in option 1.

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

AP

That is neat to see different results from the hero mountains. There are some interesting image examples and workflows going on here. I am still working on additional styles and some more wild looks for the hero mountains.

VOID!

TheBadger

chris_x422  ;)  ;D I can't remember half the stuff I have already learned or done either :o
It has been eaten.

AP


TheBadger

QuoteVOID!
No, paq did use your file for his example, and he is right, those are cool files you shared :) And he made cool mesh from them! This stuff is just too damn much fun :)... planetside people must always be happy people ;)
It has been eaten.

AP


TheBadger

Hi,
chris_x422 said he had no problem with sharing!

Quote1.. Import you're terragen mesh into maya.
2. Create a poly plane.
3. From a top view, scale and position the plane so that it encompasses the whole area of the terragen mesh.
4. Scale the uv's of the poly plane down by a very small percentage
5. Export the poly plane.

These are the only operations we have to perform in maya, the flat poly plane will be later conformed to the shape of the terragen mesh inside of Zbrush.
You seem to be getting hung up on the idea of quads vs tris, there is no need. We are conforming the base poly plane (that is already quads) into the same shape as the terragen mesh.
I don't believe that Mudbox will however allow you to do this as it doesn't have the same functionality as Zbrush, but as it's been a while sine I've used it, I could be wrong.

6. import the poly plane we exported from maya into Zbrush
7. import the terragen mesh also into zbrush.
8. Append the terragen mesh into the same subtool pallete as the poly plane.
9. Subdivide the poly plane a couple of times before deleting the lower levels, then store a morph target.
10. divide the poly plane to around 1.5 -4 million polys.
11. click on project (below the subtools) and change the distance to 1.
12. Making sure that the poly plane is the selected mesh, and that the terragen mesh is the only other mesh that is visible, then press 'project all'.

That will force our poly plane from maya to take on the shape of our terragen mesh, as if it had been a sheet of cloth draped over the terragen mesh.
So we now have a clean mesh for sculpting that also has the shape we started with in terragen.

13. hide the terragen mesh in Zbrush.
14. sculpt
15. when you are ready to create a vector displacement map, take the geometry level back down to 1.
16. Go to the morph target panel and press switch (this will restore the plane to it's original flat shape)
17. Go to the UV map tab and set the size of the map you want to export (I usually export at 8k)
18. Open the Vector displacement tab, turn off vd Snormals, then click export and give your map a name.
19. click save, and Zbrush will start calculating a vector displacement map based upon the difference between it's flat state and higher subdivided sculpted state.

This map (when project back correctly in terragen) will be a near 1-1 match for what you exported from terragen earlier.

Thanks to Zbrush it's possible to take a mesh with any shape and project a flat poly plane onto it, forcing it to conform to it's shape.
And because Zbrush is capable of storing a meshes original shape (morph target) we are able to calculate the difference and store those values into a displacement map.

Hope that makes sense, but please, just try to replicate those steps a few times, and it should al become clear.


Chris

He also said when he has some time he will make some more video tuts on the broader subjects of this thread for all of us, which will be really AWESOME, as far as I am concerned!

Ok, so this goes back to that big thread on sculpting workflows and TG. But the steps were never set out like this. Some people may be able to add to it by now. Also, mud users should see the difference now with Z, a bit better.
Again if TG outputs a vector, then this all goes away. But in the meantime, maybe something can still be simplified in these workflows and somehow get better results?
It has been eaten.

chris_x422

Hi guys, been a while  :o

Nice discussion going on here, and great to see more workflows being developed that extend Terragen's usage!

Congrats on the Siggraph demo Martin, very nice work! I know from experience that setting these techniques up takes time and patience, and a lot more testing.

Zbrush has always been critical in terms of extending TG for me, it's mesh projection and mesh matching brushes enable me to take out any mesh from TG and match it to low res meshes set up in maya. Meaning, no need for low res exports, and clean uv's from the get go. It also makes thing very easy in terms of cleaning up any stretching or mesh artefacts at the edges. We can also use the camera projection (by fbx export from TG) to bake textures or combined AOV's into the maya mesh, and further extend or clean up in Mari etc.

Been, constantly on the move for the past few year's, with little time for anything but deadlines. I'm making a big changes right now, and setting up my own studio, so hopefully I can get back to some of my own passions for a while. Like Michael said, once the dust settles, I'll try to put together a tutorial or two on the techniques I've been using.

Chris

TheBadger

Really looking forward to it! Thank you.
congratulations on your successes too 8)


Matt,
If you understand and envision uses for both options you are thinking on, than why not do both? Not really sure how I would need option2 but I am sure someone else here will inspire me. As for me, if you add vector (and rectangular noises ;D), than I will be in heaven and have no need to harass you anymore. Thats gotta be worth something? Or at least it will take a while for me to think of something.
It has been eaten.

paq

Hello,

So here's an other way to create a 'usable' low res model from Terragen.
Again I really want to use the 'fully adaptive' subdivision option.

So to resume :

1) Render (micro export) the terrain with low details (0.2 - 0.5 ... depending of the resolution of course), Multi-threading off, Fully adaptive ON
2) Load the mesh in Atangeo Balancer
3) To fix the mesh, just use these 2 options : Tools>Merge vetices and Tools>Eleminate T-Junctions
4) You can then decimate the geometry a little bit further if needed.

[attachimg=1]

Works pretty well so far.

(I didn't manage to clean the terrain so well with Meshlab.  The only close result was to use Cleaning and Repair > Snap mismatched borders ... but  ... it didn't fixed everything).
Gameloft

Matt

Quote from: TheBadger on September 09, 2015, 03:10:36 AM
Matt,
If you understand and envision uses for both options you are thinking on, than why not do both? Not really sure how I would need option2 but I am sure someone else here will inspire me. As for me, if you add vector (and rectangular noises ;D), than I will be in heaven and have no need to harass you anymore. Thats gotta be worth something? Or at least it will take a while for me to think of something.

We will do everything we can make time to do, in time :)

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

Dune

Interesting software, paq. Thanks for your explanation. Didn't know of it but I had issues with meshlab too. Some testing to do...

AP

I never heard of Atangeo Balancer but it sounds well worth looking into.