Instancing geometry over an imported model

Started by Ashley, January 13, 2014, 09:37:54 PM

Previous topic - Next topic

Ashley

Hi,
I'm new to Terragen. I've looked without success for an answer to my question.
So I'm hoping someone here can help.

I have modeled a landscape in zbrush, decimated it so its nice and lite. Then exported it as .obj file (no uvs but I can add).
What I'm trying to do is populate my model with trees, rocks, grass etc...

However when I add a populate node (e.g object>add object> population> rocks) they won't "sit on terrain".

Is this possible in Terragen?

Thanks in advance :-)

Kadri


For now population over imported OBJ files is not possible.
They are working on it and it will be possible in the future probably but there is no estimated time frame.

There are some other ways to use it anyway.
Make an orthographic render over your object as a EXR file
(You can use normal images too but they are not much detailed )
in Zbrush or Terragen by using black and white for the high and low parts of the object.
Then use that image as a displacement map for example.
Only overhangs would be problematic in this way.

You can use vector displacement maps too (i did not try this).
In that way overhangs are possible too.
Use the search for more information.
Here are many threads about these things.
If you need more help ask again others will help depending what you ask.

TheBadger

Welcome.

As kadri mentioned, vector displacement is a great way to do what your asking about. Using a model for the terrain its self almost always has problems, and rarely looks good, from what I have seen.

Since you use Z-brush you have a very powerful tool to combine with TG.
If you generated your z-brush terrain from a plane in z-brush, you may only need to save out a vector map. and then import that into TG. Then you can populate on it as much as you want. Just as you can the rest of TG.

You can also have big overhangs, caves and arches in this way.

This thread has mudbox in the title, but a very large part of it is about Z-brush. There are example files, and instructions. As well as problem solving tips. It is quite a long thread though, so you will have to sort through it all.

http://www.planetside.co.uk/forums/index.php/topic,16110.0.html

Pretty much all you need is there. Once you get through that, then ask more questions. There are at least several Z-brush users here who have gone through the workflow, and will probably have an answer for you on any of the finer points.

It has been eaten.

Ashley

@Kadri
Thank you, could you explain the Terragen method for creating the height/displacement?

I have had success with an 8bit image as height but am now dealing with lining up the terrain to an imported obj (which I'm using as reference).
If I could load an obj, create the height map then displace the terrain with that would be aces.

@TheBadger
Amazing I'll read through that thread. I am keen to try out the vector map method. No doubt it would yeild some super accurate results.

Yeah the combination of Terragen and Zbrush/Mudbox is quite awesome. Thanks for the swift replies what a great forum!

Cheers!

Kadri

#4

Ashley have a look at these files.
Not sure if that is any help but try at first the 01... then the 02...labeled files in the Zip file.
And don't think that this is the best or only way.
There are other ways too as in many things in Terragen.
I made this in a quick and dirty way quite fast to show you how you could approach this as an example.
Accuracy was at no time important to me so i am not much a help in that aspect.
But if you have further problems just ask here.

[attachurl=3]


[attachimg=1]


[attachimg=2]

Ashley

@ kadri,
Thanks for the scene, it helped a lot in understanding the setup. I got that to work with a height map from zbrush.
Which was a top down 'alpha grab' of my model. This method seems to work better in T 2.5.

@ the Badger
I've gone through the the link you sent, and also got the vector displace to work. In T3 this was a more accurate method and works easily enough.

However in terragen 2.5 the tutorial by j meyer seem to work better in T3.
The zbrush vector displacement advice was spot on cheers to j meyer.

So in T3 this is my workflow:
- export plane from maya.
- sculpt it in zbrush.
- follow j meyer vector displacement export for zbrush.
- open T3, delete the default terrain (fractel terrain 01 and fractal wrap shader 01).
- create a vector displacement shader, image map shader (as the vector function) and load my vector map
- set the image map shader to 'position lower left' under projection location. And create a projection camera.
- Rotate the projection camera to x -90, so it is pointing down.
- set colour to data is linear the rest of the image map shader I leave as default.
- All other settings such as displacement multipliers are left at 1 (or default).
- I then load in an obj of my original model (decimated in zbrush to a lower resolution). So I have a reference for the correct shape.

Now I raise the translate y of the projection camera until the terrain matches the object. The object is set to wireframe.

This seems to work almost perfectly, what I would like to know is if there is a way to accurately calculate within T3 the height of an external object?  (the obj).

Here are my questions;

1. I noticed there is in the obj loader node there is an option under OBJ options to 'source in cm'. Will setting this option to on calculate the actual world scale more accurately?
I ask because I want to use terragen to populate the terrain and would like the resulting layout to match the world scale back in maya.

2. How do I now blend the procedural shaders in terragen to my vector displaced terrain?
i.e how do I now add the fractal goodness ontop seamlessly?

Thank you for all the advise thus far, I hope my workflow detailed above helps others with a similar goal :-)
Cheers!

Dune

There's no need to make a camera with your image map, you can just project on Y, and set the scale you need. Play with scale, and displacement settings in the vector displacement shader until it matches your object
Regarding 2: procedural shaders will see you displaced 'object/vdisp map' just as any procedural terrain, so you need to work with slopes and heights, or masks (like painted shader, Image map...)

dandelO

Sorry to take this opporunity to hijack, Ashley.
Ulco. What you just said is interesting to me, I haven't played with vd maps yet, other than to draw a quick r,g and b image to test the idea, but you have, do you mean above that I could use a vector displacement map as a terrain and that a population sitting upon that would respect the actual direction that the final normal faces after Compute Terrain? Say there is an inverted surface, the roof of a cave, as a quick example. If I populate on that, do the instances respond to that normal and face downward as the population moves from flat to upside down? Do you know what I mean there? Not sure if I'm explaining myself correctly. Basically, would instances follow the curve of the cave walls to eventually be turned upside-down by the time they reach the roof, I guess is the easy way to ask the question?

TheBadger

^^ Isen't the answer yes? I believe there is an image by Ulco (caves) in image sharing that he has plants growing on the cave walls and roof, I thought. I thought I remember that he (or someone) said the population did not fill space as easily in that situation though?
It has been eaten.

TheBadger

ah found the thread I was thinking of http://www.planetside.co.uk/forums/index.php/topic,16154.0.html no talk at all in it of your question Martin, sorry. I dont know what thread I was thinking about now. But I know this was discussed, Im sure of it. Just can't remember where  :-[ or what the details and conclusion were.
It has been eaten.


dandelO

Cheers, Michael. Not been around here much recently so, must have missed that. :)

TheBadger

Ahh, yes, thanks J! Thats the one I was thinking of. Good. Thought maybe I just made the whole thing up for a sec.  :o That would of scared me a little.

Does that one answer your question DandelO? What were you thinking of trying?
It has been eaten.

Dune

Planting objects on those upside down walls is not that easy, as far as I've experimented. The grass I planted was a 3D grass anyway, really 3D, so like an explosion of leaves in all directions. If I take the location of the pop from inside the cave, the location doesn't seem to be taken correctly and most grass end up on the mountain above the cave. If you take a location just outside, and extend the pop wide enough to cover inside, it works. I don't actually know if objects are placed upside down if inside. Have to check that. They probably would if you use the rotate feature.
Just checked; they don't follow the cave's normal.