Bensta Posted April 17, 2007 Report Share Posted April 17, 2007 (edited) Lightmapping Tutorial for Beginners Lightmaps are the shadows in your map cast from the sun direction, there are two types of lightmaps, Terrain lightmaps and Object lightmaps. First i suggest to render lightmaps when your map is totally finished and you are not going to change or add an object or shape the terrain, as they will need to be done again, (and final lightmapping takes a long time!). However painting terrain, or placing vehicles and flags can be done after. Before Lightmap After Lightmaps Important! Object lightmaps need the 700mb lightmap samples downloaded from HERE and placed in dir' bellow, you can only generate object lightmaps for retail boxed bf2 objects, not sf/ef/2142 ect as there are no sample files for them. Only other option is to lightmap with 3dsmax if you have it.... http://bfeditor.org/forums/index.php?showtopic=7896 Place sample files here still zipped... First you need to set your sun direction to the sun in the sky. The best way if your using a normal bf2/bfsf..ect sky texture, is to just copy the sky.con from the BF map you want to use sky of, into your maps folder, then the sun direction will already be set. or you can do it by selecting "set sun direction to camera" or "set sun direction from camera" under the "light" tab in editor. Then you need to set the lightmap settings found in tweakbar, now i could explain these all day...but im not going to as thats a tutorial inits self , but below are some good basic settings to get you started, you will need to experiment with these yourself. Right click to switch from object settings to terrain settings. Or just copy and pase code to "Your_Level/Editor/TerrainLight or objectlight.con" files Terrain settings. rem ******** Lightmap Generation Settings ******** if v_arg1 == BF2Editor LightMapGeneration.init LightMapGeneration.GILightsBaseDir 0/0.33/-0.66 LightMapGeneration.GILightsIntensity 0.33 LightMapGeneration.GILightsShadowIntensity 1 LightMapGeneration.GILightsFov 45 LightMapGeneration.UseGITopLight 1 LightMapGeneration.GITopLightIntensity 0.1 LightMapGeneration.GILightsViewDistance 10 LightMapGeneration.skyWhite 0.3 LightMapGeneration.numberOfGILights 8 LightMapGeneration.sunLightShadowIntensity 1 LightMapGeneration.sunLightFov 2 LightMapGeneration.sunLightIntensity 1 endIf Object settings. rem ******** Lightmap Generation Settings ******** if v_arg1 == BF2Editor LightMapGeneration.init LightMapGeneration.GILightsBaseDir 0/0.33/-0.66 LightMapGeneration.GILightsIntensity 0.33 LightMapGeneration.GILightsShadowIntensity 1 LightMapGeneration.GILightsFov 45 LightMapGeneration.UseGITopLight 1 LightMapGeneration.GITopLightIntensity 0.1 LightMapGeneration.GILightsViewDistance 10 LightMapGeneration.skyWhite 0.3 LightMapGeneration.numberOfGILights 8 LightMapGeneration.sunLightShadowIntensity 1 LightMapGeneration.sunLightFov 2 LightMapGeneration.sunLightIntensity 1 endIf Now your ready to lightmap, open the lightmapping window, by selecting "Compile" tab at the top, then "lightmaps" , "Generate Lightmaps" Trace terrain - Render terrain lightmaps. Trace objects - Render object lightmaps. Trace selected - Render the objects lightmaps you have selected (Applys to objects only) Only nearest - Renders the nearest terrain patch nearest the camera. Primary - Renders all the primary terrain Secondary - Renders surrounding terrain (If activated) Low - low lightmaps (quick and crap looking) Medium - Medium lightmaps (Not too bad looking and not too long to render) High - High lightmaps (Best quality- and should be used for finished map, use others for testing purposes only during mapping). Resume options - self explanitory, (and ive never used them, so cant comment) Texture size - The compiled object lightmaps atlas texture size. (an atlas is basicly all the individual object lightmaps files compiled into only a few atlas textures files). DXT format - Lightmap .dds file type (not for sure whats best, but i keep with dxt1) Then "generate" and go sleep because final lightmaps will take hours and even day/s on very detailed maps and low end computers. Once done "generate lightmap atlas" if you have rendered object lightmaps. Happy lightmapping Bensta Edited August 9, 2008 by Bensta-IDF Quote Link to comment Share on other sites More sharing options...
[BG2]Panzaman Posted April 17, 2007 Report Share Posted April 17, 2007 Nice tut! Quote Link to comment Share on other sites More sharing options...
Bensta Posted April 18, 2007 Author Report Share Posted April 18, 2007 Thank you, any other info, tips ect would be great, and ill update it... (was very tired when i wrote it, so it could be better) Quote Link to comment Share on other sites More sharing options...
mschoeldgen[Xww2] Posted April 18, 2007 Report Share Posted April 18, 2007 Good job, Bensta That should help the newbies to get their lighting done Thanks a bunch ! Quote Link to comment Share on other sites More sharing options...
simon.blom Posted April 18, 2007 Report Share Posted April 18, 2007 What a helpfull tutorial! I only want to ask about all the lines on the road , the yellow cirkle around the flag and the blue line outside the map , what are they for and what do they mean? (I guess it´s something about the combat area and the singleplayer stuff? ) Quote Link to comment Share on other sites More sharing options...
Bensta Posted April 18, 2007 Author Report Share Posted April 18, 2007 1,The line in the road, is the road spline, this is the line you place and move to place and move the road. 2,The yellow circle around flag is the zone you need to be in to capture the flag. 3,The blue line is the combat zone. Quote Link to comment Share on other sites More sharing options...
debconf Posted April 18, 2007 Report Share Posted April 18, 2007 (edited) havent done anything with the editor in the last time .. but im pretty sure that u can delete the generated lightmap files ( for the objects! ) and just keep the atlas. think that way its done in vanilla maps Edited April 18, 2007 by debconf Quote Link to comment Share on other sites More sharing options...
Bensta Posted April 18, 2007 Author Report Share Posted April 18, 2007 (edited) Ohh yes, forgot that thanks, The editor woun't display the atlas lightmaps, only the lightmap files. The game will only display the atlas files, so keep the generated lightmap files some where safe Edited April 18, 2007 by Bensta-IDF Quote Link to comment Share on other sites More sharing options...
Zazoostudios Posted April 18, 2007 Report Share Posted April 18, 2007 Thanks! Was needed! Quote Link to comment Share on other sites More sharing options...
|]Citadel[| Posted April 18, 2007 Report Share Posted April 18, 2007 sweet. thanks for the tut Bensta Quote Link to comment Share on other sites More sharing options...
Drifterboy Posted April 23, 2007 Report Share Posted April 23, 2007 (edited) i used your light map settings inside the tv station it is like pitch black is there any way to make the shadows less dark if you get what i mean also thanks for the tut Edited April 23, 2007 by Drifterboy Quote Link to comment Share on other sites More sharing options...
mschoeldgen[Xww2] Posted April 23, 2007 Report Share Posted April 23, 2007 One of the most important values is the 'GIFillIntensity'. Unfortunately this value is not saved in the two con files. The higher the GIFillIntensity, the higher the indoor ambient light. Setting the Fill intensity to 0 leaves you with pitch black interiors. A good value for the Fill intensity seems to be around 0.6 up to 0.95, depending on the desired athmosphere and GI Lights intensity. Keep in mind: Before rendering new object lightmaps, erase the old ones for this object in /Lightmaps/objects/ Quote Link to comment Share on other sites More sharing options...
Bensta Posted April 24, 2007 Author Report Share Posted April 24, 2007 (edited) Dont forget to play with you lightsettings, staticsuncolor and staticskycolour adjust those to lighten/darken your object generated lightmaps Edited April 24, 2007 by Bensta-IDF Quote Link to comment Share on other sites More sharing options...
Drifterboy Posted April 24, 2007 Report Share Posted April 24, 2007 ok thanks guys Quote Link to comment Share on other sites More sharing options...
mschoeldgen[Xww2] Posted April 25, 2007 Report Share Posted April 25, 2007 (edited) Only a small sidenote for you guys using custom statics. The latest editor ( 0.1.237.0 ) accepts 4 lightmapsamples archives, so you're fine zipping up your samples into a 'lightmapssamples04.zip' file and add it to the other 3 (stock) archives. Edited April 25, 2007 by mschoeldgen[Xww2] Quote Link to comment Share on other sites More sharing options...
Kan3Da Posted April 3, 2008 Report Share Posted April 3, 2008 can´t see the images Quote Link to comment Share on other sites More sharing options...
spyker Posted August 9, 2008 Report Share Posted August 9, 2008 "cant see the images" Me either Quote Link to comment Share on other sites More sharing options...
Bensta Posted August 9, 2008 Author Report Share Posted August 9, 2008 Updated with new image links Quote Link to comment Share on other sites More sharing options...
Uber_Soldat Posted October 13, 2009 Report Share Posted October 13, 2009 what am i doing wrong if my overgrowth is not rendering shadows? i have them selected and showing before i render the lightmaps Quote Link to comment Share on other sites More sharing options...
Ekalb Posted October 17, 2009 Report Share Posted October 17, 2009 what am i doing wrong if my overgrowth is not rendering shadows? i have them selected and showing before i render the lightmaps I appear to be having this issue aswell. My overgrowth isn't generating any shadows. Quote Link to comment Share on other sites More sharing options...
gamer.supreme.1 Posted December 28, 2009 Report Share Posted December 28, 2009 (edited) First you need to set your sun direction to the sun in the sky. The best way if your using a normal bf2/bfsf..ect sky texture, is to just copy the sky.con from the BF map you want to use sky of, into your maps folder, then the sun direction will already be set. or you can do it by selecting "set sun direction to camera" or "set sun direction from camera" under the "light" tab in editor. After opening the sky.con file (I copied Operation_Harvest sky.con to my map) there are lines which i think calls for the a location outside of my maps directory. Am i to change this to something else? Lightmanager.init Lightmanager.skycolor 0.360784/0.396078/0.427451 Lightmanager.ambientcolor 0.682353/0.682353/0.682353 Lightmanager.sunColor 0.537255/0.513726/0.462745 Lightmanager.sunSpecColor 0.478431/0.458824/0.396078 if v_arg1 == BF2Editor LightSettings.TerrainSunColor 0.37/0.35/0.30 LightSettings.TerrainSkyColor 0.58/0.65/0.67 LightmapSettings.waterSunIntensity 0.8 else terrain.sunColor 0.37/0.35/0.30 terrain.GIColor 0.58/0.65/0.67 terrain.waterSunIntensity 0.8 endIf Lightmanager.staticSunColor 0.38/0.37/0.29 Lightmanager.staticSpecularColor 0.36/0.36/0.33 Lightmanager.staticSkyColor 0.60/0.63/0.65 Lightmanager.singlePointColor 0.00/0.00/0.00 Lightmanager.sunDirection -0.209633/-0.6289/0.748691 Lightmanager.enableSun 1 Lightmanager.effectSunColor 0.47/0.47/0.41 Lightmanager.effectShadowColor 0.29/0.33/0.33 Lightmanager.defaultEffectLightAffectionFactor 1 Lightmanager.hemilerpbias 0.3 hemiMapManager.setBaseHemiMap Levels/OperationHarvest/groundhemi 0.000000/0.000000/0.000000 2048.000000 500.000000 Lightmanager.treeAmbientColor 0.34/0.35/0.24 Lightmanager.treeSunColor 0.24/0.32/0.24 Lightmanager.treeSkyColor 0.28/0.29/0.22 if v_arg1 == BF2Editor else run /Common/Sky/SkyDome/skydome.con run /Common/Sky/Flare/flaresprite.con endIf Skydome.skyTemplate skydome Skydome.cloudTemplate cloudlayer Skydome.hasCloudLayer 1 Skydome.hasCloudLayer2 0 Skydome.scrolldirection -0.004/-0.004 Skydome.scrolldirection2 -0.002/-0.002 Skydome.cloudTexture common\textures\cloud\Cloud00_XP2 Skydome.cloudTexture2 common\textures\cloud\Cloud04 Skydome.skyTexture common\textures\sky\harvest_sky Skydome.domeRotation -40 Skydome.fadeCloudsDistances 320/600 Skydome.cloudLerpFactors 0.6/0.5 Skydome.flareTexture common\textures\sunflare\Harvest_32bitglow.dds Skydome.flareDirection -0.21/-0.53/0.25 Renderer.fogColor 127.00/134.00/133.00 Renderer.fogStartEndAndBase 20.00/470.00/1.60/0.60 OK, so messing around with the tweak i found that i can keep the sky animation the same as harvest, but i had to change the textures to get rid of Uncle Sam who plagued my skydome. It was a very easy process, so my question above is no longer needing answers. Edited December 28, 2009 by gamer.supreme.1 Quote Link to comment Share on other sites More sharing options...
BlackSunday Posted February 3, 2010 Report Share Posted February 3, 2010 Only a small sidenote for you guys using custom statics. The latest editor ( 0.1.237.0 ) accepts 4 lightmapsamples archives, so you're fine zipping up your samples into a 'lightmapssamples04.zip' file and add it to the other 3 (stock) archives. Nice Tut ! But i seem to be having a problem still I created a small map just to play around with and the editor did generate my lightmaps but for some reason it will not generate the lightmap atlas I've went thru this tut 3 times and all i ever get from bf editor is *** Generating atlas lightmaps for [levels/barricade/lightmaps/objects]... *** *** Failed *** The LightMapAtlas.tai is there but it's pretty much empty # mods/bf2/levels/Barricade/lightmaps/objects/LightmapAtlas.tai # # # <filename> <atlas filename>, <atlas idx>, <woffset>, <hoffset>, <width>, <height> # # Texture <filename> can be found in texture atlas <atlas filename>, i.e., # <group><idx>.dds with texture coordinates boundary given by: # A = ( <woffset>, <hoffset> ) # B = ( <woffset> + <width>, <hoffset> + <height> ) # # where coordinates (0,0) and (1,1) of the original texture map correspond # to coordinates A and B, respectively, in the texture atlas. Thanks in advanced Quote Link to comment Share on other sites More sharing options...
BlackSunday Posted February 4, 2010 Report Share Posted February 4, 2010 Problem Solved ! Quote Link to comment Share on other sites More sharing options...
Bensta Posted February 4, 2010 Author Report Share Posted February 4, 2010 Well great and what fixed it? Quote Link to comment Share on other sites More sharing options...
BlackSunday Posted February 4, 2010 Report Share Posted February 4, 2010 Well great and what fixed it? I was only generating the lightmaps for the terrian, once i created the lightmaps for the objects it created the lightmapatlas.tai which took the black out of the game but my terrain is screwed up, in the editor it looks like it's supposed to but in game it's kinda like its got a checkered board thing going on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.