PDA

View Full Version : UV's and Displacements.......


reiterman0613
07-10-2009, 06:17 AM
Hey guys its me again. Now that I have my displacement issue fixed. The new problem is that everything looks bigger on my maya file than my mudbox file. I have these rivets, and they look huge. I have it on my blog. But what I was wondering.....is there some secret about UV's and unwrapping a model that would help out with my displacement issue, because that is where I think the problem is at. If anyone can help me out with this, I will owe you my soul.

-Rob-

http://reitermanr.blogspot.com/

Wayne
07-10-2009, 09:36 AM
Are you using 32 bit and re-scaled uyour mesh before adding your disp map? Looks very similar to that...changing scale always causes issues if you use default values as the displacement for 32 bit is baked to scale.

Wayne...

RobinB
07-10-2009, 11:11 AM
I don't think it's the UVs. They look fine. But you can see that the rivets are already wrong in the displacement map so it's happening at the stage of baking the map.

I would also guess that it's a scaling issue, but probably not when the displacement is applied in Maya since the map is already wrong, but instead a scaling issue in Mudbox. Did you scale the model up in Mud? If so, try exporting both high and low res models to OBJ, then load them both back into a new scene and then try baking the map between them.

reiterman0613
07-10-2009, 05:57 PM
I didn't scale anything. As matter fact, I locked the properties in Maya. I am going to try to use the lowRes OBJ back in Maya. IF that doesn't work I will try the other idea, using the two models and doing the displacement between them. But that is another issue....I shouldn't have to do that, I just don't understand how I am having such a hard time on this simple model. I have done complex characters and never had this much trouble. Thanks for the input everyone. I will keep everything posted.

-Rob-

http://reitermanr.blogspot.com/

reiterman0613
07-14-2009, 09:01 PM
I have redone the UV's in Maya. I used their methods instead of using UV layout. I am still getting the same issue. The file looks blown up in maya, some of the displacement looks cutoff. Now my next question is this. I made the map in mudbox 2048 x 2048. In maya is there a way to set the uv as the same size. I wonder if it is so big because the sizes are different. I have the image on my blog. Thanks.

-Rob-

http://reitermanr.blogspot.com/

RobinB
07-15-2009, 10:39 AM
There's not really any such thing as texture resolution as far as UV space is concerned. The values are in floating point numbers. 0-1 and onwards across the texture space. Therefore it makes no difference what the texture size is. A value that's 0.5 across UV space will be half way across a texture of any size.

As I said before I don't think it's anything to do with the UVs so I don't think redoing them would have made any difference. The problem lies elsewhere. But at least that's one thing to rule out. It still looks like a scaling issue to me. Are you sure you didn't scale the model in Mudbox? Check the transform properties of both the low res and high res models (if they're different). Check them in Maya too.

Lets have a few details about how you generated the maps? They're done in Mudbox right? What format are they? 32bit floats? 16 bit? 8bit? Which projection type are you using? Furthest hit, nearest hit, or closest fit (excuse me forgetting exactly what they're called, I don't have mud with me). What's the search distance? If you have overlapping geometry and you're using farthest hit, then surfaces inside the model could be having the outer surfaces written into the displacement map.

Have you tried what I suggested earlier of exporting both the lowest level and highest level of the object to seperate .obj files and loading them both into a new scene and trying to generate the maps between them? This is a way of removing scales that have been applied in Mud. No you shouldn't have to, but something is going wrong and this is part of the error trapping.

Are you actually applying the generated displacement map on the same object as the low res model used to generate it?

Have you tried generating the displacement map with a different program like Maya?

Have you tried to displace the mesh in Mudbox using the generated map? To do that export the lowest level mesh to an obj. Then import it to a new scene. Subdivide it enough so that you'll see the details. Then do a mesh displacement on it and load in the generated map. The results should look similar to the bad render in Maya.

Hopefully some of that information should help us to work out what's going on.

reiterman0613
07-16-2009, 06:53 AM
Alright....here we go. I checked the properties in Mudbox and the scale is 1 1 1 . In Maya it is the same. So....I am pretty sure that is correct. Now for the other properties. Search distance is 1, its set to closest to target model....2048x2048....and the map is openEXR, 32 bit floating point, RGBA. So, I don't know if there is a problem in there or if it is in Maya when I am setting up the shader.

-Rob-

RobinB
07-16-2009, 09:18 AM
OK, that all sounds ok.

The thing that concerns me is that the displacement map looks wrong (the bloated bolts and them being cut off) That means the problem is most likely happening when the map is being generated in Mudbox, not when your're using it in Maya.

You can check that by displacing the actual model in Mud or displacing a plane with this generated map.

The normals are OK right so we're not looking at the insides of the model being rendered into the map.

How big is the model compared to the Mudbox default models? Say the base human? The search distance of 1 sounds kind of small. Mine are typically 10 or more yet the map isn't being clipped is it? So that suggests the model is pretty small. I don't think that should cause any problems though.

I'd try generating the map in Maya. That way you can try turning on the projection cage and see where the rays are being fired. It could simply be that the hard edges of the model are distorting where the rays go which might explain the cut off bolts, but I'm not sure that would explain the bloating.

reiterman0613
07-17-2009, 06:11 AM
I redid the map with different search distances...it started off with .64, then I went to 1, 5, and 10....still the same. I then used a plane in Mudbox and displaced the map onto it. I had to zoom in real close in order to see anything...and the bolts were large and flattened out. The normals are facing out...so that is fine. Now, you said to generate the map in maya and turn on the cage to see how the rays are firing....how do I do that exactly.....

RobinB
07-17-2009, 10:43 AM
Just FYI you can crank the opacity of layers up beyond 100 to see subtler details more clearly when you applied the map to the plane.

All sounds ok, but if the results are the same it does seem like it's the map generation that's causing it.

As for how to do it in Maya, well I'm afraid I can't help much there. I don't have access to it any more (used it a little years ago). Is there a Transfer Maps tool? Or one called something similar? In Max it would be Render To Texture. These tools do the same thing as Mudbox's generate map tools. In the case of Max and I'm pretty sure Maya too, you can turn on a projection cage which you can manipulate (it's a pushed out version of the low res model). Then at least you can see how far and in which directions the rays are being fired. The trick is normally to make sure this shape conforms to the high res object as closely as possible.

In Max and with sharp edged objects like yours I know the corners can get distorted because the rays are being fired at an angle. It can help in these cases to harden the normals. This breaks the projection on the corners and fires the rays straight out instead.

Scroll down here to the camera image for an example-

http://wiki.polycount.net/Normal_Map

This might be what's happening with your displacement map.

reiterman0613
07-18-2009, 06:06 AM
I'm such an idiot. All I had to do was turn off smooth target model...now everything is fine. The only other problem that I have is the detail of the model isn't fully coming out. When I compare the two models....the map in maya doesn't have as much detail as the model in mudbox......is that just a fine tuning thing that I need to do in Maya.?

reiterman0613
07-20-2009, 12:47 AM
I have a new problem. The render would get about half way then it would stop and the outlook window would say that the mental ray memory was out. I looked at some threads to fix the issue but I am still having problems with it. It now crashes everytime I try to render it. The original file is less than 2000 polys....my iteration in Maya is 6....that is going to put me near the mudbox file which is 8.3 million polys. I have a duo core 1.83GHz t5550 processor....4g of ram windows vista 64 bit......I read that the way I set up the render depends on my computer specs. I didn't have this problem when I got the materials setup in maya....but since I got the displacement done; now it wants to fail.

-Rob-