3dsmax Lightmaps problem! Very black outcome.

Making or wanting help making your own asset? Check in here
Post Reply
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

3dsmax Lightmaps problem! Very black outcome.

Post by Mineral »

Trying lightmaps with 3dsmax9 now on a map I'm working on. I'll post it here in public so others might learn from my mistakes :D

So they turned out pretty pure black :( it seems everywhere it has to cast a shadow it becomes pure black. No transparency in it. I matched my sun settings to the ones on muttrah(the only example available), and matched the GIlights template of rhino to fit on the 1k size of my map. No fix neither. Could it be askysetting? I rendered sky pass with GIlights+ambients, sun settings with only sun, and point one without anything cause I haven't got any.

Image

Image

Sun settings in max:
shadow: adv ray traced
intensity multiplier: 2
shadow density: 1 (turning that down didn't help)
Not sure if any others matter much?

Didn't change any others ,and these are the muttrah ones anyway. Haven't changed anything. Same for the sky lights.

outcome:
Image

here is the lightmap.dds from LOD0. I don't have much time these days to play around with it, kinda want do get it right quickly for this.

https://dl.dropboxusercontent.com/u/646 ... 3D-122.dds

Greetings!
Image
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: 3dsmax Lightmaps problem! Very black outcome.

Post by Amok@ndy »

feels like you have a strong sun but weak ambient, are you sure you enabled both of the ambient lights ?

if this is the default scene of rhino you need to enable the top light and one of the gilights since those are instances
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: 3dsmax Lightmaps problem! Very black outcome.

Post by Rhino »

[R-CON]MineralWouter wrote:I rendered sky pass with GIlights+ambients, sun settings with only sun, and point one without anything cause I haven't got any.
Well first of all you don't need to run a point light render if you don't have any point lights and if you do you can get away with only rendering point light for objects that have point light near them, although this isn't advisable since you can easily miss an object which you think might not be getting hit by point light but in fact is, but in your case you don't have any point lights so you can just skip it rather than spending some time making lots of blank LMs...


But anyways your problem is that you've in fact rendered the sun light into each channel (sun, sky and point).

This is your lightmap:
Image

And this is the middle part of the Carrier on the Falklands:
Image

Now before I go any further your lightmap shouldn't be 2048x2048 for a building of that size. 1024x1024 maximum but you may even want to try it as low as 512x512, although that will most likley be a really low quality LM so 1024x1024 is probably best in this case for its lod0, although its best to look at what size it is in the vBF2 map you got it from (opening up its lightmap atlas files and taking a look). Each atlas file is 2048x2048 so something is going to need to be super large to take up its own atlas file on its own... Only things I have on the Falklands that use a 2048 LM are things like the waterplane and each terrain patch (which there are only 4 for each corner of the islands) and each section of the carrier for example is only 1024x1024 for its lod0.
Image
(NE Corner of the islands, you can see Port Stanley in the bottom right and San Carlos in the topish left).

Image
(Waterplane LM)


But yes getting back to the point to why your LM isn't working, like I said before is that you've rendered you sky, sun and point channels all with sun light in them. If you look at my images the biggest difference you will see is my ones are all a mix of Red, Green and Blue colours. This is because each colour is the different Channels. Red = Point Light, Green = Sun Light and Blue = Sky Light. If we go back to the Falklands Carrier Mid Section again and look at each layer indervidually you will see what I mean (note in the top right of the image it has R,G,B for each channel active)
Red: Point Light
Image

Green: Sun Light
Image

Blue: Sky Light
Image

And when they are all turned on together they look like this again, with noting that the only "white" part of the image is the bits on the deck which are in full light of all, Sun Light, Sky Light and Point Light here, anywhere else its just a mix of colours or a single colour if only one type of light is hitting it.
Image


Now the reason your image is white, grey or black only and not a mix of colours like mine is because you've rendered the same light pass for each channel. As per the tutorials, you need to manually turn off the lights you don't want to render, and turn on the ones you do! So if you rendering the sun light, only have the sun light turned on and the sky lights turned off. If your rendering the sky light, turn off the sun light, and tun on the sky lights. You will also need to delete your point light files you've generated with sun light in them, or you can just turn off all the lights and re-render the point light for it to render a blank, black LM but your better off just deleting them to save HDD space from useless files :p
And again, don't forgot to make your lod0 a 1024x1024 LM max and the other lods lower rez too.


BTW it looks like you've modified the GI light positions? you should have left them where they where if you have....
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: 3dsmax Lightmaps problem! Very black outcome.

Post by Mineral »

Thanks to rhino I managed to render pretty nice lightmaps. Current problem I'm facing is that they aren't all showing ingame. In the editor they are all there, but after generating atlases twice still not all show up. For example non of the house_dest series gives lightmaps in game.

But if I check the tai file, then I can see tons of house_dest lightmaps so I don't see why they shouldn't be showing ingame but only in the editor.
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: 3dsmax Lightmaps problem! Very black outcome.

Post by Rhino »

For statics with wreck models, even if they are coded to be non-dest, like the house_dest series, you need lightmaps for both all the geom0 and geom1 lods, even thou geom1 is never seen. If you don't have LMs for all the geom1 lods, then they wont show up in game.

The best solution for this problem is to simply clone your geom0 lods into a new folder, do a bulk rename on them to change them into geom1, and using photoshop do a batch processing task to turn them each into an 8x8px LM so they use very tiny amount of space each, since they are never seen, your just making basic dummy LMs, then its just a matter of moving them back into your main LM folder after doing that and packing them back into your Atlas. Note that some of the wreck geom1s have more lods than normal geom0, in which case, you will need to clone those LMs some more and do some more bulk renaming in order to fill in any gaps as even if you have 1 missing lod off of any of the geoms, none of the LMs will work like how on old Christmas Tree lights, if one bulb was missing or broken, the entire thing won't light up :p
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: 3dsmax Lightmaps problem! Very black outcome.

Post by Mineral »

Nice, at least there are nice auto-rename and photoshop macro's :D

Worked like you said. Still have to do it for some walls but map should be done tomorrow :D yey
Image
Post Reply

Return to “PR:BF2 Community Modding”