I'm using Blender to model the high and low poly as well as Baking normal and AO maps. I haven't baked anything other than planes with details like floating geometry etc. But today I'm trying to bake a normal map out of this high poly crate which isn't working out too well. I've got artifacts all over the place. Those screenshots below will hopefully explain the problem to you. Since I can't figure out why I've got issues like that.
(Reached Limit with Photobucket)
Replies
The cage needs to fully encompass both the Low and High poly models.
first of all, check if your normals are all pointing in the right direction. then, try to explode your mesh. move any parts that are easy to separate from each other away from each other in both the high and low poly. (you will probably divide the mesh along its uv-seams) especially separate the inner and outer shell of your crate. use those exploded meshes for baking.
also make sure that you dont have any duplicated vertices or edges. and, lastly, you might want to optimize your mesh. there are a lot of verts that are not needed. that might not be helpful to your present problem, but it might help you otherwise.
Make sure you haven't accidentally duplicated the whole object. Try Remove Doubles.
Make sure your normals are all pointing the right way.
If you have any mirrored UV's, put them outside the 0-1 box thingy.
Play with the Bias and Distance settings.
Other than that, I would honestly recommend Xnormal for baking your maps. It's just a bit less fiddly.
Here is an example of the Bias setting (please excuse the crappy compression...Photobucket seems to have crunched the jpgs pretty bad)
Also, you will prob. want to explode something like this before baking as Blender doesn't have the same control as a cage. Separate the top and the bottom parts of the box so they are 5 units apart or something and do the same with anything that is not a contiguous mesh. If you still cant get good results, post the .blend or send me a PM and I will be happy to take a look for you.
*edit* Also, It's worth remembering that you cant bake smoothing groups/hard edges in Blender without getting a seam in the normal map, so make sure that you only split the mesh where it is not contiguous geometry.
Things I tried:
-Explode mesh
-Play with Bias settings
-resize the HP or LP models
-Checked for duplicates blender found none, I shouldn't have any faces "inside" the mesh, I don't tend to make that mistake if at all.
As you can see I exploded the model hopefully I did it right? Or must I separate it from the seams?
(Reached Limit with Photobucket)
Also, it looks like you have a Distance value of 0. Now I haven't baked anything in Blender in a long while, but I could've sworn 0 would lead to absolutely no result. Distance is the distance to which rays travel looking for a highpoly before giving up, and bias tells them which surface to pick if they find multiple, the one closest to the bias value. I've got an extremely crummy image here attempting to explain it, if that's of any use. I'd advise you to give Distance a value of .5, Bias .1, overlay the highpoly and lowpoly to occupy the same space, and try again.
(Reached Limit with Photobucket)
Blender sends out a ray outwards from the low poly model with a maximum distance set by distance.
If distance is left at 0 the ray is infinite.
This ray terminates on the first thing it hits so it's more than likely to hit the back of an object and will terminate before it hits floating detail or extra detail on layered object.
Adding a value to bias makes the ray trace inwards starting from this distance away from the surface of the low poly model and will terminate on the first thing it hits, so will be the upper layer of the object, this is usually desired behavior.
If you set bias and leave distance at 0, if nothing is hit within the bias trace it will then send out an infinite forward distance trace so you might get some weird results where you didn't expect anything.
I think the rays actually go in both direction so 1 will send it 1 unit infront and behind the surfaces of the low poly model.
It then does something else I cant work out that could be a bug. (just an example of this bit I cant work out,
distance 0 bias 0 = expected behavior
distance 2 bias 0 = expected behavior
distance 0 bias 2 = expected behavior
distance 2 bias 2 = missing large chunks
distance 4 bias 2 = expected behavior but what I expected from d2 b2
)
Also, I did not know about D0 being infinite, so thanks for that .
Having 0 as infinite makes it feel like bias is separate and that confuses me.
probably
If you have a well set up LP mesh, you should never really need to touch bias or distance, and most of the time I leave them at 0 and 0 and get perfectly good results. It's only in very rare cases (like this) where I have needed to change the bias.
This is most likely to you scaling the mesh in object mode. When ever you do this you need to apply the location/scale/rotation (Ctrl+A in Object mode) so that Blender updates the object to the correct internal scale again.
@Dagon,
I took a look at the .blend and there are quite a few issues that need to be resolved before you even consider baking.
- You have overlapping UV's, which are causing some issues - You always need to offset any overlapping UVs by 1 unit (or any whole number) in order for them to bake correctly. To do this go to the properties panel in the UV/Image Editor (N key) and check Normalised in the Display panel and then select the UVs and move them by -1 unit in Y.
- The low poly need to more closely conform to the HP surface and there are parts where the LP intersects with itself, which is causing issues.
- The LP really needs to be optimised a more. On some parts, like the hinges for example, the extrusions are so close together that they are causing major overdraw and ray casting issues. You would get a much better result if you just used a scaled cube for these parts. You could probably get away with a 2 quads or baking it onto the back of the main body)
- The hinges are really high poly. Currently they are 84 tris per hinge, which is over 30% of the geo cost for the entire mesh.
- The details on the front and back really dont need their own geometry and could be baked perfectly onto the front/back of the crate. Let the normal map do the work
- Your UVs are massively out of proportion with each other in some places. The hinges have almost the same UV space as the 4 sides of the crate. Turn on "Stretch" in the Properties panel and you will see what I mean. Everything should be blue, or as close to blue as possible.
- The LP is all right angles, which will make it harder to capture the details nicely. Add some bevels and you will get a much nicer bake.
Having said that, I did manage to get a reasonable result with what you have by scaling the meshes up by 20, exploding the parts, offsetting the UVs and setting the bias to .5. It is not perfect however and with the current geo (the hinges etc.) it would be extremely hard and time consuming to get a decent bake in Blender, simply because the Bias/Offset are not versatile enough for situations like this. You would be much better taking the whole thing into xNormal and baking there. It is due to this restrictiveness that I really don't bake a ton of stuff in Blender any more.I would sincerely suggest that you take another look at the LP mesh and see what you can do to improve it. Most of the time fixing the LP is a much better solution than fighting with bake issues. Its often faster too
There are only a few cases where this would work out ok. Anything even slightly complicated would break down and need the bias setting. Actually I can't even see why bias is needed and isn't on all the time.
Also deleting faces that are hidden on the HP like on the "plates" I deleted the faces that are clipping inside the crate. Doing it for the LP as well.
I'm currently downloading Xnormal to use that for baking normals from now on.
I could be wrong and that is fine, but I don't really know what to tell you. In my experience with baking in Blender, I rarely need to touch the bias or distance settings. The only time I use Bias is if I'm baking floating geo.
It could be that I explode as much as a can to reduce errors or that I bake parts as separate objects that I know will give me issues, but I honestly don't use them much. Most of the time, if I get baking errors (in Blender or xNormal) I tend to change the LP geo to fix them, rather than fighting with the baking tools.
I just baked Eat3d's NGT scene in Blender with a setting of 0 for both the Bias and Distance.
The actual normal maps sometimes look a little messy, but for the most part it doesn't show on the model because its either covered by the actual geo that the error is picking up or it's due to an intersection that isn't actually seen on the mesh.
But generally Blender is a really poor solution for baking anyway (no AA, no cage, slow bakes etc.), which I why I moved over to xNormal almost exclusively.
No worries
If you need to learn how xNormal works, I made a tut a while back that goes over the interface etc.
http://eat3d.com/free/xnormal_overview
My point is just most of the time, high poly models will have floating details or layers of detail.
Cheers! I didn't make the model or diffuse/spec textures though. Its from an Eat3d tutorial and I used it because I had it to hand and it's a reasonably complicated model to bake.
Yea, xNormal is an awesome application and produces really high quality bakes, though it can take a while to get used to the interface and work flow.
You can export a custom cage from Blender, rather than using the in build cage in xN, which is what I do 99% of the time.
For the cage, I use this method.
(If you are not using hard edges/smoothing groups ignore the edge split steps)
- Make a duplicate of your LP mesh (without the Edge Split modifier applied)
- Add a solidify modifier to it and move it above the edge split modifier in the stack.
- Uncheck "Fill Rim" and check "Even Thickness" and "High Quality Normals"
- Change the "Thickness" into a minus number, so that it covers your HP mesh entirely
- Apply the Solidify modifier
- Go into Edit mode and select one of the faces of the outer most mesh
- Hit CTRL+L to select linked
- Invert the selection and delete the inner mesh
- Go back into Object mode and apply the Edge split modifier
- Export the mesh with UV's and Normals
- Done!
That should export a perfect cage mesh, with all the smoothing groups intact.Yea, I know what you mean and it sometimes can be problematic in Blender. If they fixed the baking tools, it would be much easier and less time consuming.
I was really hoping that Cages would get included in this years GSoC but it didnt happen
As you can see both the Normal and AO maps have artifacts. I'll try and model another crate/box and see if I get a better result with Xnormal. I didn't use Cage to bake the normals, The video did explain how to use it but I didn't understand it, But watching it again may solve that.
I must say the result is definitely a lot cleaner than Blender's but it is missing some detail, Like the screws on the hinges aren't there.
(Reached Limit with Photobucket)
I can bake planes pretty fine though, I put the junk on it for obvious reasons, I baked this one below in Blender.
(Reached Limit with Photobucket)
Also you should remember that the cage needs to entirely cover all the HP parts that you want to bake from. If the cage isnt covering the screws it wont pick them up.
Try making a cage using the steps I mentioned in my last post and see how it works out for you
I really wouldnt advise swapping xNormal for Blender. Blender is vastly inferior in almost every way and I really dont see cages being added to it any time soon. I would stick with xNormal if I were you
Blender uses the same tangent space as xNormal and neither are synced to UDK, but they both seem to be a good match to Marmoset.
I tend to use a custom cage in xNormal because of the reliable and predictable way in which it behaves. 99% of the time it gives me a perfect bake and for the 2 minutes or so it takes to set up it saves me a ton of time in the long run.
One of the other reasons is the way in which Blender handles smoothing groups. You have to mark the edges as sharp and then apply an Edge Split modifier, which breaks the geometry at those edges, which makes it impossible to use the inbuilt cage feature in xNormal because as you expand the cage you get gaps in the geometry which cause issues.
It's the best way I found to get a decent bake
Any way I decided to try and make a box in a rather unique way. I modelled a HP plane with a little bit of floating geometry. I then baked the Normal and Ambient Occlusion map in Xnormal (I love you!) and it came out great in my opinion. I then created a diffuse from the Normal Map. And from that I created 2 specular maps. The first one the grey metal came out good, But the grid wasn't that shiny. So I tried again and it came out nicely, I tried an emission (Glow map) to be used in UDK but it didn't come out too good, At least in blender's render engine it looks ok but not that efficient.
@Snader: Thanks for the headsup, I haven't spent too much time on Polycount so I haven't really explored all the areas. Sorry if this was the wrong section to post this sort of topic! Won't do that again Looks like I reached my limit on Photobucket so all my images from there aren't showing any more