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!
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.
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.
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.
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.
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
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]
I've attached a ZIP with the TGD, the EXR vdisp map, and the UV test pattern if you want to check it out.
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.
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?
Hi oysteroid,
That all makes perfect sense. You just need to remove the Compute Terrain node.
Matt
Try this:
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!
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.....
It's good to see that this really works, not just in theory.
Matt
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!
Can you show how it should look?
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
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 (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.
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.
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
I had a look, and indeed, the key is the key ;)
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!
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!