Baking Textures on Mirrored Sculpts (Maya)
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-06-2009 14:19
I've run into a problem with Maya that I was hoping someone here could help me with.
I've been sculpting and baking textures for quite a while. Apart the files saving in unlogical directories sometimes, I've had little problems. However, I am now making a pair of shoes for which I will need to mirror several sculpts. I've tried two methods of mirroring: Edit>Duplicate Special and just putting -1 in front of the desired axis of the sculpt's attributes. (Comes down to the same thing I suppose, but I thought I'd try everything to see if the problem lay there.)
Either way, the mirrored sculpt always looks fine, BUT when I try baking a texture for it, the texture comes out borked. I've noticed this happens as well if I duplicate a sculpt within a scene and try baking its texture.
I'm self-taught when it comes to Maya, so I'm far from an expert. Is there something else I should pay attention to while mirroring?
Any help or suggestions would be greatly appreciated.
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-06-2009 17:57
From: Anya Yalin files saving in unlogical directories sometimes Before we go any further, let me stop you right there. This is a very common misconception among new users, especially those who are self taught. In truth, Maya actually saves files in very logical places. It's just a question of knowing what you're looking at. Maya saves everything in collections of directories, called projects. Every time you begin something new in Maya, you should create a new project for it. Every time you start Maya at all (and I do mean EVERY time), you should check which project is currently active, so you don't overwrite any files, and so that you know where every saved file will end up. I'll explain how in a second, but let me explain a bit more about the structure first. Most of the subfolders within a project's main directory are named for the kinds of files they contain. For example, if your project is called "myProject", then your scene files will save to myProject\scenes\, your images will save to myProject\images\, your 3D paint effects will save to myProject\3dPaintEffects\, etc. As I said, it's all very logical. To create a new project, click File -> Project -> New. Give your project a name and location, and then hit Use Defaults at the bottom of the dialog, to set up the proper directory structure. To change which project is currently active, click File -> Project -> Set. To change the directory structure of a project (NOT RECOMMENDED) click File -> Project -> Edit. All this is explained in the Using Maya section of the help, just so you know.  From: Anya Yalin the mirrored sculpt always looks fine, BUT when I try baking a texture for it, the texture comes out borked. Define "borked". What exactly is wrong? I'll take a guess. Is it coming out black, or very dark, and/or with visible highlights seemingly opposite of where they're supposed to be? If so, then your mirrored surface is inside out. The normals are pointing inward instead of outward. This is very common when surfaces are given a negative scale. If you're surface is NURBS, simply reverse the surface direction on one axis. (Surfaces section -> Edit NURBS -> Reverse Surface Direction -> Options Box -> pick U or V -> OK) If it's poly, then you can reverse the normals directly. (Polygons section -> Normals -> Reverse) Another option is simply to bake the textures on the original surfaces, not the mirrored ones, and then apply the same textures to both versions in SL. Just flip the textures over on the mirrored ones. Of course, this will only work if the lighting and other texture elements are meant to be symmetrical.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-06-2009 18:45
It's mostly in the beginning that the directories confused me. Yes, I never made project files. And I came to notice that I would find textures under Maya>Projects>Default and under Maya>Projects>Default>renderData>mentalray>lightmap. I've set up a project now, and my files still end up in that last directory (Default being replaced by the project name of course), which is where I would expect them to be. I've always found my correct files in the lightmap folder.
When I posted about this problem, whenever I baked light on the mirrored sculpt, Maya would make a file in BOTH directories (actually, this always seemed to happen with any texture, but I just ignored the additional texture saved under Default). The textures generated for the mirrored sculpt both looked 'off'. The one in Default was very dull, flat, and the shadow areas just didn't neatly correspond on the model. The texture in Lightmap I can best describe as 'static'. It's like looking at colored fur with black and white areas here and there.
So I made a project now, opened my scene, mirrored my sculpt and tried reversing the surface direction. However, I still get the same result (static). I tried both U and V. Is there something I should pay attention to when mirroring? When doing Edit>Duplicate Special does the geometry type (copy or instance) matter for example? Or where it's grouped under?
I'm using directional light. I bake by assigning a bake set, doing a Batch Bake, and then converting to a file texture in the hypershade window. This has always worked perfectly fine. I've noticed this same 'static' effect when trying to bake a texture on a sculpt that was duplicated within a scene. (Which is easily avoidable of course, why I no longer have that problem. When I reimport the model this error does not occur.)
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-06-2009 20:18
Can you post a shot of one of the bad textures? I'm not quite sure what you mean by "static".
As for whether it's a copy or an instance, that shouldn't affect the bake in any way. Same with the grouping. Both can affect the sculpt map export, though, so for that reason, stick with copies instead of instances, and group everything under World. You don't want any unnecessary shared inputs or hierarchy levels in there.
The fact that you say the problem happens on both positive and negative duplicates is very strange. It sounds like it's got nothing to do with negative scaling. Something is going wrong with the duplication itself. I'm wondering if it's a bug in either Maya or Mental Ray.
What version of Maya are you using? If it's 2008, I could try to replicate your process, and see if I can trigger the same problem on my end. If it's an older version, I won't be able to attempt it for about a week. My desktop, which has a few different versions on it, blew up today (Suck!), and I need to wait for replacement parts to arrive before I can use it again. If it's 2009, I won't be able to try at all. I don't have that version.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-07-2009 05:32
This is what I get basically:  Top is the texture on the non-mirrored sculpt, which looks totally fine. Under that the texture for the mirrored sculpt, as it is generated in the lightmap directory. Bottom is the texture for the mirrored sculpt, as it was generated under the Default directory. (When I make a project file this extra texture doesn't get generated anymore, but just to show you what happens.) I'm using Maya 2008 and the Maya software for rendering. I imported my original sculpt into the scene, set lighting to Use All Lights, and set up a directional light. I made a blinn, with a slight bump map and applied it to my model. Assigned a bake set to my sculpt, file type tga, orthogonal reflection and bake to one map checked. I do a Batch Bake, with Bake Shadows checked. Convert to file texture in the hypershade window, Bake Shading Group Lighting and Bake Shadows checked, file type tga, 512x512. Then let it render. For the mirrored sculpt, I did Edit>Duplicate Special, chose Copy and group under World, let it apply. Just to be sure I deleted the original sculpt from the scene, in case this somehow messes things up. Then I reversed surface direction  on the mirror. I used the exact same baking procedure and let the texture render, which gives me the 'static' texture. On the pre-render of the frame everything always looks ok by the way. I really have no clue, textures baked on original sculpts always look completely fine. Thank you already for trying to help, I really appreciate it.
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-07-2009 09:31
I'm not quite sure about the second image, but the third one almost certainly looks inside out to me. The second one might be the result of bumping an inside-out surface, or it might not. It's hard to tell for sure. Have you tried turning on normals display to see which way they're pointing? I'll bet they're pointing inward on the mirrored surface. If I'm wrong, and they're pointing outward, then I'd suggest eliminating all other possibilities one by one. Try this:
First, how do things look if you do a still rendering of the scene instead of a bake? If both surfaces look OK, then you know the problem has something to do with baking process specifically. If the mirrored surface looks messed up in the still rendering, then the problem has nothing to do baking, but is in your surface or material.
Next, try applying a simple no-frills Lambert material, and see if that works. If it does, try applying your bump map to that, and test again. If that works, now try a Blinn with and without the bump.
If the bump works with Lambert but not the Blinn, then you can be pretty sure something in the Blinn math is screwing things up. Try setting a Phong to closely resemble a Blinn, and see if that does the trick.
If even the plain old Lambert didn't work, regardless of bumps, now it's time to see if the renderer is the problem. Repeat the experiment using the Maya software renderer instead of Mental Ray.
If the problem persists across all renderers, all material types, and you're absolutely certain the normals are correct, I'm out of ideas for the moment.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-07-2009 10:34
I turned on normals display on both the original and the mirrored sculpt. I'm not sure how to interpret these, but from what I can tell they look normal on the mirrored sculpt even BEFORE reversing surface direction. The sculpt has a long thing shape and there are lines going outward from the model on either side. The mirrored sculpt looks logical, exactly the same as the original but mirrored. When I reverse surface direction (U or V), it becomes unlogical. I can see thicker patches of lines moving to the wrong side of the model. (Where the patches are at the inner side on the original, they go on the outer side on the mirror.) When I do Swap in the surface direction menu, it switches as well, Both doesn't do anything. It seems to me the mirror makes more sense without reversing surface direction.
I tried different materials like you suggested, and now finally some progress, because a lambert without bump on the mirrored sculpt gives a NORMAL texture. (I didn't reverse surface direction for these tests after seeing the normals.) A lambert with bump gives the same screwed up 'static' texture as I showed before. A blinn without bump is moderately borked. You see the proper texture, but with slight 'static' as well. Tried blinn with bump again just for the sake of it, but that's completely borked as well of course, like I posted before.
In my render settings the renderer is set to Maya Software at the moment, not mental ray. Can I just set it to mental ray and use my same bake procedure?
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-08-2009 16:09
Just to follow up on this topic: I did a bake with mental ray and had the same problem. I also asked a friend to do a bake on my mirrored sculpt and he encountered the same issue as well. No clue what to do with this now, since the problem's not me and the plain lamberts do work out fine.
I needed the mirror, tweaked, for a two part base for a shoe. I've now resorted to modding the original, not the mirror, and working on the other shoe at the same time. (So both shoes consist of mirrored and non-mirrored sculpts.) I'll mirror the textures in SL as I don't see this problem with Maya resolved anytime soon.
If you still have suggestions, please let me know though. I'd love to fix this issue if I can. And thank you for the help.
|
Pygora Acronym
User
Join date: 20 Feb 2007
Posts: 222
|
02-09-2009 06:51
Try flipping your UVs. Even though we only see a 2D representation there is depth in UV space. Models have XYZ coordinates, and textures have a corresponding UVW. Most 3d applications do not flip the W direction when you mirror geometry or invert surface normals. If you are trying to perform functions that rely on this information it is possible to get strange results if it isn't accurate.
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-09-2009 10:14
I did try this, like Chosen Few suggested as well, but unfortunately it makes no difference. This problem does not occur just on mirrors either, but on duplicates within a scene as well. I should've specified this in the thread title, but I only thought about it afterwards. Another thing is that the normals do look ok, and some materials (lamberts without bump mapping) do bake normally.
Something is going wrong with more complex materials like blinn and phong. A blinn without bump mapping comes out slightly borked as well, with errors in the texture.
|
Pygora Acronym
User
Join date: 20 Feb 2007
Posts: 222
|
02-09-2009 11:23
Ahh sorry, I only saw where Chosen told you to try to change the NURBS surface direction in the U or V direction. I didn't know you had also tried a corresponding texture UV flip as well.
Beyond that, the bump looks like it could be a texture scale issue, but I don't know what to say about your "slightly borked" blinn.
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-09-2009 11:42
From: Pygora Acronym Ahh sorry, I only saw where Chosen told you to try to change the NURBS surface direction in the U or V direction. I didn't know you had also tried a corresponding texture UV flip as well. It's the same thing, Pygora.  The way to reverse normals on a NURBS surface is to reverse the surface direction. You can't edit normals arbitrarily on NURBS like you can on polygons. Anya, as much as I hate to suggest solving a problem by throwing money at it, you might want to give Turtle a try. I've been using it for years for all my bakes, and I've never encountered a problem remotely like the one you're having. http://www.illuminatelabs.com/products/turtle/trialIf Turtle does the trick, then I'd highly recommend buying a copy. It's hands down the best renderer there is for baking, so it's well worth having anyway, if you can afford it. If Turtle doesn't solve the problem, then we can be sure the issue has nothing to do with rendering. It's got to be elsewhere. I can only think of two possibilities, in that case. Either something is something is screwy in your work process, or your Maya installation is bugged. I'd still like to try to replicate your results, myself. What version of Maya are you using?
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Pygora Acronym
User
Join date: 20 Feb 2007
Posts: 222
|
02-09-2009 12:20
From: Chosen Few It's the same thing, Pygora.  The way to reverse normals on a NURBS surface is to reverse the surface direction. You can't edit normals arbitrarily on NURBS like you can on polygons. Right, gotcha. How quickly we forget. Edit: Refresh my memory, does the NURBS surface UVs also override the the Normal Direction in the Texture Bake Set Attributes?
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-09-2009 13:02
From: Chosen Few I'd still like to try to replicate your results, myself. What version of Maya are you using? I'm using Maya 2008. I don't think my install is bugged, as I asked a friend to test the same setup and he also came up with a messed texture. Work process would surprise me as well, since all my other bakes have always turned out fine, and lamberts do work on mirrored sculpts. Since I can kinda work around the problem, I don't think I'll look into new software for now. I'll keep the name in mind though  This troubleshooting has been useful either way. I finally played around with the mental ray renderer a bit and learned to do ambient occlusion, which I really wanted to try. If you'd still like to recreate my process, here's my setup again: one sculpt, mirrored along X axis, surface direction not reversed (since the normals looked fine to me). Lighting to Use All Lights, one directional light on the scene. Try with a lambert and a blinn perhaps, the lambert turns out fine for me, the blinn doesn't. I assign a bake set, and then do a batch bake, file type tga, Bake To One Map, Orthogonal Reflection and Bake Shadows checked.
|
Pygora Acronym
User
Join date: 20 Feb 2007
Posts: 222
|
02-13-2009 10:43
From: Pygora Acronym Right, gotcha. How quickly we forget.
Edit: Refresh my memory, does the NURBS surface UVs also override the the Normal Direction in the Texture Bake Set Attributes? To answer my own question after getting access to a copy of Maya 2009 x64 to test: No, no they don't. Oh, okay. Thanks me. So just checking the surface normals will not always catch if normals are inverted on a node down the line? Nope. This was what I trying to say should be checked, albeit with imprecise terminology ("texture flip"  . There is more than one way to flip a texture direction than just flipping a surface direction. So if you override the normal directions somewhere else (like texture bake sets in Maya) it won't affect display normal directions. That's just showing you SURFACE normal direction. Oh I see what you were getting at now. So it's not the same thing after all. Will this help the OP? I honestly don't know if it has anything to do at all with their issues, but it is good general 3D troubleshooting info to keep in mind. Ah I see. Do you wanna go get a beer? Sounds great! I'll buy the first round.
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-13-2009 12:12
Haha, good post, Pygora. If you're ever in the Buffalo, NY area, or if you attend SLCC this year, I'll go with you for that beer, so you don't have to keep talking to yourself. I don't actually drink beer, but I'm sure I can find something.  Sorry I ignored your question. I didn't mean to. I did see it, but I was so wrapped up in trouble-shooting with the OP, I forgot all about it right after I read it. Anya, here's something that might help you out. I explained your problem to a colleague/friend of mine who teaches Maya at a local university. Here's the procedure he recommends. Give it a whirl, and let me know if it it works for you. I haven't tried it myself yet. 1. Before you mirror your object, delete history from the original, and freeze & reset its transformations. 2. Now create your negative duplicate. 3. Delete history, and freeze & reset transformations on the copy. 4. Reverse the copy's surface direction. 5. In the Attribute Editor, go to the tab for the copu's shape node. Under Render Stats, uncheck Double-Sided and Opposite. Your textures should now bake correctly on the mirrored surface (because technically it's not mirrored anymore).
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
|
02-13-2009 12:29
It might be good to note you don't have to create mirrored sculpts for most things anymore. The viewer now has a Mirror checkbox on the building pane, so that you can make left/right versions of shoes etc from the same map. You can also use the same texture, just flipped as well.
Just beware that holdouts using very old clients won't see these correctly as their viewer won't support the mirror option when rendering.
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-13-2009 12:34
From: Darien Caldwell Just beware that holdouts using very old clients won't see these correctly as their viewer won't support the mirror option when rendering. Yeah, it's unfortunate that LL won't mandate viewers that are capable of displaying the current features. I don't use oblong sculpts or in-world mirroring, for that reason. Also, mirroring in-world assumes symmetry in the texturing. If the baked texture needs to be asymmetrical, due to lighting direction, or for any other reason, then it becomes necessary to mirror the sculpt in the modeling program, whether or not you'll be using the mirroring function in-world.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-14-2009 07:03
From: Darien Caldwell Just beware that holdouts using very old clients won't see these correctly as their viewer won't support the mirror option when rendering. Exactly the reason why I don't use that option (yet)  I also don't use the inside-out feature for that same reason. I'll still correct the sculpt map myself and reupload. I'll try your suggestion Chosen Few  Shoes are coming along nicely meanwhile 
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-14-2009 07:26
From: Chosen Few 1. Before you mirror your object, delete history from the original, and freeze & reset its transformations.
2. Now create your negative duplicate.
3. Delete history, and freeze & reset transformations on the copy.
4. Reverse the copy's surface direction.
5. In the Attribute Editor, go to the tab for the copu's shape node. Under Render Stats, uncheck Double-Sided and Opposite. Woot, that did the trick!  The textures come out normal now, no longer that weird static I used to have. I did notice a small error in the texture still (there's a small lighter area between the lit side of the sculpt and the shadow side, which doesn't look right), but I'll run some more tests. The textures definitely look normal now though. Thanks a ton 
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
02-14-2009 09:48
Yay! I'm so glad to hear that that worked. I knew the solution would turn out to be something simple, but still, it was a bit of a brain teaser. I hate to leave a problem unsolved.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Pygora Acronym
User
Join date: 20 Feb 2007
Posts: 222
|
02-16-2009 18:33
From: Chosen Few Haha, good post, Pygora. If you're ever in the Buffalo, NY area, or if you attend SLCC this year, I'll go with you for that beer, so you don't have to keep talking to yourself. I don't actually drink beer, but I'm sure I can find something.  Ah Hah! So I've found a good way to explain what I'm actually saying. A Q&A session with myself.
|
Anya Yalin
AnnaMayaHouse
Join date: 27 May 2008
Posts: 150
|
02-20-2009 17:02
Finally had some time to do a few more tests, didn't get around to it last weekend. I no longer seem to have that small texture error I noticed before. Just wanted to mention that changing the render stats doesn't seem to be necessary. Clearing history, resetting and freezing transformations and reversing the surface direction on the mirrored sculpt works fine. I now get the expected inside-out effect on the texture as well if I don't change the surface direction. Thanks again to everyone who offered advice 
|