So I baked some normals down on to the barrel of a rifle I'm working on and all the specular highlights are going every which way. I tried with the cage and with an offset, but always the same. If anybody could enlighten me as to why this happens I'd appreciate it greatly.
Replies
export your projection cage in the modifier first so you don't have to set up the cage again before you reset X-forms.
This isn't the first time this has happened to me either. I kind of thought it would be one of those common problems that everybody but me knew how to fix. Guess I lucked out this time and got a genuine pain in the ass bug. I don't know if this would be of any help, but here's a shot of the texture.
This UVW layout is only the barrel that you see above.
I think it's either a problem with the baker or the way it calculates tangent space in the viewport.
Does it look better or different if you render it with the scanline renderer, or even with Mental Ray?
I bet the problems would go away if you baked and previewed it in XNormal (or Maya if you have it available).
I created this shape in a few minutes to see if the same problem would arise and it did. I wonder now if anybody else is able to recreate this issue? Here is the shape I made as a test:
The bottom is the original high poly, the middle is the cage I used, and the top is the final result on the low poly. I don't suppose anybody would be willing to try this in Maya?
EDIT: I tried it in Marmoset and it appeared to be working correctly, but I don't know if that's because it's a problem with Max or because Marmoset's lighting environment is based on skyboxes instead of traditional specular hotspots.
>>IF possible just use it with default settings only applying your normal map on it.. take a snap and then just apply any other normal map of any other object you have.. and see if those surfaces are still having similar highlights or not.
I tried previewing it in the Unreal Engine and it STILL happens, by the way.
-It's not random. They start off correct. Doing Chamfers messes it up (the chamfered part has them going the other way), I think Connects might do it too. Also, Shift-moving edges might be a culprit too. Thing is you just need to go in and fix it.
-You have to fix it BEFORE the bake, since the normalmaps are actually baked for a specific winding, so you need to rebake if you change one.
And ehm, I'm pretty sure when I first had this issue, I also saw the "zig-zagging" of specular in Unreal Engine ?
I did some experimentation and found out how to fix the problem if it's absolutely necessary.
Xoliul, for some reason your shader seems to display the troubled highlights on a group-smoothed low poly object even before applying a normal map. I cooked up an illustration of what I did. Also, extrusion seems to be what causes the nastiness, but I didn't try any other method.
This method also DOES work after the bake. I flipped every other triangle after applying my normal map and the highlights reoriented just fine one by one.
If anybody knows of or finds an alternate method for fixing this problem or knows of a means for preventing it (other than not using Max) please post it here.
My shader displays the specular skewing on an non-normalmapped object yes, because it uses a way more advanced specular calculation than a simple, crappy default material.
And I'm certain that doing this after the bake won't work in all cases. I remember many times, on surfaces more complex than a cylinder (car bodies), things got worse when I flipped the traingulation, and were fixed once I rebaked.
BTW, I think we need a script for this!
My experience comes from importing meshes from modo into max, so i'm not really doing any extruding etc etc in max. I swear i've had to adjust these sort of things after the bake(having not actually changed anything, aside from smoothing groups), but its been a while since i've done it.
Regardless, this is an absolute mess, as apps like maya etc will handle quads and even ngons perfectly without the need to triangulate/mess with "invisible edges". This is just another in a long list of things that are broken in max's normal render.
Ideally you'd just talk to your programmers and get them to make sure the model format you export takes the vertex normals directly from your app
That way you know that whatever you see in your app is the same as what you see in-game. And it also means you don't have to worry about the triangulation because the vertex normals are what matter (and yes, they will change when you triangulate the mesh).
Only issue then is you have to bake normal-maps in your app or through an in-game tool, but this is probably better for pipeline anyway. Adding more apps always makes things more complicated especially when it comes with trying to preserve normals and triangulation.
I have noticed this problem before, didn't know what to do about it, but turning the tris works well, so thank yah.
+1 for script
Either way, I've had this problem and it was a big annoyance, so I'm glad to at least know a workaround.
Thanks Eric, I've been wondering about this issue myself.
If you look close enough you will even spot this issue in UDK. When using modular meshes that use unique normal maps (and use a single smoothing group as a result) I've had issues where specular highlights would not align, even once the normal map was applied. To counter this I've been mirroring every second static mesh, but it was a very tedious task. Nowadays I simply use symmetry before baking and UV mapping to make them tile seamlessly. If anyone encounters shading problems with long, tilable meshes (which have the normals set to soft) then I highly advise you to do the same. Might save you a headache in the long run.
The triangulation of quads in the viewport and in the renderer/baker is the opposite of how the quads get triangulated when you run the Triangulate tool. (You can test it by twisting a cube and then hitting triangulate.)
Which means that if you bake your normal map using your quadded model, it appears to bake and display fine but when you triangulate and export your model, it screws up the normal map subtly as the invisible edges all get turned in the triangulation process, throwing the vertex normals off a little bit.
It's very annoying