Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Guide to new lighting features in 4.0RC1
Re: Guide to new lighting features in 4.0RC1 [message #473767 is a reply to message #473749] Thu, 30 August 2012 18:54 Go to previous messageGo to previous message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma:
General (3 Stars)

Here is part 3:
The alternate material feature will only work properly on terrain and will only work on meshes that are prelit (i.e. those that have "Prelit=true" set)
The alternate lighting feature will only work properly if the meshes being lit all have Prelit=true set. Meshes which do not have Prelit=true (and therefore get lighting from the vertex solve) will probably not look correct when the lights switch to the "power off/dead" set of lights.

To use the alternate lighting feature you do the following: (there may be other ways to generate .wlt files, I am only describing the way I know to do it)
1.Load leveledit and create a blank map
2.Place the building interior terrain for the building you want to add lights to at 0,0,0 (i.e. so that 0,0,0 in the building terrain is at 0,0,0 in the level)
3.Create any light presets you like and place them anywhere in the level (but presumably they will be inside the building). These will be the "normal" lights
4.Choose Lighting-Export... from the menu. Save the lights as e.g. normal.wlt (the name doesn't matter, I am using normal.wlt for this example)
5.You can (if you like) save this level with the placed lights in it for later further work if you like (you dont need to though)
6.Delete all your "normal" lights
7.Place your "dead" lights (which will also be used when there is low power)
8.Choose Lighting-Export... from the menu. Save the lights as e.g. dead.wlt (the name doesn't matter, I am using dead.wlt for this example)
9.You can (if you like) save this level with the placed lights in it for later further work if you like (you dont need to though)
10.Put wltmake.exe, memorymanager.dll, normal.wlt and dead.wlt in a folder. Open a command prompt and go to this folder.
11.Run wltmake out.wlt normal.wlt dead.wlt. Instead of out.wlt in that command, use the name of your building interior mesh but with a .wlt extension (so if the building is mabar_int.w3d, the wlt file would be mabar_int.wlt)
12.Copy the new output wlt file into your always.dat file or whatever (somewhere LE and the game can find it)
13.Edit the preset for your building interior terrain and set m_LightFilename to the name of your new .wlt file
14.Repeat steps #1 to #13 for all the buildings that need special lights
15.Once that is complete, open up each map that contains the newly-lit buildings.
16.Delete any instances of the building interior meshes (or of any terrain that proxies them in) and re-insert them into the level so that the lights get pulled in.
17.Save and re-export the map.
18.Enjoy your new lighting (hopefully)

To use the alternate materials feature you do the following:
1.Take your mesh in max or gmax and apply the "normal/alive" materials (including any light maps you may have created)
2.Export this to a w3d file (lets call it normal.w3d for this example)
3.Edit the mesh and apply the "dead" materials (including any light maps you may have created)
4.Export this to another w3d file (lets call it dead.w3d for this example)
5.Put both w3d files, memorymanager.dll, altmat.exe and w3dlib.dll in a folder. Open a command prompt and go to this folder.
6.Run altmat out.w3d normal.w3d dead.w3d replacing out.w3d with the name of the output mesh you want (i.e. the name that matches the building you are working with)
7.Place the new w3d file in a place that leveledit and the game will find it.
8.Export your maps as normal
9.Load the game and enjoy your new materials

The things you can change between normal and dead materials are:
Vertex colors
Texture coordinates
All the values on the Vertex Material tab
All the values on the Shader tab
All the values on the Texture tab EXCEPT for the "Stage 0 Texture" and "Stage 1 Texture" checkboxes

Changing anything else (including geometry or pass counts) will not work and may lead to crashes (in altmat or in the game).
Remember that you can't rename a w3d file so make sure you use the correct output filename.

Feel free to ask any questions you have about this stuff here and I will answer them.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: I need something :o
Next Topic: Applying Texture onto a map
Goto Forum:
  


Current Time: Thu Dec 19 05:25:24 MST 2024

Total time taken to generate the page: 0.01146 seconds