lfnetwork.com mark read register faq members calendar

Thread: Question About Model Lighting
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-20-2008, 04:19 PM   #1
e-varmint
Vapid Pomposticator
 
e-varmint's Avatar
 
Join Date: Jul 2007
Location: Abandoned Subway Car
Posts: 760
Current Game: Dragon Age
Helpful! 
Question About Model Lighting

I added an item to room m02ae_01a by merging it into the model in NWMAX. Once I got it positioned/trimeshed/linked/resetxformed, I exported the geometry and compiled it using mdlops 5.0. I dropped the .mdl and .mdx into override.

I was able to get into the altered area without any problem, and my vending machine was there, but the room was DARK! Since it is not a new area, I assumed that the original lightmaps would still work. Apparently, this is not the case.

Does anyone know preserve the area lighting in a case like this?

Last edited by e-varmint; 07-21-2008 at 09:17 PM.
e-varmint is offline   you may: quote & reply,
Old 07-20-2008, 04:26 PM   #2
TriggerGod
Senior Member
 
TriggerGod's Avatar
 
Join Date: Mar 2008
Location: hiding
Posts: 2,415
Helpful! 
Your gonna need to edit the lightmap of the original model, in this case, m02ae_01, and that'll make your module brighter.
But, I don't believe many people know how to edit lightmaps...
TriggerGod is offline   you may: quote & reply,
Old 07-20-2008, 04:32 PM   #3
Quanon
Senior Member
 
Quanon's Avatar
 
Join Date: May 2006
Location: Lost in my own unconsiciousens
Posts: 2,599
Forum Veteran Veteran Modder Helpful! 
IIRC, MDLops doesn't compile lights.

I'm sure there where some light dummys in your G-Max scene when you edited the geometry.

You could also try and compile your model with Kaurora, see if that makes a differance.

Else it might indeed help to try and edit those lightmaps, I believe that gets covered by DI's retexturing a games area tutorial.


TIQUILAAAAAAAA
Quanon is offline   you may: quote & reply,
Old 07-20-2008, 04:33 PM   #4
e-varmint
Vapid Pomposticator
 
e-varmint's Avatar
 
Join Date: Jul 2007
Location: Abandoned Subway Car
Posts: 760
Current Game: Dragon Age
Helpful! 
Quote:
Originally Posted by TriggerGod View Post
Your gonna need to edit the lightmap of the original model, in this case, m02ae_01, and that'll make your module brighter.
But, I don't believe many people know how to edit lightmaps...
It's probably got something to do with the .vis file.

It says this:

M02ae_01a 4
M02ae_05a
M02ae_09a
M02ae_10a
M02ae_12a

I have no idea what it means, though.

Quote:
Originally Posted by Quanon View Post
IIRC, MDLops doesn't compile lights.

I'm sure there where some light dummys in your G-Max scene when you edited the geometry.

You could also try and compile your model with Kaurora, see if that makes a differance.

Else it might indeed help to try and edit those lightmaps, I believe that gets covered by DI's retexturing a games area tutorial.
I'll give the Kaurora a shot and see what happens.

Edit: No luck so far. This thread, however, may hold the answer:

http://www.lucasforums.com/showthread.php?t=180034

Edit 2: Here's one way to fix it, form the Kaurora readme file.

"put the value "16777215" in the sun diffuse and sun ambient fields in the .ARE file"

I still don't know why the game isn't reading the original lightmapping.

-

Last edited by e-varmint; 07-20-2008 at 07:42 PM.
e-varmint is offline   you may: quote & reply,
Old 07-21-2008, 04:56 PM   #5
magnusll
Rookie
 
Join Date: May 2007
Posts: 136
Notable contributor Helpful! 
Quote:
Originally Posted by e-varmint View Post
It's probably got something to do with the .vis file.

It says this:

M02ae_01a 4
M02ae_05a
M02ae_09a
M02ae_10a
M02ae_12a

I have no idea what it means, though.



I'll give the Kaurora a shot and see what happens.

Edit: No luck so far. This thread, however, may hold the answer:

http://www.lucasforums.com/showthread.php?t=180034

Edit 2: Here's one way to fix it, form the Kaurora readme file.

"put the value "16777215" in the sun diffuse and sun ambient fields in the .ARE file"

I still don't know why the game isn't reading the original lightmapping.

-
MDlops doesn't know how to correctly process lightmaps. Kaurora doesn't, either... but this has to do with the fact that I don't know how to correctly export lightmaps from 3DSmax, thus it would be pointless to insert the code handling lightmaps into KAurora without creating a way of exporting those lightmaps from 3dsmax first.

Essentially, a lightmap is nothing more than a second texture applied to the model. It is combined with the first lightmap by color multiplication (the red, green and blue values of each texture for each vertex get multiplied and the resulting value is assigned to the vertex).

Within the trimesh node header, models containing a lightmap have two texture names associated with them, one for the "regular" texture file and one for the lightmap. There's also another field which tells the game what kind of data he can expect to find into the corresponding .mdx file; the specific bit of that field indicating the presence of lightmap tverts values must be set to one. Finally, you need to insert into the .mdx the lightmap tvert values for every vertex in the model... much like what you need to do with regular textures.

KAurora is capable of correctly handling the trimesh header structure and the .mdx structure; what it can't do is to import lightmap tverts data into the binary file, simply because I don't know how to make 3dsmax write the tverts values in the first place; without a format with which to work, I can't write the relevant code. Unfortunately, NWmax doesn't handle lightmaps because they weren't present into Neverwinter Nights; this means an add-on Max script is needed to add lightmap-exporting capabilities to NWMax. But I don't know how 3dsMax creates lightmaps so I can't do the script, thus I can't add the code into Kaurora, thus no lightmaps. Sorry.
[And note that even if I could write the script, you'd still have little luck as Mdlops won't export the original lightmap data, so you'd have to recreate the lightmap. Or wait for me to write code for the "export to ascii" part for KAurora]

The method you cite simply forces the "sun" generic ambient light to white light, thus giving a flat lighting to the whole area. Still better than darkness, though.
magnusll is offline   you may: quote & reply,
Old 07-21-2008, 07:07 PM   #6
e-varmint
Vapid Pomposticator
 
e-varmint's Avatar
 
Join Date: Jul 2007
Location: Abandoned Subway Car
Posts: 760
Current Game: Dragon Age
Helpful! 
Quote:
Originally Posted by magnusll View Post
............The method you cite simply forces the "sun" generic ambient light to white light, thus giving a flat lighting to the whole area. Still better than darkness, though.
Thanks for the info!!! Now I understand the nature of the problem. The sun settings will do what I need, and I can use the RBG Calculator to generate different shades.

Also, I switched to an outside area and discovered the benefits of turning SunFogOn to 0 (zero) in the .are file. Thanks to Doc Valentine for that extremely useful information from another thread!

-

Last edited by e-varmint; 07-21-2008 at 08:54 PM.
e-varmint is offline   you may: quote & reply,
Old 07-22-2008, 05:02 PM   #7
magnusll
Rookie
 
Join Date: May 2007
Posts: 136
Notable contributor Helpful! 
Incidentally: if anyone here wants lightmap-importing capabilities added to Kaurora, and knows how to create a lightmap with 3dsmax, he can contact me sending an appropriate scene file (a stupid square surface with a single light will do) and detailed instructions on how to create the freaking thing.
Note that I have no use for an already generated lightmap; I need to be able to debug the creation process while it's running. This way I'll find where 3dsmax stores lightmap tverts data, I'll write an exporting script, and the corresponding code in Kaurora.
magnusll is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Question About Model Lighting

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


All times are GMT -4. The time now is 08:30 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.