Jump to content

Home

Triumvirate Lords Of The Third Dimension


Recommended Posts

  • Replies 842
  • Created
  • Last Reply

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

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

Yeah, I just PM'ed endlessly with Dis, to get it working :p

Pointed out that Lightmaps go in the Ambient slot.

 

Here's some screenshots of a test I did:

 

LightmapTest02.jpg

LightmapTest01.jpg

 

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 :p

 

Perhaps thats something I did wrong? Dunno...

Link to comment
Share on other sites

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.

LightmapTest03.jpg

Link to comment
Share on other sites

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

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

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

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 :p

 

 

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

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...