PDA

View Full Version : Zbrush, LW, and OBJ... UV's



IMI
02-17-2008, 06:19 AM
Hello. :)


I have an object which I need to make a displacement map for in ZBrush (3.1), to be rendered in LW 9.3.1. The problem is, it's an OBJ file with all the separate UV maps layered into one map in th 0 to 1 UV space, and since LW's object displacement can use only one map, I can't see how I could make a displacement map for it which would work for the whole object. ZBrush can't deal with overlapping UV's.
I could move the UV's around where nothing is overlapping, but then I wouldn't be able to use the textures.

Any ideas?
Thanks.

UnCommonGrafx
02-17-2008, 07:43 AM
I've done this and Steve Warner's info on ZBCentral was the path to follow.

Apparently, you can move all the other layers off to the right, or left, of the LW UV window in a straight line. Take this saved obj into zb; paint; export the maps and put everything back in the UV space in LW.
Good to go.

IMI
02-17-2008, 08:16 AM
Oh yeah, Steve Warner. The man who seems to have all the ZB to LW answers. I hadn't thought of searching to see if he had anything to say about it. I'll check that out.
Thank you for the info, too. :)
I haven't even begun to do this yet, without finding out first if I could do it without having to create all new textures.
But how would I place all the UV's back exactly where they were to begin with? Is it possible to make a morph target map for the moved UV's, and then return to "base" so they're exactly where they were before? Have never tried anything like this before.

IMI
02-17-2008, 08:21 AM
Well, I quickly tried morphing the moving of some UV's. No-go with the normal method, unless there's some other way.
Although I'm figuring that's not necessary to be able to do that anyway.

IMI
02-17-2008, 08:27 AM
Oh. Duh. "Undo" seems to be a good way to move them back after exporting. :foreheads

IMI
02-17-2008, 08:44 AM
Hey, it actually works. Cool deal. Thanks! :)

UnCommonGrafx
02-17-2008, 08:54 AM
That works, too. ;)

Another way is to move your uv info with the numeric panel. That way, if you need to save the object in that state you can easily get them back to where they were.

Glad it's working for you.

IMI
02-17-2008, 09:18 AM
I just tried this with a quickie test OBJ I had which had the same "problem", haven't begun with the real deal yet. I think when I do that I'm going to record parts of it with Cam Studio for future reference and upload it for others.

This was a real stinker of a problem, and I wouldn't have thought to do what you suggested, so I do most definitely appreciate it!

UnCommonGrafx
02-17-2008, 09:22 AM
Yeah, the tute would be good for all to have. And am very happy to pass on the knowledge as it increases the depth of the pool of knowledge around here.
Happy to assist.
Thanks for revvin' up the brain this morn.

prospector
02-17-2008, 10:58 AM
I think when I do that I'm going to record parts of it with Cam Studio for future reference and upload it for others.
Great idea !

Silkrooster
02-17-2008, 06:38 PM
Excellent idea. I recently got zbrush and am still having issues wrapping my head around the program. Boy I hate how you select objects in it.
Silk

IMI
02-17-2008, 08:53 PM
All in good time. ;)
Meanwhile, if you want to try it, first you need an OBJ file with separate UV maps all layered into one in the 0 to 1 UV range.
If you don't have one like that, you can make an object in LW and created different UV's for different surfaces then paste them into one layer. If you don't do that, when you export as OBJ, only the first UV will be saved and the rest will disappear into the ether. No idea where they go, but go away, they do. ;)

What I do though when I want OBJ is to simply save that LWO out as .lwo and open it in Deep Exploration, then save it as OBJ from there. Deep X compacts all the UV layers into one in the resulting OBJ file.

So, if you load your OBJ file into Modeler, you can then select the UV's by surface and move them to the left or right so nothing is overlapping. Then you have to make sure the UV map is applied to each surface, then export OBJ from LW. Then hit Undo enough times to get the maps back into the original position. Yes, you can use Numeric, but it's easier and quicker to use Undo.

Then you have to put your object into sub-patch mode and save it as .lwo. Of course, if it's already polygon-heavy, you can lower the subpatch division in the options pane first, but it seems Layout needs a subpatch object for node deformation.

Then you send that object to Layout and frame it up in perspective, with texture shaded on.

Then open ZB and import the OBJ file and crank up the subdivisions on it several times and sculpt something onto it. Crank it back down to its original state and generate a displacement map, flip the V on the generated alpha (VERY important!), and save as TIF. PSD import in LW is broken or something, or maybe it's ZB, but you'll get some strange lines and a very bad displacement if you use .psd in Layout 9.3 and/or 9.3.1.

Then you have to select your object in Layout and go to its Properties>Deform tab and click on the Edit Nodes and load your texture into the node tree. I import one I saved out from either the LW Content or from Steve Warner's Essential LightWave v9 book content. I honestly can't remember now where it originated, but it's basically thus:

Image map into the A channel of a Math>Scalar> Subtract node.. from that Result into the A channel of a Math>Scalar>Multiply node... from that Result into the Scale input of a math>vector>Scale node, with the result into the Input of the Displacement node.
You also have a Spot Info node plugged into the Vector input of the math>vector>Scale node, from the (blue) Normal output.

Clear as mud, huh? :D
Of course, this displacement node setup works well with any object. I'm sure there are other nodes which can be added in between for further tweaking, but haven't done much, as this is pretty good as it is.

The Subtract node adjusts "the midpoint of the displacement map", the Multiply node adjusts the amount of displacement, and the Scale node "scales the normals by the UV values".

Side note: If you want to use Z Mapper to create a Normal Map, you'll be told by ZB that you have multiple UV regions, and you have to do each surface separately. How one uses a Normal map in LW though is still beyond me. I haven't looked into it much, but my early experiments haven't worked out well at all.

IMI
02-17-2008, 09:13 PM
I will add though that this is an irritating workaround or fix for a problem which should be avoided. If you model something that you know you're going to be exporting as OBJ and using ZB displacements on, you should most definitely UV map it with one map, with the UV's from 0 to 1, from the get-go. That way you also avoid the Z Mapper nuisance as well.

Silkrooster
02-17-2008, 10:12 PM
What bugs me is for example painting, they say you have to kill the uv first. Seams like such an unnecessary step. But I am probably getting OT.
Silk

IMI
02-18-2008, 12:34 AM
Don't know. I can't remember right now. I did try the poly painting shortly after getting ZB, and I seem to remember something unnecessarily convoluted about it, but as far as painting goes, I don't see much reason to use ZBrush. I've been using Deep Paint 3D for a long time now and find it can do all I want.

Jim M
02-23-2008, 10:12 PM
"and since LW's object displacement can use only one map,"

Wrong.

IMI
02-24-2008, 06:05 AM
"and since LW's object displacement can use only one map,"

Wrong.

Thank you, Jim M, that's very useful.
Would you care to add any more information to that?

I'm referring to the "Edit Nodes" option under the deform tab. If there's a way to use multiple displacement maps for multiple UV's on a single object in a single layer, I can't see how.
I wouldn't discount the possibility of using the node editor to somehow mix a few together, but I don't know how to go about that, or even if it's possible at all.

I had considered breaking the object into parts with their relevant UV's and placing them in separate layers, but that wouldn't be so good when the object requires welded vertices.

UnCommonGrafx
02-24-2008, 08:11 AM
IMI,
hehe, what you have to do is bring in all your maps. Add a vector "Add4". Plug the multiple maps into that. Then on from there as you would for a single map.
Should work.

theo
02-24-2008, 08:24 AM
Don't know. I can't remember right now. I did try the poly painting shortly after getting ZB, and I seem to remember something unnecessarily convoluted about it,

There is nothing convoluted about it, whatsoever. I would go as far as to state that it is one of the easier tasks to accomplish within ZB.

IMI
02-24-2008, 08:25 AM
IMI,
hehe, what you have to do is bring in all your maps. Add a vector "Add4". Plug the multiple maps into that. Then on from there as you would for a single map.
Should work.


Well, thanks. :) Although the "should work" part kind of concerns me. ;)
I'll give it a try though and see. Not sure yet how to go about it, but we'll see.

IMI
02-24-2008, 08:28 AM
There is nothing convoluted about it, whatsoever. I would go as far as to state that it is one of the easier tasks to accomplish within ZB.

Convoluted was probably the wrong way to describe it. I was following a tutorial and this was right after I first got ZB, when the interface was still really weird to me. Although I do remember now getting a pretty good result from my test efforts, just never followed up on it.
I'm sure you're right, and I plan on digging back into it some more later on. I'm trying to figure out normal mapping at this point.

goodrichm
02-24-2008, 08:34 AM
Our man, Dodgy has put together an awesome LW-ZB-LW work flow tutorial on his site...MG

http://dodgy.ghostoutpost.com/

theo
02-24-2008, 08:37 AM
Convoluted was probably the wrong way to describe it. I was following a tutorial and this was right after I first got ZB, when the interface was still really weird to me. Although I do remember now getting a pretty good result from my test efforts, just never followed up on it.
I'm sure you're right, and I plan on digging back into it some more later on. I'm trying to figure out normal mapping at this point.

Yup, if one is dealing with UI overload even the simplest process appears convoluted, this seems to be especially true within ZB, a program that really requires a certain mental expanse to approach it in the beginning.

Oddly, once the UI flow is overcome ZB is a very easy program. And poly painting, you will find, is almost too easy.

I recommend sticking with it and you will soon find this to be true.

IMI
02-24-2008, 09:08 AM
Oddly, once the UI flow is overcome ZB is a very easy program. And poly painting, you will find, is almost too easy.


I see no reason to doubt that. I'm completely comfortable with ZB as far as sculpting goes, and that took no time at all. Thanks for the reassurance - I'll definitely give the poly painting another good shot soon as I can get around to it. :)

Meanwhile, the Add 4 seems to be sort of working, but I'm seeing some weird displacement where I haven't created any intentionally. I'll have to try it out later - I'm sure I'm doing it wrong. No time now though unfortunately.

hrgiger
02-24-2008, 09:23 AM
Nevermind. Move along, nothing to see here. We're just a hedge.

Jim M
02-24-2008, 09:25 AM
Hi IMI,

Its very simple. Its just UV maps.

One thing. You must include the rest of the geometry in each UV map. So each uv map is a map of the entire model, just most of it is hidden a away.
....Or you will get weird displacements.

IMI
02-24-2008, 09:36 AM
Thank you Jim. I see what's going on here now, and I do appreciate it. :)

Silkrooster
02-24-2008, 05:35 PM
Yup, if one is dealing with UI overload even the simplest process appears convoluted, this seems to be especially true within ZB, a program that really requires a certain mental expanse to approach it in the beginning.

Oddly, once the UI flow is overcome ZB is a very easy program. And poly painting, you will find, is almost too easy.

I recommend sticking with it and you will soon find this to be true.
I really do hope your right.
Silk

Silkrooster
02-24-2008, 05:36 PM
Hi IMI,

Its very simple. Its just UV maps.

One thing. You must include the rest of the geometry in each UV map. So each uv map is a map of the entire model, just most of it is hidden a away.
....Or you will get weird displacements.
How on earth can you remember all this. lol.
Silk

IMI
02-24-2008, 05:51 PM
theo IS right. :)

And Jim's solution is basically using the power of the node editor to split the otherwise un-splittable. If you look at it, it makes perfect sense, and like all LW node functions, you have to think linear.
Of course, remembering isn't so important once you've exported and know you can re-import the nodes as you need them. ;)

Silkrooster
02-24-2008, 06:39 PM
theo IS right. :)

And Jim's solution is basically using the power of the node editor to split the otherwise un-splittable. If you look at it, it makes perfect sense, and like all LW node functions, you have to think linear.
Of course, remembering isn't so important once you've exported and know you can re-import the nodes as you need them. ;)
You know, that is an excellent point. Besides saving the nodes it should also be possible to add them to the presets.
Silk

Jim M
02-24-2008, 07:50 PM
"How on earth can you remember all this"

Well after going through what IMIs gone through, and banging my head a thousand times, its become second nature, to bang my head a thousand times :)

Seriously though its really simple, the only thing that is not lgical to me is why you whould have to have complete mesh per UV map...

Hang on a minute ... if a vertex isnt on the UV map then its value is probably considered X.... X -0.5 returns the wrong value ...i.e some deformation. Whereas by putting the rest of the geometry in the UV map where its value is read (converting to RGB now) as 128 / 129 then it deforms properly. Ah it all makes sense. All is well.

IMI
02-24-2008, 09:14 PM
"How on earth can you remember all this"

Well after going through what IMIs gone through, and banging my head a thousand times, its become second nature, to bang my head a thousand times :)

Seriously though its really simple, the only thing that is not lgical to me is why you whould have to have complete mesh per UV map...



Yeah, there's alot of headbanging with ZBrush. It ought to come with a free Slayer CD or something. ;)
But, although the idea of UV's beyond the normal range is possible and even acceptable, and even possible to defeat, there is now the question of, "why does it have to be that way"
I'm wondering if the whole UV mapping scheme needs to be re-evaluated. OBJ is a format from a time when simple was the only way. I wonder if the idea of a limited UV range wasn't designed around the same idea of simplicity relevant to its time.

kfinla
02-24-2008, 10:38 PM
Interesting.. ive tried the multiUV thing in LW and had issues.. i guess it was because each UV map was a peice.. not the whole model's UV's.. ill remember this and see if it is a LW centric things

lightmann
02-25-2008, 10:22 PM
I use a similar solution of Jim M to animate a crossover of displacement maps using a multiply node with evenlopes before de final adds nodes.

Nearly a solution for multi displacement is using displacement parameter by surface in it own node editor " and bump displacement active.

IMI
02-29-2008, 02:58 AM
I'll say one thing about ZBrush's poly painting - when you convert it to a texture it joins up the UV seams very well, even in an object with bad UV mapping with harsh seams. I'd say it's even better than DeepPaint 3D in projection mode, for painting across seams. Actually, it's far better, since you're not actually painting on the UV map, but vertex painting and then "projecting" that to an image file over the UV map, but assigned to UV's.
I'm glad that came up earlier. I'm now hooked on poly painting. ;)

Silkrooster
03-01-2008, 08:40 PM
Well, I got around to trying out Steve Warner's tutorial and I actually was able to create a UV map in Zbrush. (Yea Me - golf clap)
So the displacement map worked in LW using the nodes, but it didn't seam very pronounced. Anyways, some of my faith of ZB has come back.
Silk