Hi, Talon - The latest version of xNormal(3.17.13) doesn't seem to recognize the plugin (it doesn't show up anywhere in settings). I tried it on an older version (3.17.9) and it did find it successfully.
Might do, I'd have to look into how Maya calculates it to be sure. I managed to get it pretty close, but I don't really want to release another version until I've properly worked it out. Seems kinda pointless otherwise.
I've had to shelf this for the time being as I've got other stuff with tight deadlines but I'll be back on it in a couple of weeks.
Im tackling this EXACT issue right now but unfortantely Im working on the max side of things...
I have been trying to figure out ways to have it import my mesh without horrible seam screw ups etc and not pre calculating my tangents (Seriously unity wtf man)
I dont suppose you can toss up examples of what you did so I can maybe squeeze that into a max script eventually?
We can talk in pms if you dont wanna clutter this chat.
edit:I also tried chaning up the way the Nmap bakes to keep it Y positive so that unity wouldnt need a flipped Y channel to see if that fixes it , but it still gives me weirdness going on.
Example of what I mean
as you can see on the left side of that box Im having a harsh seam line there as if it has a smoothing group split, but lord and behold everything (but the bottom) has smoothing group 1 assigend to it and smoothing group 2 on the bottom.
And every time I import a .max file or .fbx it keeps setting tangents to "calculate" vs import...seriously I want to smack unity right now this is really hindering progress of the current project I am on!
Well, you won't be able to fix this with Maxscript or on the Max side easily.
Importing .FBX files, you have to export them with normals, tangents and binormals otherwise Unity'll generate it's own. You can fairly write an Editor script to set models to always import tangents on import, too.
Also, Unity doesn't import the binormal that's in the FBX file, it only uses it to figure out whether to flip the binormal that's generated in the shader.
Importing .max files, Unity just fires up Max in the background and gets it to export an FBX file for it to import.
Well, you won't be able to fix this with Maxscript or on the Max side easily.
Importing .FBX files, you have to export them with normals, tangents and binormals otherwise Unity'll generate it's own. You can fairly write an Editor script to set models to always import tangents on import, too.
Also, Unity doesn't import the binormal that's in the FBX file, it only uses it to figure out whether to flip the binormal that's generated in the shader.
Importing .max files, Unity just fires up Max in the background and gets it to export an FBX file for it to import.
yeah but even still it disables them upon import...the only solution I have read for it to read proper is that your meshes need to be set on "editable mesh" vs poly (Which I find kinda BS and thats a FBX issue on autodesks side that I believe there not addressing)
theres a ton of info on this in this thread and a bit of the reason why im going buggy
yea after reading some more into this I found some weirdness and solutions to it.
the major being that for some reason when you have your project set to defered lighting, and shader model 2 and you export lets just say a box 2 smoothing groups and a normal map etc baked, and you export that as a FBX when it imports it in and applies it, the model comes out messed up and it gets bad lighting information etc.
After trying a few tricks...in the end (more by accident then anything else)setting your model as "editable mesh" vs editable poly adn exporting out as a FBX and it works fine.
This is infact using max 2012 and its newer FBX settings, and its not just pc dependant I have done tests both at my home pc and work.
its quite strange...but luckly that whole thread you made with the unity coder messaging you on there forums helped me out alot since they droped there info on how they are handling there tangents and such....so my coder friend is thinking of just writing his own importer/exporter for unity and max.
Gonna Call it Derp format (Doing Everything Right Project)
Yes it is, but with very high res meshes, you have to deal with Xnormal at the end. and Xnormal produces better AO andplenty of different useful maps you know
To be true if you are using the advantage package of 2012 and 2013 you got Turtle, best/fastest baker of nmaps and AO ever! (believe me, I tried all of 'em)
Hey Talon. Thx so much for the great plugin! I have seen it work for a coworker, but I am still getting the memory error mentioned very early in this thread when using the 32bit version of the newest Xnormal. I am not using Average Normals or FBXs. Both high and low res meshes are objs: high exported from Zbrush, and low exported from Maya. Thanks for any help!
Thx for the quick reply. I tested both high and low res meshes with Average Normals, then just the low res mesh with it on. Neither option works unfortunately. The low res mesh obj was exported from Maya with Smoothing and Normals turned on as well. Thx again for any further info!
Big thanks for creating this wonderful little plugin!!! I made a test example to prove it works. The example is a simple window baked on a very low poly mesh with very soft normals. I made it into two smoothing groups to not stress the normals too much. But I am very happy about the result. Cheers!
Thanks for the idea Talon. Fbx files do seem to work for the low poly with a cage exported from Maya loaded into Xnormal, with one smoothing group on the low poly mesh. If I follow your steps within Unity for the model (setting Tangents to Calculate and the Smoothing Angle to 180), it seems to work overall.
Myself and a coworker also tried the 2 cage types that Xnormal can create, SBM and OVB. Both of these throw the memory read error with the Unity plugin. So I guess it's FBX all the way! Thanks again!
Ehr, I might do. Right now, I don't actually know how.
Making this has been the first time I've ever written C++ or used Visual C++... it's all totally foreign to me. I know next to nothing about proper programming.
Sorry this took so long, the Visual Studio project ended up with wrong settings somehow having set it up in 2008 rather than Enterprise but I finally sorted it out (it's all complete jargon to me).
Also discovered the versions I'd released previously were still in unoptimised debug mode, so hopefully this'll be a little faster now, too.
I was wondering if the Unity guys ever released their tangent basis that they use or is what you have a super close "guess" that looks ok 99% of the time.
-edit-
Actually... never mind, just checked out your blog post where it says the unity guys released the source code.
Replies
when swapping to your tangent calculator.
I also get it when using the mikk-tshape caluclator with fbx and haven't been able to fix that so could be something up with my system...
Nice work trying to fix it though, a bit disappointing how unity haven't bothered to sort it out or help you on the unity community forum.
No idea why, but I think it's an issue with xNormal rather than my plugin.
Implemented a more robust unique vertex identifier method (some folk reported issues due to it assigning the same ID to two different unique verts).
http://www.farfarer.com/temp/UnityTSpace.zip
I've had to shelf this for the time being as I've got other stuff with tight deadlines but I'll be back on it in a couple of weeks.
It seems to give vastly different results to Unity's method, so I suspect it's not using that.
The fact it's so different makes me suspect I'm doing something wrong, but I haven't got access to Maya at the moment to test that suspicion.
I'll fiddle some more but I wouldn't hold your breath :P
Got some final tweaks to make to it to speed it up some more before I release it, though
I have been trying to figure out ways to have it import my mesh without horrible seam screw ups etc and not pre calculating my tangents (Seriously unity wtf man)
I dont suppose you can toss up examples of what you did so I can maybe squeeze that into a max script eventually?
We can talk in pms if you dont wanna clutter this chat.
edit:I also tried chaning up the way the Nmap bakes to keep it Y positive so that unity wouldnt need a flipped Y channel to see if that fixes it , but it still gives me weirdness going on.
Example of what I mean
as you can see on the left side of that box Im having a harsh seam line there as if it has a smoothing group split, but lord and behold everything (but the bottom) has smoothing group 1 assigend to it and smoothing group 2 on the bottom.
And every time I import a .max file or .fbx it keeps setting tangents to "calculate" vs import...seriously I want to smack unity right now this is really hindering progress of the current project I am on!
Importing .FBX files, you have to export them with normals, tangents and binormals otherwise Unity'll generate it's own. You can fairly write an Editor script to set models to always import tangents on import, too.
Also, Unity doesn't import the binormal that's in the FBX file, it only uses it to figure out whether to flip the binormal that's generated in the shader.
Importing .max files, Unity just fires up Max in the background and gets it to export an FBX file for it to import.
yeah but even still it disables them upon import...the only solution I have read for it to read proper is that your meshes need to be set on "editable mesh" vs poly (Which I find kinda BS and thats a FBX issue on autodesks side that I believe there not addressing)
theres a ton of info on this in this thread and a bit of the reason why im going buggy
http://forum.unity3d.com/threads/96239-seams-apparent-in-Unity-when-I-put-on-my-mesh-s
Haha seforin longest sig ever!
You're definitely using the latest FBX plugin?
the major being that for some reason when you have your project set to defered lighting, and shader model 2 and you export lets just say a box 2 smoothing groups and a normal map etc baked, and you export that as a FBX when it imports it in and applies it, the model comes out messed up and it gets bad lighting information etc.
After trying a few tricks...in the end (more by accident then anything else)setting your model as "editable mesh" vs editable poly adn exporting out as a FBX and it works fine.
This is infact using max 2012 and its newer FBX settings, and its not just pc dependant I have done tests both at my home pc and work.
its quite strange...but luckly that whole thread you made with the unity coder messaging you on there forums helped me out alot since they droped there info on how they are handling there tangents and such....so my coder friend is thinking of just writing his own importer/exporter for unity and max.
Gonna Call it Derp format (Doing Everything Right Project)
http://www.farfarer.com/blog/2012/06/12/unity3d-tangent-basis-plugin-xnormal/
nice one :thumbup:
I've got a check in for that in my local build of the plugin, but I'll have to do a bit of testing before I release it.
For the time being, if you select Average Normals, does the issue go away?
Here's how to work around it until I get a proper fix in;
/Jenz
Myself and a coworker also tried the 2 cage types that Xnormal can create, SBM and OVB. Both of these throw the memory read error with the Unity plugin. So I guess it's FBX all the way! Thanks again!
Making this has been the first time I've ever written C++ or used Visual C++... it's all totally foreign to me. I know next to nothing about proper programming.
I'll see if I can figure it out.
I'll keep you posted
http://www.farfarer.com/blog/2012/06/12/unity3d-tangent-basis-plugin-xnormal/
Also discovered the versions I'd released previously were still in unoptimised debug mode, so hopefully this'll be a little faster now, too.
http://www.farfarer.com/blog/2012/06/12/unity3d-tangent-basis-plugin-xnormal/
This is awesome, thanks for this. =]
I was wondering if the Unity guys ever released their tangent basis that they use or is what you have a super close "guess" that looks ok 99% of the time.
-edit-
Actually... never mind, just checked out your blog post where it says the unity guys released the source code.
Check it out here if you're interested
https://gist.github.com/2843984