Lightmaps
Re: Lightmaps
Shadowmesh is for dynamic shadows. Lightmaps require an additional uvmapped layer in the object for creating the pre rendered self shadowing. Samplesmaker will generate the files so that bc can generate them... But I've never had luck getting bc to actually give me a lightmap.. I want them. They sure make statics look prettier
- MR PINK BALLS
- Posts: 267
- Joined: Sun Oct 18, 2009 4:01 pm
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Lightmaps
Yes Max is required in-order to generate a channel 3 uvmap for custom statics. Samples maker merely makes files that pretty much define how large the outputted lightmap files wll be for the static. So SamplesMaker can't help you if the object has no channel 3 uvmap.
I don't think Gmax supports lightmapping, so 3DSMax 5 or greater is a must.
I don't think Gmax supports lightmapping, so 3DSMax 5 or greater is a must.



I have cameras in your head!
Re: Lightmaps
I've only managed to create lightmaps for statics in a MOD, and not in a custom map.fo0k wrote:has anyone managed to create lightmaps for custom objects here?
tutorial would be very useful

Re: Lightmaps
Is there anything different about the skinning of the lightmap Channel 3?
Or you just copy it over?
Or you just copy it over?
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Lightmaps
Yes the Channel 3 UVMap for the lightmap channel is different in layout then the channel 1 uvmap that is used for the normal textures.
If your static does not have a channel 3 uvmap, you must make one by hand or use the automatic unwrap function. The uvmap for each individual face must not overlap in the uvmap editor and must be in a layout as such that each face (or group of faces if they are connected to each other) can be mapped a unique spot on the lightmap texture file. In the UVmap edit dialog (in 3DSMax anyway), there is a blue square and a grid. All your UVMap pieces for the channel 3 uvmap must fit inside the square which represents the demensions of the texture file. (it is not related to the eventual size of the texture file. If any pieces are out side the main square area, the object will either not lightmap at all or the pieces out out bound will not be lightmapped and may appear all black ingame.
In most cases, simply copying over the channel 1 uvmap will not work. because the channel 1 uvmap for most objects typically use the same section of a texture for multiple faces. This can not be done with the channel 3 uvmap.
I used 3DSMax to do my lightmapping. I had to get quite a few of the vanilla statics to work by adding a channel 3 uvmap to them. I used the automatic unwrap feature found in the render to texture dialog. Once a channel 3 uvmap is made, simply export with lightmapped checked (found on the BF1942 tools export dialog box) and then use samples maker to make samples for it. That's all there is to it.
To quickly find the the "render to texture" dialog box, simply select your object (or group of objects as you can do multple ones at once) and press the zero key. (not the zero key on the numpad! the one near the backspace key). It should then open the render to texture dialog box. Makes sure automatic unwrap is checked and then click the "Unwrap Only" button at the bottom of the dialog box. You can also use this dialog box to render lighting set in the scene to the lightmap texture file(s) for the object(s) selected. This is the dialog box I used to "bake" the lightmap textures for many of my modded maps. My Midnight at Berlin map was lightmapped entirely in 3DSMax.
The one advantage is, that you don't need sample files and you can make lightmap textures larger then 512x512. But be warned, if you got lots of statics that use high res lightmaps beyond 512x512, your game WILL LAG unless you got a monster graphics card with a crap load of video ram and speed.
The one disadvantage is the time needed to do this. It can take awhile to import all the object meshes into 3DSMax and into the correct position. If you have rexman's tools that can import object positions, then your job will be much quicker. But you still need to import the terrain and such. You must also import each object and export individually to a max file for each object and do a replace of all object instances in your map scene with the objects you exported to Max, so that the default box mesh that rexman's tools makes get replaced with the actual objects and such. it's quite complicated to get right and such and I can't convey fully how to do this in a forum post.
If your static does not have a channel 3 uvmap, you must make one by hand or use the automatic unwrap function. The uvmap for each individual face must not overlap in the uvmap editor and must be in a layout as such that each face (or group of faces if they are connected to each other) can be mapped a unique spot on the lightmap texture file. In the UVmap edit dialog (in 3DSMax anyway), there is a blue square and a grid. All your UVMap pieces for the channel 3 uvmap must fit inside the square which represents the demensions of the texture file. (it is not related to the eventual size of the texture file. If any pieces are out side the main square area, the object will either not lightmap at all or the pieces out out bound will not be lightmapped and may appear all black ingame.
In most cases, simply copying over the channel 1 uvmap will not work. because the channel 1 uvmap for most objects typically use the same section of a texture for multiple faces. This can not be done with the channel 3 uvmap.

I used 3DSMax to do my lightmapping. I had to get quite a few of the vanilla statics to work by adding a channel 3 uvmap to them. I used the automatic unwrap feature found in the render to texture dialog. Once a channel 3 uvmap is made, simply export with lightmapped checked (found on the BF1942 tools export dialog box) and then use samples maker to make samples for it. That's all there is to it.

To quickly find the the "render to texture" dialog box, simply select your object (or group of objects as you can do multple ones at once) and press the zero key. (not the zero key on the numpad! the one near the backspace key). It should then open the render to texture dialog box. Makes sure automatic unwrap is checked and then click the "Unwrap Only" button at the bottom of the dialog box. You can also use this dialog box to render lighting set in the scene to the lightmap texture file(s) for the object(s) selected. This is the dialog box I used to "bake" the lightmap textures for many of my modded maps. My Midnight at Berlin map was lightmapped entirely in 3DSMax.
The one advantage is, that you don't need sample files and you can make lightmap textures larger then 512x512. But be warned, if you got lots of statics that use high res lightmaps beyond 512x512, your game WILL LAG unless you got a monster graphics card with a crap load of video ram and speed.

The one disadvantage is the time needed to do this. It can take awhile to import all the object meshes into 3DSMax and into the correct position. If you have rexman's tools that can import object positions, then your job will be much quicker. But you still need to import the terrain and such. You must also import each object and export individually to a max file for each object and do a replace of all object instances in your map scene with the objects you exported to Max, so that the default box mesh that rexman's tools makes get replaced with the actual objects and such. it's quite complicated to get right and such and I can't convey fully how to do this in a forum post.



I have cameras in your head!
Re: Lightmaps
Do I need to pack my object into the main mod rfas? will this work on a custom object in my map?
Im pretty sure everything else is setup ok.. channel 3, samples file in standardmesh folder..
bf42.exe will run from my olm shortcut but wont generate.
Im pretty sure everything else is setup ok.. channel 3, samples file in standardmesh folder..
bf42.exe will run from my olm shortcut but wont generate.
- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Lightmaps
Yes it is generally recommended that your objects be loaded from the main mod and not your map. This makes pathing to them much easier when placing the sample files. 




I have cameras in your head!
Re: Lightmaps
Pretty much got this figured out now 
These are made with real lightmaps from .samples files
a few minor pixly parts, on the diagonal parts, but its definitely live-able

These are made with real lightmaps from .samples files

a few minor pixly parts, on the diagonal parts, but its definitely live-able

- Apache Thunder
- Posts: 1213
- Joined: Mon Oct 19, 2009 2:48 am
- Location: Levelland Texas, USA
- Contact:
Re: Lightmaps
Nice! Glad to see you made progress on it. Also, you can even pack your samples into RFA files. I just discovered this recently. I packed all the samples for my BFheroes mod into standardMesh_001. and it still lightmapped fine set up like that. Plus RFA files have the benefit of compressiong those excessively large sample files. Sample files seem to be full of redundent data since they compress to a small size.
(the samples for my mod took up 300mb unpacked, but the resulting packed RFA was a mere 80mb!)
if you plan to do any night maps. I highly recommend you learn how to do lightmapping in 3DSMax. It will really make your map stand out. There is more work involved but I believe the result is worth it. (unless you already learned this...been while since we discussed it lol.)
Check out the screens from my night map I'm working on for the BFHeroes mod: (click to enlarge)




Awesome ain't it?

if you plan to do any night maps. I highly recommend you learn how to do lightmapping in 3DSMax. It will really make your map stand out. There is more work involved but I believe the result is worth it. (unless you already learned this...been while since we discussed it lol.)
Check out the screens from my night map I'm working on for the BFHeroes mod: (click to enlarge)




Awesome ain't it?




I have cameras in your head!