Jump to content
Official BF Editor Forums

Advanced Lightmapping Tutorial (using 3dsmax)


1/2Hawk

Recommended Posts

  • Replies 181
  • Created
  • Last Reply

Top Posters In This Topic

Thanks to you! ;)

And a little question now.

Hey guys, just to let you know I've found a good method of getting Overgrowth into a 3DsMax LM scene and also found a method of getting the Overgrowth to cast proper shadows.

There is a tut about it?

:) How we can load an Overgrowth into a 3DsMax? not as single statics...

I want to render whole my map in 3DsMax and can't load a trees. Please teach me :unsure:

Link to comment
Share on other sites

How we can load an Overgrowth into a 3DsMax? not as single statics...

Curious about this myself... any info Rhino?

Link to comment
Share on other sites

You can get the overgrowth into max, by copying the tree possitions in OvergrowthCollision.con, into your staticobject.con this is the way i did it before. But im too interested if theres more to it?

I going crazy by only realizing this process. copy-pasting a whole overgrowth on map by single tree. :o

Link to comment
Share on other sites

I'm pretty (back up your lightmaps first!!!) that when you render object lightmaps in the editor, it puts all of your overgrowth into the staticobjects. So do that, swap back your lightmaps, and then voila!

I mean, I might be wrong, but when I accidentally clicked on Object Lightmaps once, I noticed I could delete my trees one by one. Didn't pay much attention to it at the time.

Edited by UberWazuSoldier
Link to comment
Share on other sites

Mmm... the Editor does it somehow but the thing we're after really is to have the trees placed in Max so if you have a giant palm tree near a building, then the shadow of that palm can cast up the walls of it. Not so much worried about lighting the trees themselves. If you do this way without trees and swap them in, that kind of effect will be missing.

Think Bensta's onto it though... just kicking around that file in Excel a bit, should be able to make a little macro that will convert it into a staticobject like con file which can be read into max after the main statics are loaded without actually sticking them in the staticobjects.con file. Looks to me like the fourth set of transform numbers are the x/y/z coords. Hrmmm...

Update: Hey that was actually pretty easy. K here's the mechanics of the the little script I got:

- Drop the code on the sheet

- Text to Columns, using the delimiter [ ... this gets the transforms in their own columns

- Strip out the three middle columns of crap you dont need

- Find / Replace "/1]" with "" on the last column

- Find / Replace the word "Transformation" with "Position" on the first column

- Run a loop up the rows knocking out any blank lines or ones starting with "rem" (UCASE the test)

- Run a loop back down the rows testing for "Object.isOvergrowth 1" and nudge in an "Object.layer 1" inbetween

- Export that as a con file in your map directory

Now you can take the header from the staticobjects, drop that on another sheet and sort it to find all of the run /objects/vegetation calls and put those as a header in your file. Max isnt reading the structure of mine quite right - no trees once you import. Think Im missing something..

Edited by 1/2Hawk
Link to comment
Share on other sites

  • 3 months later...

Well went through the tut fairly simply - not sure if im just doing something stupid but i have a problem with objects not blocking the sun when doing my sun lightmaps.

Ok, everything is generally working. Doing sun, sky and point lightmaps each looks ok and merge fine, show up in game and editor. There is however a problem with the sun lightmaps.

Each object itself is lightmapping correctly. dark away from the sun, light near it. Trouble is object a isnt casting shadows on object b. So for example a wall facing the sun, but inside a building is showing very light - just as if its in the open. Stacks of crates arent showing up against walls etc. I've even looked in max and the same thing is happening there. I just dont know whats happening. As its happening in max Im assuming nothing is going wrong between max and the game.

Yep, I only have the sun light on in max, all omnis and the ambient sky light are off. The effect is happening to all objects - they get lightmapped fine, but dont cast any shadows onto other objects.

Probably easiest to show a pic. Here you can see a portion of the map, the skys a morning one, low sun off to the right. If you look just beyond the stack of crates theres a tunnel through a buidling. That wall behind the crates should be in heavy shadow (theres no diffuse light on) but instead its bright. Even though theres a solid wall between it and the sun, and a solid ceiling above. By the way, all that building is made of different geoms, so the wall is a seperate object to the other wall and the ceiling etc. You can also see the same thing happening on the roped package - not casting a shadow on the wall behind.

All the setting for the sun light are shown in the screenshot. I saw a post by Rhino that i thought would fix it - setting the shadow intenstity to 1 so its at one, still nothing.

harborlightmap.jpg

Link to comment
Share on other sites

This is only remotedly connected to the tutorial but its really enerving : One of you Pirates guys has something in his sig which asks me ( as a viewer of the tutorial ) to enter a name and password for the Pirates 'Statistics Area' :blink: .

As i don't know that ( and i'm really not interested in purchasing one :P ) the box repeatedly pops up and costs me nerves.

Either 1/2 Hawk or PiratePlunder : It must be one of you :P

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

well, lightmapping the terrain in max worked fantastically, gave great results and was easy too - following this post here:

http://bfeditor.org/forums/index.php?s=&am...ost&p=68492

Couple of things i noticed that werent mentioned in that post, the red channel in terrain lightmaps are the opcaity of the waterplane. So from my experience theres no point lightmapping your terrain using your point lights (which can save a bit of time), just your sun and sky settings. If you have water you'll then need to copy across the red channel from terrain lightmaps from the editor.

If someone knows how to get the correct red channel from max that would be great, because lightmapping in max is so much quicker than in the editor.

One thing i havent tried is having varying resolutions of lightmap textures. the ones created in max had twice the resolution as the editor ones but worked straight away, so i wonder if you could have lower quality away from the play area?

Link to comment
Share on other sites

Don't see why that wouldnt work, because most of the coding regarding lightmaps is based on unit distances (0.0 - 1.0)...

Link to comment
Share on other sites

I may give it a try - for harbor where all the play happens across probably 2/16ths of the map (and its a very small map anyway) i could probably ramp up the detail on the key tiles. Even at twice what the editor was giving me the terrain lightmaps are a fraction of the quality of the object lightmaps near by, would be nice to have them be a little closer.

Just need to create an app that will automate the tiling process cos thats a pain in the ass.

Link to comment
Share on other sites

Yep, theres details posted by bensta for using Tpaint or Tsplit, cant remember which. I did give it a go and it didnt work for me, probably missed something. However, I was going to throw a little app together that could split them or build them from tiles etc etc, would have been very simple but the .NET .dds module i use is throwing errors on my windows7. Need to get to the bottom of it :(

Link to comment
Share on other sites

you done a unwrap on channel 9 for your custom objects?

It seems like the lightmapping utility follows the highest map channel in your model. If you have a dirt layer, it will render to the 3:map uvw for example. Having extra channels is often a source of problems elsewhere - but so far I havent had any issues exporting with a 9:map on the object as long as the other textures are done properly. Note that this 9:map only serves to lay out your lightmaps so keeping things perfectly proportional isnt necessary for maintaining a skin's pixel density evenly across all faces. In other words, most of my ship's parts are tiny loose faces that are consuming 80% of my usuable lightmap texture - which sucks. I really want to see sharp outlines on the ship decks and the masts and other key parts. Otherwise, they get crowded out on the lightmap by the little bits and the lightmap there looks fuzzy.

sounds to me like its useing a diffrent channel, one thats proberly overlapped.

Edited by Bensta
Link to comment
Share on other sites

you done a unwrap on channel 9 for your custom objects?

sounds to me like its useing a diffrent channel, one thats proberly overlapped.

No, I hadn't. I've done a layer 9 flattenmap within the boundaries but it didn't do any difference.

The original statics have 9 map channel but so have my statics, when imported by the lightmaptool. It seems they are generated automaticly.

I just unwraped and packed the 9th map channel on my static.

Edited by servos
Link to comment
Share on other sites

No, I'll try that tomorrow. Good night.

Ok I got it to work. I have no idea what the problem is but it seem to me that in some random cases max 9 can't import from statics' file in the right way. I'll just import it till it get i right. I asume it's a bug in Max (thought it just my statics that mess up...).

Anyways, if I pretend i didn't happen I am happy and noone will know it :)

EDIT:

Ok, the custom statics I did just happend to be out of the radius of the light and all the none custom within. Changed the radius to a lightyear. Stupid <_<

Edited by servos
Link to comment
Share on other sites

@PiratePlunder: Among my old tool collection for Battlefield i found this program :

http://www.schoeldgen.de/bf1942/tools/slice.zip

made by commander

It claims to slice a texture into 512*512 tiles . Might be useful for the terrain lightmaps.

Awesome, thanks msch, should do the trick.

Annoyingly it would only take a couple of minutes to program something up but the dll i use to read/write dds textures in .net is only 32bit and stupidly im now on 64bit. The dll works fine, but not if i try to access it from a .net app i've written and hence is compiled in 64bit. Im tearing my hair out.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

Announcements




×
×
  • Create New...