|
created Unity3D Tangent Basis Calculator plugin for xNormal
on 03-02-2012 09:27 AM
Update
It's out and fully synced to Unity's tangent basis now.
Get it here!

Last edited by Farfarer; 01-11-2013 at 11:15 AM..
|
, dedicated polycounter,
1,404 Posts,
Join Date Mar 2007,
Location Leeds (UK)
|
Using objs, I get an 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
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.
|
, polygon,
538 Posts,
Join Date Oct 2004,
Location London
|
Yeah, I get that with certain file formats and normal combinations (eg, FBX from 3DS Max and Average Normals setting).
No idea why, but I think it's an issue with xNormal rather than my plugin.
|
, dedicated polycounter,
1,404 Posts,
Join Date Mar 2007,
Location Leeds (UK)
|
cool stuff - maybe i can give it a try in a few weeks at work, projekt with some normalmapping comming up
|
, triangle,
324 Posts,
Join Date May 2008,
Location berlin
|
Updated the plugin to v0.2.
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
|
, dedicated polycounter,
1,404 Posts,
Join Date Mar 2007,
Location Leeds (UK)
|
cool, I havent used normals in unity much, partly because Im on a mac at work and dont have a way to bake normals on a mac 
|
, veteran polycounter,
3,902 Posts,
Join Date Feb 2007,
Location UK cheltenham
|
Thank you so much for this!
|
, vertex,
34 Posts,
Join Date Dec 2004,
|
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.
|
, line,
52 Posts,
Join Date Apr 2012,
Location Pittsburgh, PA, USA
|
Talon, correct if I'm wrong, but doesn't Unity have the "about" the same tangent basis normals as Maya does?
|
, dedicated polycounter,
1,462 Posts,
Join Date Feb 2006,
Location Redmond WA
|
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.
|
, dedicated polycounter,
1,404 Posts,
Join Date Mar 2007,
Location Leeds (UK)
|
That's fine, but if you actually do it, I could have the use not only for Unity but as well for Maya ;) (if both are the same)
|
, dedicated polycounter,
1,462 Posts,
Join Date Feb 2006,
Location Redmond WA
|
Well, I worked up a Maya tangent basis calculator as well as I could based on the code here: http://download.autodesk.com/us/maya...mber=d0e227193.
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
|
, dedicated polycounter,
1,404 Posts,
Join Date Mar 2007,
Location Leeds (UK)
|
You are right, i did some tests and I could see why they are slightly different, but at least is not as different as Max or Xnormal.
|
, dedicated polycounter,
1,462 Posts,
Join Date Feb 2006,
Location Redmond WA
|
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!
Last edited by seforin; 06-07-2012 at 02:57 PM..
|
, card carrying polycounter,
2,390 Posts,
Join Date May 2006,
Location In the Year 20XX
|
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.
|
, dedicated polycounter,
1,404 Posts,
Join Date Mar 2007,
Location Leeds (UK)
|
TRUE
|
, triangle,
355 Posts,
Join Date Jan 2010,
Location Slovakia
|
Quote:
Originally Posted by Talon
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
http://forum.unity3d.com/threads/962...t-on-my-mesh-s
|
, card carrying polycounter,
2,390 Posts,
Join Date May 2006,
Location In the Year 20XX
|
Nice one Talon!
Haha seforin longest sig ever!
|
, polygon,
538 Posts,
Join Date Oct 2004,
Location London
|
Strange, I've had no issues using FBX exported from 3DSMax or modo.
You're definitely using the latest FBX plugin?
|
, dedicated polycounter,
1,404 Posts,
Join Date Mar 2007,
Location Leeds (UK)
|
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)
|
, card carrying polycounter,
2,390 Posts,
Join Date May 2006,
Location In the Year 20XX
|
Great to hear you've made some more progress, Talon! I eagerly await your next release. Any chance it will work with xNormal 3.17.13 this time around?
|
, line,
52 Posts,
Join Date Apr 2012,
Location Pittsburgh, PA, USA
|
Yep, I've ported it over to the latest version (.13). I'll release it early next week after I've had time to fix up some stuff.
|
, dedicated polycounter,
1,404 Posts,
Join Date Mar 2007,
Location Leeds (UK)
, dedicated polycounter,
1,404 Posts,
Join Date Mar 2007,
Location Leeds (UK)
|
What about the Maya version? 
|
, spline,
242 Posts,
Join Date Oct 2006,
Location France, paris
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Copyright 1998-2012 A. Risch
|