texture maps for vector displacements

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

Previous topic - Next topic

oysteroid

Is there a way to properly map an image map texture to a vector displacement of the planet? For example, if I use ZBrush to make a vector displacement map, I would also like to do some polypainting on that mesh in ZBrush while it is fully displaced, painting all over it, adding color details under overhangs, and so on. I can then export a "texture from polypaint" in addition to the vector displacement map. But in Terragen, I am not seeing any obvious way to map that color texture to the surface such that it matches up correctly. There is the option for UV mapping in the image map shader node, but since I am applying a vector displacement image map to the planet, the UVs from the original object are not present.

Is there any solution to this besides just importing an object instead of using a vector displacement?

Any help would be greatly appreciated!

Ashley

I suggest using TG shaders for the bulk of your texturing, or at least to provide good masks if you want to texture further in Zbrush.
You could try projecting your textures through a camera, but really depends on what your goal is.

oysteroid

Ashley, thanks!

But for what I want to do, I need to be able to manually paint the textures right onto the object. In fact, I need to be able to sculpt and color the object at the same time, such that little bumps I add are a different color from the surroundings, and so on. There is no way to do what I want to do procedurally, and camera projection mapping and whatnot wouldn't really work very well.

Anyway, I think it is clear that the only way in Terragen is to import a UV-mapped object. It would be nice though if it were possible to apply the UV coordinates to the part of the planet surface where a vector displacement is applied! I don't see why it wouldn't be possible. For some things like sculpted geological features that blend into the ground and to which further displacements will be added in TG, vector displacements are preferable to imported objects. But when careful manual texturing is desired, they just won't work as is.

TheBadger

#3
Hi,

I believe you may be able to do this as an image map (there may also be other ways, but I don't know right now)
So what I would try, is first set-up your vector in TG, get the displacement that you want, how you want it.

Then import your color map(s) as image maps and project from the Y... scale the map to the same size in meters as the vector. With both being at (000/XYZ). Use .tif
This may work if you have no overhangs, and the Image maps are of high enough rez. Like (just a guess) say 8K * 8K, to start.

But if you have a large terrain made from the vector, I don't understand why you cant use  TG to texture and color. How close to it will the camera be?

Please post images of what it is you are trying to do exactly, because I don't think its clear. And someone may have a way to do what you want, in a totally different way than you are trying to do it. Its just really hard to be sure what to tell you not really being sure of the *result* you want and the reason you are trying it the way you are.

Another way...

You could import your terrain via vector, texture it (or what ever), and re export it as an object, and then paint that at scale in Z?
OR you could just import the object as an OBJ and place that in TG. Believe it or not, TG can take almost anything you throw at it in terms of file size and polly count.

I guess (based on how I read your post) that the easy thing would be to just import the sculpt with all paint layers as a .obj. Even if it has 100 million polygons, if you have enough ram on in your PC, this will work. Just be sure to view the object as a bounding box in the 3D preview as much as you can. Which is to say, don't leave it in wire frame or shaded view while you work.

Was any of that helpful? Again Im not 100% on what you are doing, so I am not sure if this is the right answer for you questions.
It has been eaten.

Ashley

Quote from: oysteroid on January 27, 2015, 01:21:20 PM
I need to be able to manually paint the textures right onto the object. In fact, I need to be able to sculpt and color the object at the same time, such that little bumps I add are a different color from the surroundings

Reusing nodes in TG will give you flexibility for using texture details as bump/displacement and as a mask for colors.
For example it is possible to use a "power fractal" to define a displaced surface as well as a mask for a color shader.

With this setup a potential workflow would be to render out in passes (and geo) import to zbrush, decimate/zremesh, uvwrap uvs, then reapply the passes as texture details in zbrush via projection master (if you make your document the same size as the TG render it should line up nicely).

still might not entirely suit what you had in mind.


Matt

#5
I guess that the colour map will be exported in the same coordinate space as the vector displacement. Is that correct?

If so, the problem comes down to how to map it in Terragen. How are you projecting/mapping the vector displacement map in Terragen? If it's with UV coordinates or any of the side or plan projections, then I would use exactly the same projection settings for the colours. Don't use a Compute Terrain node because it will change the texture coordinates (even for colour nodes that come before the Compute Terrain node). If you happen to need to compute normals for some reason, use Compute Normal node instead.

If you're using a camera projection, this won't align because it always maps onto the final displaced position. So you'd need to change to a projection setup that uses UV coordinates or one of the side or plan projections.

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

oysteroid

#6
Thanks for the advice!

I'll try to make it a little more clear what sort of thing I am talking about. Suppose you want to create a very specific mountain or rock outcrop or something and don't want something random. You'll never get exactly what you want with procedurals. Or you'll spend way too much time trying to control the random fractals. And suppose that this geologic feature blends smoothly into the surrounding terrain. This feature has many color details that you want, not just shape. For example, you might have a sandstone outcrop that has a certain pattern of colored bumps, but only in certain places. And maybe it has some of those dark stains from where the water runs down. Or maybe you want a snow cornice hanging over some bare rock on your mountain. Or maybe you want a crashing wave and want to manually paint the foam pattern climbing up under the curl. A great way to really get just exactly what you want is to sculpt it manually and to paint at least part of its texture by hand.

If this feature has overhangs, you must either use vector displacement or import a separate object. And if you want to paint the colors on the object manually, to get your stains in the exact places you want them, maybe to put petroglyphs under the overhang or something, chalk marks on climbing holds, or whatever else, you need a way to get the texture map that you polypainted exactly matched up with the surface. Obviously, this can be done with imported objects with no problem. But imported objects don't necessarily blend very nicely into surrounding terrain. So in some cases, it would be nice to be able to map a texture precisely to a localized vector displacement of the planet surface, such that areas under an overhang have unique texture coordinates.

If you just project a texture from above, it doesn't work correctly. The texture will stretch down vertical faces. Underhangs will have the same texture as the surface on top. The texture won't wrap around and conform to the displaced shape. And UV mapping does something rather similar. I have no idea how it is mapping it exactly.

If you've used ZBrush much, you'll know that really cool things could be done texture and shape-wise on things like rock outcrops by sculpting and coloring at the same time. Try this, for example, just for a taste. Sculpt a basic shape. Change the matcap to something light like SkinShade4. Fill the object with a light, warm, neutral base polypaint color. Then select the fracture brush. Turn on RGB for that brush in addition to Zadd. Select a color such as a dark brown. Then start playing with the brush on this object. If you use custom brushes with higher resolution custom brush alphas, you can do all sorts of wonderful textural things that would suit geological stuff very well.

I haven't done anything serious to show with this sort of approach yet. I was experimenting to see if it would even work first, before investing a lot of time sculpting and texturing some object. In particular, I am exploring some ideas for the Iceland contest. I'd like to maybe reproduce some specific landscape features if it is possible to bring them into TG properly.

Anyway, here are some images showing what I get in my tests. If there is a way to get it to work properly, I'd greatly appreciate the help.

Plan Y:
[attachimg=1]

UV:
[attachimg=2]

oysteroid

I've attached a ZIP with the TGD, the EXR vdisp map, and the UV test pattern if you want to check it out.

Ashley

I have a similar workflow, between Terragen and Zbrush.

Blending the two is a juggling act. Basically if I have exported Vector Displacement from Zbrush I also export an obj.
With both of these in Terragen I tune the vector displacement to match the obj, then you can turn off the obj, its just a reference.

Once all the detail has been added, exporting the geometry via a micro exporter will give you an object that should sit in the same location as the original back in Zbrush.

To get the textural detail, albeit procedural, I use cameras from the sides and maybe one top down, say 5 cameras if I am trying to re-map from all angles.
Otherwise if it is only one angle that is required then one camera can do the trick, not top down but rather looking at the subject.
And projecting these renders back onto the geo in Zbrush.

I'm still trying to find good render layer, lighting, shader settings for the renders to produce a "raw diffuse" channel.

Its alot of techniques as a work around. Would be amazing if TG had a "bake UV" and "bake shader" on the final position of the terrain.

Hope that at least sparks some ideas on how to do your terrain.

TheBadger

I see.

Did you see this thread http://www.planetside.co.uk/forums/index.php/topic,16110.msg161888.html#msg161888 ? There was a lot of discussion about UV stretching, and J (I think it was J) came up with some good workarounds.

As for color and limiting areas of detail. The simple shape and the distribution shader can do quite a lot. And unless you are putting cave drawings on walls, then I don't think that I have ever run into a way that works better than procedurals, to color and texture a large terrain. Regardless of if that terrain was created randomly or in a specific way as with a vector.

Somethings I guess you would still want to paint in the way you say. But overwhelmingly you are going to want to use PFs.

After that, wont the other advice work?
It has been eaten.

Matt

#10
Hi oysteroid,

That all makes perfect sense. You just need to remove the Compute Terrain node.

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

Matt

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

oysteroid

Matt,

That works! A big thanks! So simple! Very much appreciated! And I found I can bypass the compute terrain node by putting in a surface layer node after the compute terrain node and plugging my vector displacement into the child layer port of that surface layer node. I can then plug the usual stuff into the compute terrain node and everything works fine.

Where else can you get help straight from the guy who wrote the software?

It never occurred to me that the compute terrain node would interfere. I still have a lot to learn!

I tried another quick and ugly test, just putting in a bunch of color detail along with sculpted details to make sure that everything lines up perfectly and it does! That's just what I wanted.

[attachimg=1]

And here you can see that even with a PF plugged into the compute terrain node, allowing it to further displace the color-mapped vector displacement, the sculpted details are still aligned with the color details.

[attachimg=2]

Here's the node setup if anyone is interested:

[attachimg=3]


TheBadger and Ashley, I appreciate all of your suggestions too!

bobbystahr

Brilliant and yeah, Matt is very old school, Imagine3D and trueSpace used to be like that, but it is rarer than hen's to find the actual creator of a program replying in a forum other than defensively...KUDOs Matt.....
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Matt

It's good to see that this really works, not just in theory.

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