texture maps for vector displacements

Started by oysteroid, January 26, 2015, 07:48:38 PM

Previous topic - Next topic

oysteroid

While working on my entry for the Iceland contest, I ran into another problem with texture maps and vector displacements that I am not sure how to solve. I have a mountain that I sculpted in ZBrush which I bring into TG as a vector displacement map. I then use a strata and outcrops shader to add some hard rock layers to that mountain. If I also want to use a color texture map from ZBrush to control certain color variations on the mountain, things get troublesome.

As you so helpfully pointed out, Matt, having a compute terrain node below the vector displacement and texture mapping screws up the texture coordinates such that the texture doesn't line up properly. But, in order to use a strata and outcrops shader with a distribution shader to constrain altitude, you seemingly need a compute terrain node above the strata and outcrops shader and its distribution shader. But, if you put the compute terrain node above the vector displacement, such that the vector displacement is between the compute terrain and the strata shader, the strata will work without a distribution shader, but not with it. If you put the compute terrain node below the vector displacement and above the strata shader, between the two of them, the strata works, but the texture on the vector displacement gets wrongly aligned.

I hope this makes sense. I am rather confused.

Is there any way to solve this?

I need the following all to work together:

vector displaced mountain
texture map properly aligned to mountain
strata and outcrops applied to mountain with distribution shader constraining altitude

I attached the same scene as before in this thread, but with a strata shader added. Any help would be greatly appreciated!

Tangled-Universe


Oshyan

I'm not quite sure I understand what you intend either. If you're displacing your terrain beyond what was done in Zbrush, it is unavoidable that the textures won't line-up, right?

- Oshyan

oysteroid

QuoteCan you show how it should look?

I can't get it to work, so without painting it, I am not sure how to show how it should look. Also, the file that I provided isn't the scene I am working on. It is just a test scene to show the basic problem. But it seems to me that you should be able to retain the basic mapping of the image while getting some strata displacement with the given constraints, in this case, limiting it to the upper half.

QuoteIf you're displacing your terrain beyond what was done in Zbrush, it is unavoidable that the textures won't line-up, right?

Is it truly unavoidable? If this is definitely so, I'd like to know that, so I don't waste any more time trying.

Here is what I am trying to do. For the Iceland contest, I am putting together a scene that includes a mountain very similar to Kirkjufell:

https://www.google.com/search?q=kirkjufell&biw=1920&bih=940&source=lnms&tbm=isch&sa=X&ei=lLPaVLzFJpOtyQSToIKgCw&sqi=2&ved=0CAYQ_AUoAQ

I don't have World Machine or any other software capable of erosion. I hope to win myself a copy! So I figured I'd manually do it in ZBrush. But I found that producing the strata layers is quite a pain in ZBrush and you need a very high resolution map to get enough crunchy detail in the rocks. So I got the basic shape of the mountain minus the strata layers that are exposed near the top of the mountain. I manually sculpted the erosion for the lower region and a basic starting point in the upper region for TG's strata shader. And the reason I use a vector displacement rather than a height field is that there are some places in my mountain that have a little bit of overhang. Also, I am not sure how to produce a good high resolution height field map from ZBrush. I am sure there is a way.

When I bring the mountain into TG as a vector displacement and then apply a strata shader with the right setup, it looks rather nice. The strata is limited to the upper portion of the mountain. And honestly, I don't care what happens to the texture map right in the exposed hard layers of rock, as I am replacing the color in that area anyway in TG, using a fractal texture that is slope constrained to the vertical parts. But the base of the mountain looks too plain. And procedural shading, as far as I know, won't allow me to color in a way indicating nice rock flows under the hard layers and other color variations that are related to the topography of the mountain. So I figured I'd paint a map for it in ZBrush. But, it doesn't seem to work.

In my mind, it seems that the software should allow something like the following sequence of events:

1.Map texture flat on undisplaced ground.

2.Displace the surface according to the vector map, carrying the above image information with it, such that each pixel in the vdisp map is tied to a pixel in the color map.

3.Further displace this surface with the strata layer constrained by a distribution shader that limits it to the upper part of the mountain, possibly distorting the heck out of the texture where the hard layers and maybe even mesa buildup are. That's okay because the color I am trying to map isn't in the strata area anyway. It is below where the strata layers are not.

But, TG doesn't seem to do what I expect. When the strata layer is working along with its distribution shader, my texture is badly tilted. The funny thing is that if I disable the distribution shader that constrains the strata shader, the strata distortion works and the texture remains in its proper place. This is with the compute terrain node removed. But of course, without the distribution shader, the strata is everywhere. But as soon as I plug in the distribution shader as a mask on the strata shader, the strata completely disappears. If I stick the compute terrain node back in, between the vector displacement and the strata shader, the strata shows back up and works like it should, but my color map becomes misaligned.

The fundamental problem seems to me to be that for a distribution shader to work, you need a compute terrain node above it, but without a vector displacement node in between. But a color map on a vector displacement won't align properly if there is a compute terrain node anywhere below it. So there is a conflict.

I can't seem to make it work. But I don't understand the whole node network very well yet. So I hoped that someone else might know of a way around this.

Dune

I haven't looked at your file yet, but did you set the distribution shader's altitude/slope key to final? Another option may be to decrease the patch size in compute terrain to 1m, or use a compute normal (if you need slope restriction) and/or a XYZ shader (if you only need height restraints). There are other options to make that mountain; I think it's easily done within TG itself with a warped simple shape, maybe some blue nodes for big strata (smooth step), a strata shader and some vector displacement, or normal displacement for the overhangs. I might have a go at it , just for fun.

Matt

Quote from: Dune on February 11, 2015, 02:34:12 AM
I haven't looked at your file yet, but did you set the distribution shader's altitude/slope key to final?

That's what I would suggest too (the altitude key). I haven't looked at the file because I'm trying to avoid looking at any contest entries until after the closing date for entries.

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

Dune

I had a look, and indeed, the key is the key  ;)

oysteroid

Thanks, Dune and Matt! I'll give it a try. I have been preoccupied with other problems as you can see in the support forum!

oysteroid

I finally got around to trying this and yes, it works! Thanks so much! I knew that there had to be a way! There are so many settings that one can overlook!

Thanks again!