Xycaleth Posted February 25, 2017 Share Posted February 25, 2017 @@Xycaleth - thanks for the clarification. But my question remains... what is the point of storing tangent basis vectors in a GLM mesh file-- if the GLM mesh file itself is not used for the normal map baking process?If the normal map is baked using FBX, OBJ, XSI... isn't it those formats where it's desirable to compute or store the tangent basis vectors? Then those FBX, XSI, etc. tangent basis vectors would need to be carried over and written into the GLM mesh (and not computed from GLM directly), or am I misunderstanding? The tangent vectors are also used by the renderer when rendering a model with normal maps so ideally it needs the same tangent vectors that were used when generating the normal maps. From reading the posts so far, FBX/XSI already store the tangent vectors (I don't know if it's the same ones used for creating the normal map?) so it's a matter of copying these tangents into the GLM file. Link to comment
Archangel35757 Posted February 25, 2017 Share Posted February 25, 2017 @@Xycaleth - Thank you, so my understanding is correct... and this supplementary tangent data could be readily stored in a separate file format as I suggested much earlier in this discussion. Yes, FBX stores them (as @@Almightygir originally pointed out) and so does XSI 6.x. But I don't know if xNormal supports XSI 6.x format (I doubt it)-- it may be only the more commonly supported XSI 3.x format. I've never used xNormal-- is there a built-in method to have xNormal store or write out its computed tangent basis vectors for an imported mesh? Link to comment
Psyk0Sith Posted February 25, 2017 Share Posted February 25, 2017 Fun fact. The stock version of Xnormal (3.19.2.41085) doesn't ship with an actual XSI importer, anyone got a download link? because i sure as hell won't attempt to code one myself! Archangel35757 likes this Link to comment
Archangel35757 Posted February 25, 2017 Share Posted February 25, 2017 Fun fact. The stock version of Xnormal (3.19.2.41085) doesn't ship with an actual XSI importer, anyone got a download link? because i sure as hell won't attempt to code one myself! Yes, I stated this earlier in the discussion. I did a deep-dive into the Wayback Machine... and I found xNormal v3.17.16 and its SDK. I have submitted it to the Utilities section for a permanent home (it's still awaiting approval)... but you can grab it from this link in the short term: http://ge.tt/8LfJ2zi2 Make sure you do a dotXSI "ExportSelected" and omit all the bolts and Stupidtriangle_off... because it will complain about meshes without textures. I've also written to Santiago and asked if he'd add back support for the dotXSI file format-- no response yet. Psyk0Sith likes this Link to comment
Psyk0Sith Posted February 25, 2017 Share Posted February 25, 2017 I'm confused, why isnt it just a plugin DL of a few MB. I already have Xnormal installed and the latest SDK is also available here I probably have old Xnormal versions archived somewhere but installing them won't solve the lack of XSI support. I've never used xNormal-- is there a built-in method to have xNormal store or write out its computed tangent basis vectors for an imported mesh? I don't see any options to do that. When you click the mikk tspace plugin the only option you have is to "compute binormal in the pixel shader" Note: You may need to check it depending on your target engine. Link to comment
Archangel35757 Posted February 25, 2017 Share Posted February 25, 2017 @@Psyk0Sith - xNormal 3.17.16 supports dotXSI format. Later versions removed dotXSI support and also removed all x86 DLLs and plugins. The SDK installer is included in the zip archive but it's only ~3Mb. The installer exe is what is large. The 3.19.2 (64-bit only) installer is ~64Mb... 3.17.16 x86/x64 installer is 155Mb. Link to comment
minilogoguy18 Posted February 25, 2017 Share Posted February 25, 2017 @@Archangel35757, I did a test export, tangent and binormal data was preserved in dotXSI 3.5 (which later version of carcass supports) but in the older 3.0 format (which you for some odd reason you wanted to keep supporting it) does not. So, dotXSI 3.5 is a go, 3.0 needs to just go away. The only hurdle now is to just get some sort of tangent support for GLM and @@Almightygir had a good solution to just allow the renderer to just ignore warnings and load GLM files with no tangent data since that would keep us from needing a separate file but keep backwards compatibility. I must also have an older xNormal since I do have dotXSI support. Version is 3.17.13.38574. Hopefully there aren't any good features we're missing out on. Link to comment
Almightygir Posted February 25, 2017 Share Posted February 25, 2017 I'm confused, why isnt it just a plugin DL of a few MB. I already have Xnormal installed and the latest SDK is also available here I probably have old Xnormal versions archived somewhere but installing them won't solve the lack of XSI support. I don't see any options to do that. When you click the mikk tspace plugin the only option you have is to "compute binormal in the pixel shader" Note: You may need to check it depending on your target engine. You should check that option if you are using stored mesh tangents and binormals (which is what you should be aiming to do). Otherwise it will generate arbitrary tangents and binormals for the mesh and pass those through to the pixel shader. By checking that option it's telling the pixel shader to use the tangents and binormals per mesh vertex. Yes, I stated this earlier in the discussion. I did a deep-dive into the Wayback Machine... and I found xNormal v3.17.16 and its SDK. I have submitted it to the Utilities section for a permanent home (it's still awaiting approval)... but you can grab it from this link in the short term: http://ge.tt/8LfJ2zi2 Make sure you do a dotXSI "ExportSelected" and omit all the bolts and Stupidtriangle_off... because it will complain about meshes without textures. I've also written to Santiago and asked if he'd add back support for the dotXSI file format-- no response yet. xNormal doesn't export tangents. it exports a tangent space map, which was rendered using tangents either stored in the mesh, or generated arbitrarily by xNormal. This is why it's important to have a synced workflow. If the baker is using arbitrary values when baking the tangent space map, the renderer will never look right. Link to comment
Archangel35757 Posted February 25, 2017 Share Posted February 25, 2017 (edited) @@minilogoguy18 - I doubt Carcass would use the tangent data stored as COLORs. Since normal maps were not originally supported. Carcass might even fail with the extra data in there... because they wrote their own custom XSI parser and did not use the XSIFTK. Did you do a Carcass compile to see? Please email me your dotXSI 3.0 & 3.5 test files. Because Softimage does have a feature to compute tangent basis vectors... it can write that data to the XSI file. Not sure if 3dsMax has a similar feature for mesh objects-- @@Psyk0Sith? It may be something I would have to add in the dotXSI exporter code. If I have to update the dotXSI exporters I would leave 3.0 alone and simply add radio buttons to choose between 3.0 and 3.5 formats. @@Psyk0Sith - would you export a dotXSI 3.0 file and let me compare that to mini's results? Assuming you have diffuse, AO, and Normal map applied?@@Almightygir, yes... but we have the 3.17.16 SDK. So maybe it is a trivial matter for an experienced coder like yourself to add a feature that would allow xNormal to also write out the tangent basis vectors (it calculated from mikktspace algorithms) for an imported mesh to a *.TAN file (my extension suggestion) or your suggested *.GTB extension. In my little mind, this would be the cleanest solution since it would not require updating any exporters or tools and would work for any supplied mesh format... no?@@minilogoguy18 - I believe the consensus is to put the tangents in a supplementary file (if this is even necessary-- would still like to see dotXSI/xNormal-->Carcass-->GLM results) and not dick with the GLM format (it doesn't need to be in there anyway since it's not computed from the GLM mesh). Edited February 25, 2017 by Archangel35757 Link to comment
Archangel35757 Posted February 25, 2017 Share Posted February 25, 2017 (edited) @@minilogoguy18 - xNormal's dotXSI 3.5 support may not even use the tangent data stored in the dotXSI file and instead just computes it from the mesh face's normal and UV data. Did you see explicit options to read the tangent data from the dotXSI file in xNormal? Also, I edited my previous post to you above so please re-read it. Edited February 25, 2017 by Archangel35757 Link to comment
Almightygir Posted February 25, 2017 Share Posted February 25, 2017 @@minilogoguy18 - I doubt Carcass would use the tangent data stored as COLORs. Just want to quickly point out that normals, tangents, binormals etc. are all just vectors. and colours in terms of rendering, are also stored as vectors. therefor you can visualize any channel by outputting that vector into a color channel. Archangel35757 likes this Link to comment
Archangel35757 Posted February 25, 2017 Share Posted February 25, 2017 @@Almightygir - that's pretty cool... but my point was that Raven (Gil Gribb) wrote their own custom XSI parser... and it most likely wouldn't know how to handle that chunk of data... or know to use it for tangent space-- since they didn't support normal mapping originally. I'll look behind the curtain. Link to comment
minilogoguy18 Posted February 25, 2017 Share Posted February 25, 2017 The file I exported wasn't a game ready model, just a random mesh that I applied custom parameter sets to but it preserved the data when re-importing. You'd have to give me some time to try what you want, it'd probably be better if I had a model that was ready to go into game but I don't. One thing I do know is that Softimage applies tangent and binormal data using custom parameter sets. I'm pretty certain that the carcass compiler does recognize custom parameter sets as they can be used to define shaders for a specific mesh (see here) so that at least gives us something but as far as knowing what to do with that data that's another story. If someone here either wants to give me a model to export I can send you that or if anyone just happens to have Softimage installed they can export something for you. While I have the AT-ST I don't have maps to make a proper PBR shader with. @@AshuraDX only gave me diffuse, normal and spec. He plans at some point to redo the AT-ST so that it's set up for PBR but for now it's only set up for the older MP rend2 with just standard normal mapping. That model probably wont be ready until a proper high poly mesh to bake from is made. Link to comment
Tempust85 Posted February 26, 2017 Author Share Posted February 26, 2017 I'm all for the .GTB file idea. Absolutely no dicking around with the ghoul2 format. If one doesn't exist, just do what the renderer does now to calculate tangents. I suggest they are generated from carcass, allowing both 3ds Max & XSI to take advantage of it. This would mean that the current XSI exporters for 3ds Max will need to be bumped to 3.5 to export out the tangents, like XSI can already do. Carcass does support 3.5 dotXSI reading, but it doesn't read tangents. Like Archangel said, they use their own dotXSI parser. Carcass itself still needs to support 3.0 though, alot of the source animations are in 3.0 format. Link to comment
Archangel35757 Posted February 26, 2017 Share Posted February 26, 2017 (edited) I'm all for the .GTB file idea. Absolutely no dicking around with the ghoul2 format. If one doesn't exist, just do what the renderer does now to calculate tangents. I suggest they are generated from carcass, allowing both 3ds Max & XSI to take advantage of it. This would mean that the current XSI exporters for 3ds Max will need to be bumped to 3.5 to export out the tangents, like XSI can already do. Carcass does support 3.5 dotXSI reading, but it doesn't read tangents. Like Archangel said, they use their own dotXSI parser. Carcass itself still needs to support 3.0 though, alot of the source animations are in 3.0 format. From my understanding of what @@Almightygir and @@Xycaleth were saying... the tool that actually computes the tangent basis vectors (by the way... I vote for *.TBV [Tangent Basis Vectors] file extension) that are used to create the normal map, should be the tool that writes out those tangent basis vectors to the *.GTB or *.TBV file... but not everyone will use xNormal, right? Then again, not everybody uses Carcass either ( hello, Blender people ). Are we going to force a specific pipeline on the community? Furthermore, Carcass doesn't support the FBX file format... so how will folks who bake their maps using .FBX and some other tool (Allegorithmic, etc.) get their tangent basis vectors used for baking into the final .GLM file? @@Xycaleth did create an FBX to GLM converter (with no animation support)... I guess updating that is one option-- and still use Carcass for compiling the GLA. We are also assuming that xNormal uses the tangent data stored in the dotXSI file-- and this may not be the case! It might not read that internal mesh data and instead compute it on its own from the mesh face's normal and UV data. If this is the case then having Carcass read the dotXSI tangent data that was not used by xNormal will also likely create artifacts, yes? I sent some dotXSI files out by email for @@Psyk0Sith and @@minilogoguy18 to test out. The only way we can know is... if the xNormal 3.17.16 has specific options to select to use tangent basis vectors from the mesh file for the dotXSI format. And if xNormal doesn't use this stored mesh data... then you'd likely get mismatching data and possible artifacts, right? So we're looking at having to update: (1) The Blender GLM exporter, and (2) the FBX-to-GLM converter, (3) Carcass [ for handling dotXSI tangent data-- assuming xNormal uses the mesh's internal tangent data ], and (4) all of the 3ds Max dotXSI exporters to add writing of tangent basis vectors into a Custom template. Does that about sum it up? No one has really pointed out any significant flaws in @@AshuraDX's clone trooper results (somebody please mark up some in-game screenshots to point out these travesties!), and we still haven't investigated the dotXSI/xNormal-->Carcass-->GLM-->In-Game results (with current tools) yet either. So before we go down these coding rabbit holes, I think these results should be vetted. I definitely want to know if xNormal uses the dotXSI 3.5 tangent data or if it computes it on its own before we touch (3) and (4). For which, I will need some help making the secret sauce from either @@Xycaleth or @@Almightygir. EDIT: I suppose there is also the 5th option of writing an export function to allow xNormal to write out the tangent basis vectors it uses for normal map baking (this has the benifit of supporting multiple mesh formats, right?)...and this would be necessary if it doesn't use the internal dotXSI tangent data-- and thus no point in doing (3) and (4) and just go with (5), right? Thoughts on all of this (can you tell I'm an engineer)? Edited February 26, 2017 by Archangel35757 Link to comment
Almightygir Posted February 26, 2017 Share Posted February 26, 2017 When asking "are we going to force a pipeline on the community?", it's prudent to consider that since they've been able to modify the game at all, some 15+ years ago, the pipeline has forced on them. It's far better to have a forced, yet clearly defined, outlined, and documented pipeline, than to just say "make it how you like". Tempust85 likes this Link to comment
Tempust85 Posted February 26, 2017 Author Share Posted February 26, 2017 How is it forcing a pipeline on the community though? This is DF2 mod, not openjk. If what we accomplish with GL2 gets ported to openjk, the community can either adopt the pipeline to have 100% proper looking assets or not. it's their choice. if they don't like it, they can stick to GL1. minilogoguy18 likes this Link to comment
Archangel35757 Posted February 26, 2017 Share Posted February 26, 2017 (edited) @@DT85 - We don't even know yet, if xNormal even uses the internal tangent data stored in a dotXSI 3.5 file. I just tried with the low & high poly dotXSI files I sent you and I don't see anything jumping out at me in the xNormal settings-- It has a check box to use exported normals (but that's vertex normals)... and it has a check box to either ignore (or not) vertex colors... and HiPoly mesh normals override tangent space on the lowPoly, etc. I'm not seeing anything that says anything close to "use mesh tangent data" @@Almightygir? xNormal could really use some help documentation. If xNormal doesn't use this internal dotXSI tangent data... then it's pointless to consider updating the dotXSI exporters and Carcass... would you agree? You say, "...100% proper looking assets..." -- so what percentage do you score @@AshuraDX's Clone Trooper? No one has yet pointed out what is unacceptable with his clone trooper results... nor have we investigated dotXSI/xNormal-->Carcass (v2.2)-->GLM-->In-Game process yet. These results may be acceptable... we don't know yet. If these results are in the 90% range or higher... is it worth all of this extra coding effort-- to squeeze out a few more percent? Could we discern the visual difference when players are running around shooting and sabering NPCs? EDIT: @@DT85, a few days ago (22 Feb) you stated: ...Honestly I'm quite happy with what we got now, which is ALOT better than poor ol' rend2 MP with its borked GLM tangents. Are you no longer happy? And what about MD3 models? Are you ok with just letting the renderer calculate the tangent basis vectors for MD3 models as is currently done? Aren't most of the environment models players are going to be looking at be MD3 format? I guess I'm just saying it's a lot of work and it may not yield any appreciable difference in results. Edited February 26, 2017 by Archangel35757 Link to comment
Tempust85 Posted February 26, 2017 Author Share Posted February 26, 2017 why stop at what I'd call "HL2 quality" when we can make an attempt at something higher? That reminds me, I'd like to see subsurface scattering at some point. I don't expect this to be worked on just yet though, we have more pressing issues like sprites, dlight stuff and weather. Link to comment
Archangel35757 Posted February 26, 2017 Share Posted February 26, 2017 why stop at what I'd call "HL2 quality" when we can make an attempt at something higher? That reminds me, I'd like to see subsurface scattering at some point. I don't expect this to be worked on just yet though, we have more pressing issues like sprites, dlight stuff and weather. Ok... yes, I'd like to see SSS and wrinkle maps too. Lets see what @@Psyk0Sith and @@minilogoguy18 get with the dotXSI/xNormal 3.17.16 normal map baking process. Also, @@Psyk0Sith wants to simplify the test model... boil it down to bare essence. Link to comment
Psyk0Sith Posted February 26, 2017 Share Posted February 26, 2017 First step, next i need to compile the same .XSI file that was used for baking to .glm. By keeping it simple problems will be quite evident right away. By simple deduction you can already tell that the file format didn't change anything to the mesh at this stage. Tempust85 and Archangel35757 like this Link to comment
Almightygir Posted February 26, 2017 Share Posted February 26, 2017 Just to make it absolutely clear to all. the high poly can be any filetype. It doesn't need to be .XSI Bake came out good Psyk0! Link to comment
Psyk0Sith Posted February 26, 2017 Share Posted February 26, 2017 Yeah what Lee said!, forgot to mention, thanks for clearing that up. Another thing to note, the silhouette of the low poly box doesnt match the highpoly so there will be some *funky* corners on the box but it is doing what it's supposed to. I got the box spawnable now, just need to make it spin, doesnt work for some reason. Link to comment
Archangel35757 Posted February 26, 2017 Share Posted February 26, 2017 @@Psyk0Sith - good job. Ok... so those dotXSI 3.0 files were produced with the v1.9 exporter, correct? What export vertex normals option did you use? What were your xNormal settings? Now you need to send those low-/hi-poly dotXSI files to @@minilogoguy18 (unless you have Softimage or ModTool) so that (you or...) he can add the inherent tangent basis vectors that Softimage can export into a dotXSI 3.5 file (without making any other mesh changes...); then we need to determine if there are explicit settings in xNormal to bake the normal map from the dotXSI internal mesh tangent data (rather than xNormal computing the normals on its own)... am I correct so far? @@Almightygir ? Link to comment
minilogoguy18 Posted February 26, 2017 Share Posted February 26, 2017 @@Archangel35757 I would have thought that you would have Softimage installed considering you're trying to check for errors against files coming from max with all your exporter work. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now