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

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

Previous topic - Next topic

Oshyan

Yes, we were pleased to see this at SIGGRAPH this year. And Martin (Tangled-Universe) gets a little time in the spotlight. :D

We do intend to make these workflows easier in the future too. Terragen is a great asset generator and the demand is only growing.

- Oshyan

TheBadger

Oh man, I wish I had the audio to go with this!

QuoteMaybe it's worth exploring using vector displacement instead of height in the future
- slide 75

HA !! Who around here has been saying that?

If it works all of those problems he was talking about would be gone. And moving the terrain around would be easy and fully editable via sculpting.

One thing I want to know more about from the slides, is, where he talked about displacing an a "tessellated" object. He said he applied a TG height map to displace the object. I only tried displacing a plane. Some one please explain what he meant, so I can understand the difference between what he did and what I tried.
It has been eaten.

Matt

Quote from: TheBadger on September 03, 2015, 04:09:28 PM
One thing I want to know more about from the slides, is, where he talked about displacing an a "tessellated" object. He said he applied a TG height map to displace the object. I only tried displacing a plane. Some one please explain what he meant, so I can understand the difference between what he did and what I tried.

When you say you only displace a plane, do you mean in Terragen or some other app? Generally speaking, you can use height maps to displace whatever you want. On slide 69 Veselin shows some basic modeled cliff shapes and then on slide 70 he shows them with displacement applied. He's talking about displacing the geometry in Unity or 3DS Max (it's not clear which, but the end goal is the same, some high res geometry in Unity).

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

TheBadger

QuoteWhen you say you only displace a plane, do you mean in Terragen or some other app

I was displacing a mudbox plane with a height map I made in Maya, of a TG terrain that I exported as a object  ::) lol  The way I went about it was a little strange, but there were reasons for it at the time.

It worked. But there were problems. I thought I should try doing like in the link. But I think I will just run into the same problems or other problems that have to do with mudbox once I was back there. Yeah pretty sure as I think about it... Vector is the way to go, assuming it outputs a map from TG that does not contain stretching, and gives a very clean, even, displaced mesh. Then I am still sure that would be best.

Not to push you about it, Matt. But you posted about vector output from TG before. You only said that you believed it was possible for you. Can you talk any more about it?
It has been eaten.

Matt

I haven't started working working on it yet. But there are two ideas I would like to work on. 1) We could export a vector displacement map of an area, perhaps similar to the way we can already generate a heightfield from shaders and then save that heightfield to an image, but we should be able to do it with vector information (RGB) instead of height information (greyscale). 2) The micro exporter could export a lower resolution mesh along with a vector displacement map to account for the missing resolution (and optionally just a regular greyscale displacement map, since this is often sufficient for this kind of situation where you're just using displacement to add the finest details).

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

Tangled-Universe

Please shoot if you have any questions.
I can write a short'ish how to on the work I did for Unity.

Matt,

Interesting ideas for export.
It would definitely be nice if we could somehow export VDM's from TG.
Import those to ZB/MB and export either as new VDM or an "additive" one.

I don't know which of the 2 options you propose is the fastest in terms of performance in TG?
Perhaps also to develop?

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?

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

paq

Glad to ear about possible future improvement. I know Matt was already talking about it, but I didn't want to push
to much pressure.

Hi Martin,

QuoteFor 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.

That's indeed a problem. I was hoping Meshlab could clean this overlapping geometry problem when using mutli-threading rendre in Terragen, but without success.
(There are so many functions in this software).

But I'm not really sure why you render the 'hires' version without mutli-threading ? Having a 'clean' mesh is only important for the ingame lowres mesh, so why not generate a low detail version from Terragen ... even with mutli-threading off it shouldn't take that long ?

To me, it would be great to have some sort of terrain exporter node, working a little bit like the heightfield exporter, but with the option to export the result as vector displacement, or as full geometry ... and if the geometry option can store color vertex, this would help a lot to bake textures too.

... (any hint about the famous 3D erosion plugin ?  8))


Gameloft

Tangled-Universe

If you export with the micro exporter while rendering multi-threaded then the mesh will have artefacts at the bucket tile boundaries.

Rendering with 1 thread and setting bucket size to the size of your rendered frame + unchecking "auto reduction" will force the rendering of the entire frame as 1 bucket.

paq

Hi Martin,

I understand that, but again the artefacts introduce by the multi threading are not really visible for the rendering, or for normal baking.

So my suggestion was :

1) generate the hires terrain mesh with multi-threaded on, to speed up the process (so you don't end up with 12-20 hours of processing)

2) generate a relative low version (detail 0.15 or less) with multi-threaded off, auto reduction off, etc.

All you have to do with this lowres version is to merge vertex (Meshlab), and maybe reduce the mesh a little bit further using a decimation tool (zbrush, Atangeo balancer, etc).

Then you bake normal from the hires to the low geometry as describe in the slide.
Gameloft

Tangled-Universe

Well, if you say so? :)

I think I don't understand your question, but most of all this is anything but my cup of tea.
I did the exports for TG and performed tons of tests on how to export geometry Veselin deemed suitable for use.

As far as I know he attempted the procedure you proposed, but it didn't work with multi-threaded hi-res outputs.
The tile artefacts and "shadow mesh" messed everything up, according to him.

You seem to differ in opinion about that, but I can't discuss it as it's beyond my skills and knowledge as well as not the part of the job I did.

I'm interested to see an example of your workflow. Can you show?

Cheers,
Martin

Tangled-Universe

All in all from a personal point of view I'm not satisfied by the result I managed to get, both in quality and quantity.

In the end when we finally figured out how to get it properly from TG into Unity, perhaps in flawed workflows as Paq suggests, leaving very little time left for the creative process.
In the end an experienced ZBrusher could have done similar things much faster and with more artistic control.

If you export nice looking terrain from TG then it looks horrendous from other angles.
Modelling terrain in TG which looks good at more than 1 or 2 angles is insanely difficult.

It's interesting because TG shines at rendering displaced surfaces, but modelling tools in TG are virtually non-existent if you don't count plugging/chaining fractals.

So all in all I blame mostly myself for not having developed a skillset which allows for shortcuts and smarter solutions.

However I think having access to better export tools will make a TG<->ZBrush/Mudbox > App X workflow much easier and artist/art-director friendly.
Having ZBrush/Mudbox like tools in TG would be a dream, allowing to model basic shapes with brushes and then add PF's, but I'm afraid that's not realistic to ask to develop.

TheBadger

Matt,
QuoteWe could export a vector displacement map of an area, perhaps similar to the way we can already generate a heightfield from shaders and then save that heightfield to an image, but we should be able to do it with vector information (RGB) instead of height information (greyscale).

^^This is the way to go!
Mudbox and Zbrush are not the same as you may know. I have Chris' TG to Z-brush workflow, it does not work in Mudbox. The things I mentioned in my other post were about trying to find a way to adapt Chris' workflow for Mud. As I said I found a way. But the problem was that the result was not exact. That was a big problem for me, because in my workflow I had spent a lot of time in TG building a scene that was exactly like my source location as possible. What I found was that I could not keep flat areas flat, and I could not make my heights the right height in mudbox using height maps... So when I got to Mudbox, I lost everything that TG made easy and accurate, things that are not easy or exact in any sculptor.

TG, in a few very important ways, allows a user to be very exact with a scenes in some important ways very quickly. For example, I was recreating a location from Iceland and I was able to make my scene the exact size (2000 meters long), I was able to make all the major heights within the scene as they were in the real world (no more than 100 meters high). I was also able to quickly get important visual detail and landmarks set up in TG (like how the entrance to a canyon looked, and how the height of the canyon was tallest in a certain location). Then I added a bunch of detail that helped to visually define scale in TG relative to the over all scale of the scene.

My hope was to get all of this to Mudbox as an Exact representation. But you cannot do that using brushes on a height map... It is different in Z.

*About your original response to me: I was looking for a way to displace a mudbox object much like the example in the OP link, that did not require me to use brushes to apply displacement. This would leave me with the same problems as the example in the link (stretching) But would be better than what I got using the normal Mudbox way.

Your option 2 may have use for some. But I cannot see a more direct time saving way that also reduces workflow and pipeline steps. ZBrush and mudbox both output every kind of map anyone can need today. If we can get an EXACT representation of a TG scene directly from TG to Mudbox/zbrush, this removes steps from both the mudbox and Zbrush workflows. Option1, does all the most efficiently.

I have Chris' TG to Z workflow in his own words. I want to publish it here because I think it would really shed some light for people. But He gave it to me in private so I don't know if it would be good of me to post it. I should PM him and ask.

...

T-U,
QuotePlease shoot if you have any questions.
I can write a short'ish how to on the work I did for Unity.
Did you mean Matt or anyone (especially me! ;D) If you meant including me, than I would want this!

QuoteI don't know which of the 2 options you propose is the fastest in terms of performance in TG?
As for me, this is not a good question. It can take a long time for Mudbox to save out a high res Vector map. So I don't even care how long it takes from TG. It is better to have than not have! I just say this because your post made me think maybe people would think it would take to long in TG, and thus not be implemented... Yes, better to have than not have, at any price.

QuoteSo 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?

YES! I agree with you 100%! Option 2 only sounds like a more complex and time consuming way of doing option one. When option 1 is already ideal for how people already work in Z and Mud.

...
Paq,
Quote(any hint about the famous 3D erosion plugin ?  8))
Look in announcements! 8)

...
QuoteIn the end an experienced ZBrusher could have done similar things much faster and with more artistic control.
Again, Chris's workflow. But you end up with the same problems of stretching. Though you get to where you end up much faster than what has been described here.

QuoteHaving ZBrush/Mudbox like tools in TG would be a dream, allowing to model basic shapes with brushes and then add PF's, but I'm afraid that's not realistic to ask to develop.
Even if it did have them, you would still want a fast easy accurate way to get to other industry standard soft. So you are still right.

It has been eaten.

paq

Hi Martin, and TheBadger.

So yes basically it's the same workflow that describe in the case study.

1) I pick a Hero Mountain from Chris (really cool examples)

2) I did 2 renders/export : one high res (using multi threading), and a low res version without m.t. to prevent geometry overlapping. For both I still use 'Fully adaptive' because I want to keep vertical details as much as possible. Render time was under 15 min for a 5M mesh (hires), and 10 min for the low res.
[attach=1]
[attach=2]

3) So here's how the low-res looks like. Fully adaptive indeed introduce nasty topology (unconnected triangle) over the unconnected triangle soap. I use Meshlab to merge overlapping vertices, but it doesn't fix everything.
[attach=3]

4) So here comes Zbrush, and the nice dynamesh feature. It basically re-voxel the mesh, and create a nice evently topology. The cool think is that it also help to remove/merge overlapping displacement that can often happens with Terragen.
[attach=4]

5) After the dynamesh I apply a decimation to reduce polycount a little bit more, and create relaxed uv's
[attach=5]

6) Then I bake occlusion and normal using xnormal.
[attach=6]
[attach=7]

7) Here's a quick result, with both normal and occlusion on the low-res final mesh
[attachimg=8][attachimg=9][attachimg=10]
Gameloft

paq

QuoteLook in announcements!

Thanks, don't know how I miss that :)
Gameloft