magnusll Posted December 24, 2009 Share Posted December 24, 2009 Hehe. As far as testing goes, don't worry, I will post a link to a release candidate as soon as I have a woking one. But at the moment you would just tell me what I already know i.e. "the lightmaps are imported in the game but they get mangled" Link to comment Share on other sites More sharing options...
disbeliever Posted December 24, 2009 Author Share Posted December 24, 2009 Good man, get at it, show no mercy, get it done and have a great xmas!! Link to comment Share on other sites More sharing options...
Quanon Posted December 24, 2009 Share Posted December 24, 2009 Great celebrations and festivities to all! Link to comment Share on other sites More sharing options...
magnusll Posted December 27, 2009 Share Posted December 27, 2009 Eureka! Link to comment Share on other sites More sharing options...
disbeliever Posted December 27, 2009 Author Share Posted December 27, 2009 What does that mean?? Eureka you got lightmaps working or Eureka your drunk for xmas? Link to comment Share on other sites More sharing options...
magnusll Posted December 28, 2009 Share Posted December 28, 2009 Let's put it this way. Before: After: Hint: no lights were added to the scene I need to get some sleep now. Tomorrow, everything will be more clear... Link to comment Share on other sites More sharing options...
Quanon Posted December 28, 2009 Share Posted December 28, 2009 Ooooooooooooohhh boy! Your my GOD MagnusII! Freaking awesome! Link to comment Share on other sites More sharing options...
magnusll Posted December 28, 2009 Share Posted December 28, 2009 1 In the beginning MagnusLL created the walkmeshes and the mdl files. 2 And the textures were without form, and void; and darkness was upon the face of the deep. And the spirit of MagnusLL moved upon the face of the scratch built areas. 3 And MagnusLL said, Let there be lightmaps: and there were lightmaps. 4 And MagnusLL saw the lightmaps, that they were good: and MagnusLL divided the lightmaps from the black textures. KAurora Editor 0.4 release candidate 1 There are two files. The executable itself, and the changes to NWMAX scripts (version 0.8) to allow 3dSMax to export lightmap data. Backup a copy of the old file first, then just replace the old file with the new (directory should be "Scripts\NWmax\nw_ie_inc"). The new version of KAurora requires .NET Framework 3.5 sp 1. It should also be compatible with Vista and Seven. As usual, keep a backup of the old executable. To export lightmaps, just create them as you normally would but remember to assign them to channel 2. Export routine will not work with any other channel. If the lightmaps have been exported correctly, you will see lines similar to the below ones for all trimesh nodes having a lightmap: lightmap xxxxxxx and lightmaptverts xxx (followed by a bunch of numbers) Just do the usual conversion with the program, and lightmap data will be inserted into the .mdl and .mdx files. Remember to include all the lightmap .tga files somewhere in Kotor's directory structure (either within the .MOD or in the override directory). Kaurora should work either with one big lightmap file or with a million separate ones (one for each object, as it's the default). Let me know Link to comment Share on other sites More sharing options...
disbeliever Posted December 28, 2009 Author Share Posted December 28, 2009 MAN! you are awesome!!!!!!!!!!!!! the way our Sleheyron will look now with this, I cant wait to see!! Thanks for taking the time to work on this, especially over your holiday break. You should know we appriciate it. Link to comment Share on other sites More sharing options...
Quanon Posted December 28, 2009 Share Posted December 28, 2009 Thank you Magnuss! Best christmas thing EVEEEEEEEEEEEEAAAAAAAAAAAAARRR!!! I'll go and test it out right away, to see this miracle at work! Link to comment Share on other sites More sharing options...
disbeliever Posted December 28, 2009 Author Share Posted December 28, 2009 Hmm i made sure I assigned all lightmaps to channel 2. Export went fine, minus the sanity check fail crap. However in the Ascii next to lightmaps, it always says "NULL". Q is doing some testing also, so well see what he comes up with Link to comment Share on other sites More sharing options...
disbeliever Posted December 28, 2009 Author Share Posted December 28, 2009 So I am coming up with why maybe I get NULL in the ascii file: Quick recap: open an area cut of ours (the arena) create an omni light that shows shadows Select all of the arena parts, and click "render to texture" In there I make sure all are set to channel 2, and then under "output" I click "lightmap". When I hit render I get this message: "The following elements do not specify a target map slot" And then it lists out all of the objects: "a226:Lightmap" "a227:Lightmap" etc Any idea? Link to comment Share on other sites More sharing options...
magnusll Posted December 28, 2009 Share Posted December 28, 2009 Aren't you supposed to put them into... ehr... ambient or diffuse slot, can't remember which? Link to comment Share on other sites More sharing options...
disbeliever Posted December 28, 2009 Author Share Posted December 28, 2009 Yup you are right Q has gotten a test area in game, and i believe he has some interesting findings Link to comment Share on other sites More sharing options...
Quanon Posted December 28, 2009 Share Posted December 28, 2009 Yeah, I just PM'ed endlessly with Dis, to get it working Pointed out that Lightmaps go in the Ambient slot. Here's some screenshots of a test I did: This model had 32 objects in the scene, so I got 32 lightsmaps! Though as you can see, the UVWs got mangled... seems like Automatic Unwrap doesn't work that well... I'll see if I copy the UVWs of my regular textures, set them to channel 2. See if that turns out better. Another problem with the adjusted export script is the walkmesh. When a walkmesh is in the scene I get this Runtime Error: Map support not enabled for specified map channel 2. The Max script window pops up, highlighting line 808; somewhere around 800, of the script. This error goes away the minute I deleted my walkmesh. I added the walkmesh after I rendered the lightmaps, as the walkmesh doesn't need any lightmaps Perhaps thats something I did wrong? Dunno... Link to comment Share on other sites More sharing options...
disbeliever Posted December 28, 2009 Author Share Posted December 28, 2009 My area's uvmaps get mangled as well. See the arena: Link to comment Share on other sites More sharing options...
Quanon Posted December 28, 2009 Share Posted December 28, 2009 Hmmm, my test with copying UVWs and just changing the channel to 2. Didn't turn out well, infact its worse then the automatic Unwrap function in Render to Texture. I'll think a bit more, on how I can nail the UVW mess. No doubt there's a way to solve it. Link to comment Share on other sites More sharing options...
disbeliever Posted December 28, 2009 Author Share Posted December 28, 2009 Is this a case of tweeking variables on our end, or changing code on Mags end? Link to comment Share on other sites More sharing options...
Quanon Posted December 28, 2009 Share Posted December 28, 2009 I think, at the moment, it'll be our job to do some backtracking on our Unwrapped UVWs of the lighmaps. It reminded me of UVW troubles I had on gun, sword models and all, which use the Unwrap UVW modifier to apply their custome made texture. What it all comes down to is: DETACHING! Not to a new object, but within the mesh it self. I think thats called Detach=> option To Element. Thing is you first need to render the lighmaps out, so the Unwrap modifier gets on top of your other UVW, the one that controles the regular texture. Anyway, I'll have to test if it DOES make a differance. If it won't work, it has to be something within Max or the export script... I think... Link to comment Share on other sites More sharing options...
disbeliever Posted December 28, 2009 Author Share Posted December 28, 2009 Sounds good, let us know your results from testing Link to comment Share on other sites More sharing options...
magnusll Posted December 28, 2009 Share Posted December 28, 2009 The problem with the walkmesh is probably a bug in the NWN script. I will check it out, but I already have my suspects. I'm guessing the script goes looking for the lightmap even in the walkmesh nodes, which obviously don't have one, and crashes. For the UV mangling, I'm not sure. My test area went well, but I use an extremely simple one so my modifiers stack is very short. With your complex models there might be a specific order to put them in, to avoid the mess. Link to comment Share on other sites More sharing options...
disbeliever Posted December 29, 2009 Author Share Posted December 29, 2009 So is the mangling stack order something we can fix on our end, or something in the NW code? Link to comment Share on other sites More sharing options...
magnusll Posted December 29, 2009 Share Posted December 29, 2009 It should be something fixable by swapping around the order in which the modifiers get applied. As I said, my extremely simple area was imported into Kotor with correct textures, so the data points extracted by the modified script and then put into the binary files by KAurora were the right ones. That said, it is entirely possible the complex areas you're using generate special cases which are not correctly handled by the code. If you can send to me the exported data (the text file generated by NWN), along with the textures used by the scene, I can run a debug session and check what happens. Link to comment Share on other sites More sharing options...
Quanon Posted December 29, 2009 Share Posted December 29, 2009 Hmm, I'll pack up my scene and textures for you Perhaps its safer to just first export and compile the model without lightmaps. Check it out in game. If the textures are okay, import that file back into Max and then render out Lightmaps. That way, the previous UVWs are baked into the mesh, not visible anymore on the stack or perhaps doing it the other way around is better... first lightmaps, then doing the normal textures EDIT Linky:http://www.mediafire.com/?mo2zmzm1g4u Oh, my stack in that scnene isn't to complicated really, its Editable Mesh, on that a normal UVW map, mostly a Plane( though that one can be set to Y axis and turned 90°), then the Automatic Unwrap of the Lightmap rendering. That's it. The normal texture look fine in the game, so the exporter or Kaurora, doesn't seem to have to much trouble with the whole Y axis and rotating part. Link to comment Share on other sites More sharing options...
magnusll Posted December 29, 2009 Share Posted December 29, 2009 Aaaand... you have the special case my code doesn't handle Let me check how this works [EDIT] Ooooh... your scene generates two set of faces, one for textures and one for lightmaps. Need to write a few things to handle the lightmap faces. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.