Author : jdvi


Reply
Reply
 
Thread Tools Display Modes
Farfarer's Avatar
Old (#1)
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..
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

Frankie's Avatar
Old (#2)
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.
Offline , polygon, 538 Posts, Join Date Oct 2004, Location London  
   Reply With Quote

Farfarer's Avatar
Old (#3)
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.
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

kio's Avatar
Old (#4)
cool stuff - maybe i can give it a try in a few weeks at work, projekt with some normalmapping comming up
Offline , triangle, 324 Posts, Join Date May 2008, Location berlin  
   Reply With Quote

Farfarer's Avatar
Old (#5)
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
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

Ged's Avatar
Old (#6)
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
Offline , veteran polycounter, 3,902 Posts, Join Date Feb 2007, Location UK cheltenham  
   Reply With Quote

gregs's Avatar
Old (#7)
Thank you so much for this!
Offline , vertex, 34 Posts, Join Date Dec 2004,  
   Reply With Quote

Justin DeVore's Avatar
Old (#8)
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.
Offline , line, 52 Posts, Join Date Apr 2012, Location Pittsburgh, PA, USA  
   Reply With Quote

bugo's Avatar
Old (#9)
Talon, correct if I'm wrong, but doesn't Unity have the "about" the same tangent basis normals as Maya does?
Offline , dedicated polycounter, 1,462 Posts, Join Date Feb 2006, Location Redmond WA Send a message via MSN to bugo Send a message via Skype™ to bugo  
   Reply With Quote

Farfarer's Avatar
Old (#10)
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.
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

bugo's Avatar
Old (#11)
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)
Offline , dedicated polycounter, 1,462 Posts, Join Date Feb 2006, Location Redmond WA Send a message via MSN to bugo Send a message via Skype™ to bugo  
   Reply With Quote

Farfarer's Avatar
Old (#12)
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
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

bugo's Avatar
Old (#13)
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.
Offline , dedicated polycounter, 1,462 Posts, Join Date Feb 2006, Location Redmond WA Send a message via MSN to bugo Send a message via Skype™ to bugo  
   Reply With Quote

Farfarer's Avatar
Old (#14)
With the help of the Unity devs, I've managed to get this working right.

Got some final tweaks to make to it to speed it up some more before I release it, though

Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

seforin's Avatar
Old (#15)
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..
*Flips Table*

(╯°□°)╯︵ ┻━┻

=Tech Artist At Moon Spider Studio=

www.moonspiderstudio.com


~Personal Site~
www.seforin.com
Offline , card carrying polycounter, 2,390 Posts, Join Date May 2006, Location In the Year 20XX Send a message via AIM to seforin Send a message via MSN to seforin  
   Reply With Quote

Farfarer's Avatar
Old (#16)
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.
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

cupsster's Avatar
Old (#17)
TRUE
Offline , triangle, 355 Posts, Join Date Jan 2010, Location Slovakia Send a message via Skype™ to cupsster  
   Reply With Quote

seforin's Avatar
Old (#18)
Quote:
Originally Posted by Talon View Post
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
*Flips Table*

(╯°□°)╯︵ ┻━┻

=Tech Artist At Moon Spider Studio=

www.moonspiderstudio.com


~Personal Site~
www.seforin.com
Offline , card carrying polycounter, 2,390 Posts, Join Date May 2006, Location In the Year 20XX Send a message via AIM to seforin Send a message via MSN to seforin  
   Reply With Quote

Frankie's Avatar
Old (#19)
Nice one Talon!

Haha seforin longest sig ever!
Offline , polygon, 538 Posts, Join Date Oct 2004, Location London  
   Reply With Quote

Farfarer's Avatar
Old (#20)
Strange, I've had no issues using FBX exported from 3DSMax or modo.

You're definitely using the latest FBX plugin?
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

seforin's Avatar
Old (#21)
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)
*Flips Table*

(╯°□°)╯︵ ┻━┻

=Tech Artist At Moon Spider Studio=

www.moonspiderstudio.com


~Personal Site~
www.seforin.com
Offline , card carrying polycounter, 2,390 Posts, Join Date May 2006, Location In the Year 20XX Send a message via AIM to seforin Send a message via MSN to seforin  
   Reply With Quote

Justin DeVore's Avatar
Old (#22)
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?
Offline , line, 52 Posts, Join Date Apr 2012, Location Pittsburgh, PA, USA  
   Reply With Quote

Farfarer's Avatar
Old (#23)
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.
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

Farfarer's Avatar
Old (#24)
http://www.farfarer.com/blog/2012/06...lugin-xnormal/
Offline , dedicated polycounter, 1,404 Posts, Join Date Mar 2007, Location Leeds (UK) Send a message via MSN to Farfarer Send a message via Skype™ to Farfarer  
   Reply With Quote

funshark's Avatar
Old (#25)
What about the Maya version?
Offline , spline, 242 Posts, Join Date Oct 2006, Location France, paris  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 1998-2012 A. Risch