[Help!] Lightmapping a static

Making or wanting help making your own asset? Check in here
Post Reply
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

[Help!] Lightmapping a static

Post by Psyrus »

For now, I think I've figured out what the issue was... Please don't lock this just quite yet, I may still need help on this issue. :)

http://i235.photobucket.com/albums/ee94 ... bad_LM.jpg

I think the picture speaks for itself...

So I've followed Rhino's tutorials and another by the bf2meshview creator over here, but no matter what method I use, the generated lightmaps are always ridiculous.

As far as I can tell, there's no reason why it wouldn't be working fine... The UV on channel 9 and the samples generated look just fine... :x

http://i235.photobucket.com/albums/ee94 ... V_fine.png

http://i235.photobucket.com/albums/ee94 ... s_fine.jpg

Someone... help please!
Last edited by Psyrus on 2012-05-21 15:08, edited 2 times in total.
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Help!] Lightmapping a static

Post by Rhino »

your LM UVs are very close the the UV edge, they should be in from the edges to avoid pixel bleeding. Not to mention very unoptimized and messy but can worry about that bit later on :p

Are you sure when exporting your model you have checked the "Custom LM UVs (No Samples)" or something along thous lines box just above the export button? If not, it will screw up like the above if you have a channel 9 UV.
Image
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: [Help!] Lightmapping a static

Post by Psyrus »

[R-DEV]Rhino wrote:Are you sure when exporting your model you have checked the "Custom LM UVs (No Samples)" or something along thous lines box just above the export button? If not, it will screw up like the above if you have a channel 9 UV.
Thanks for the pointer, but it turned out that doing the same object after it's been screwed up once won't yield the fixed lightmaps. So I added a couple of unmapped versions of the static and they lightmapped fine. But there are big parts that don't get LM'd at all which brings me to.....
[R-DEV]Rhino wrote:your LM UVs are very close the the UV edge, they should be in from the edges to avoid pixel bleeding. Not to mention very unoptimized and messy but can worry about that bit later on :p
I understand the concept of the LM UVs and samples, but I what I can't wrap my head around is how I'm supposed to fit everything in there nicely, especially with so many small faces. They take up like 50% of the LM sheet, which is fine because they do need lighting too, but they need to be bigger (especially the stair faces) if they want to have some meaningful lighting going on. The issue, of course, is that there's no space for them to be bigger without the light "bleeding" >.< (according to the tutorials)

And like how you said it was messy, I'm not really sure what would constitute less messy, since things are organized there according to rough size. There was another option I was playing with earlier that grouped them by material, but it didn't help much and made the space utilization even worse :shock:

And if I have to go through and figure out what each of those tiny little faces correlates to on the model and then resize each one manually to get more light, I'm just gonna go ahead and give up on static objects because I can't in good conscience spend my free time doing things like that.
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Help!] Lightmapping a static

Post by Rhino »

This is the LM UVs for my Camp Bastion memorial static here (note its 2:1): https://www.realitymod.com/forum/f380-p ... 011-a.html

Image

Image

The most important thing is stitching everything together that should be together, especially smooth surfaces as not only will this give you a much better LM result, but it also saves a lot of space as your not wasting space separating everything up, as your keeping everything you can together :D

As you can see the sides etc are all stitched up, and then on the screenshot you can see there is a smooth transition between the shadowy and light areas and the LM for that is only 256x128 pixels which is very low rez for a normal LM, but still looks good ;)

Image

although the bits in the bottom right have been missed out for being too small I've just noticed :(
Image
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: [Help!] Lightmapping a static

Post by Psyrus »

Image

Given my rate of progress it'll take me around a month+ to do all the LODs' LM UVs nicely, so I'm gonna go with FTS and just have un-optimized, bad LMs... but at least they'll work and I'll finally be done with this POS model.

Thanks for your help Rhino, unfortunately, it's beyond my tedium tolerance to be able to do that edge stiching for those hundreds of little faces [x4 LODs]. :)

Edit: Oh great -
BFMeshView wrote:2935 Bad faces encountered, now screwing up your samples!
Please push OK.
Last edited by Psyrus on 2012-05-22 03:19, edited 2 times in total.
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Help!] Lightmapping a static

Post by Rhino »

Its really not as bad as you think and well worth it. I think your problem is how your doing your UVs, which is most likely manually. I do about 80% automatic UVs and then 20% just cleaning up the auto UVs these days, its mainly about knowing how to use the UV tools effectively but unfortunately, I don't know of any decent tuts on it as my methods I've basically just taught myself over the years :p
Image
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: [Help!] Lightmapping a static

Post by Psyrus »

[R-DEV]Rhino wrote:Its really not as bad as you think and well worth it. I think your problem is how your doing your UVs, which is most likely manually. I do about 80% automatic UVs and then 20% just cleaning up the auto UVs these days, its mainly about knowing how to use the UV tools effectively but unfortunately, I don't know of any decent tuts on it as my methods I've basically just taught myself over the years :p
Hmm, ok well I guess two final questions would be:

(1)
Given the UV image in the OP, what length of time [or is a reasonable time] would you expect to take to make good LM UVs for all 4 LODs?

(2)
Do you keep a uniform texel(?) ratio or do you often scale up smaller parts of your model to get better lighting, and scale down things like big faces because they don't need as many samples to be lit reasonably accurately? That seems to be the only way I could get my model's stairs & spherical lights mapped nicely.......
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Help!] Lightmapping a static

Post by Rhino »

Psyrus wrote:(1)
Given the UV image in the OP, what length of time [or is a reasonable time] would you expect to take to make good LM UVs for all 4 LODs?
Well tbh I can't give you a very good answer to that because the way I work, I in fact do my light map UVs before anything else (although I don't finalize them until the very end, but the UVing part and basic packing is done before anything else) and then everything else is based off my LM UVs, colour, detail layers etc, overall saving me time from re-re-re-UVing the same parts over and over again with just the odd modification made here and there where needed, although main difference is scale and positioning, most things are kept stitched up etc :)
Psyrus wrote:(2)
Do you keep a uniform texel(?) ratio or do you often scale up smaller parts of your model to get better lighting, and scale down things like big faces because they don't need as many samples to be lit reasonably accurately? That seems to be the only way I could get my model's stairs & spherical lights mapped nicely.......
I do all my initial LM UVs in non-normalized mode (ie, the "normalized" or something box that is always checked as default I uncheck), so everything is to the correct scale it should be and if I need to re-do any small part, I know it will easily stitch back onto another bit or w/e.

When it comes down to final packing UVs, I only really scale upwards to fill empty space, I don't normally scale down anything unless its a very slight amount just to fit it into a small space which will overall benefit the rest of the UV :)


At some point I'm seriously going to have to do a tut on how I do my UVs now, as well as many other of my little tricks but not sure where I'm going to find the time :(
Image
lucky.BOY
Posts: 1438
Joined: 2010-03-03 13:25

Re: [Help!] Lightmapping a static

Post by lucky.BOY »

Just a question about workflow, it is better to do lightmap UVs before LODs, right? As I suppose you can then fairly simply fix UVs for the next LOD where verts got welded, as opposed to having to do the whole UV all again. Is this true?
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Help!] Lightmapping a static

Post by Rhino »

Its best to do the basic LM UV with them in non-normalized format so that any errors crated by making the lods are then easily fixable, then when all the lods are done you just need to scale down and pack the UVs into a single tile :)
Image
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: [Help!] Lightmapping a static

Post by Psyrus »

So I went through and did it by hand... what a terrible process. From now on I'll always follow your idea of doing the LOD0 lightmap manually then just tweak the lower level ones.

New problem! YAY!

So somehow on my LOD0, while doing the lightmaps I messed with something and on my front windows, the normals are flipped/broken which results in the corners of each window being dark (and letting light through).

Is there any way to fix the normals? I've watched youtube videos and they haven't been particularly helpful for what I want to do. There's the ability to flip polygons, but I just want to flip individual normals around.

I can't believe what a PITA this process is. Modeling is the easiest freaking part of the process. Everything else is an absolute nightmare.
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Help!] Lightmapping a static

Post by Rhino »

got a pic so I can see what your on about as "normals" can mean many things...
Image
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: [Help!] Lightmapping a static

Post by Psyrus »

[R-DEV]Rhino wrote:got a pic so I can see what your on about as "normals" can mean many things...
Sure thing :) Note the shading around the area. At first I thought it was a smoothing groups issue but I tested many settings with the smoothing groups and none fixed it.

Image

Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Help!] Lightmapping a static

Post by Rhino »

it looks like a smoothing group error to me.. Try selecting on the outer faces and do an auto smooth on it.
Image
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: [Help!] Lightmapping a static

Post by Psyrus »

[R-DEV]Rhino wrote:it looks like a smoothing group error to me.. Try selecting on the outer faces and do an auto smooth on it.
As I mentioned in the post, I already tried that. I'll give it another shot and report back.

Edit: Yep, it did nothing.
Last edited by Psyrus on 2012-05-29 16:17, edited 1 time in total.
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Help!] Lightmapping a static

Post by Rhino »

can always try clearing all smoothing groups too from thous faces, that should fix it too :)
Image
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: [Help!] Lightmapping a static

Post by Psyrus »

I figured out how to fix it. I have to delete each of the affected vertices, and make a new one on a different edge then reconnect them. This gives the vertex the proper normals and allows it to be smoothed properly. Thanks for trying to help anyway, Rhino.

You should seriously get an award for most helpful guy ever :D

Edit: This means just 1 more day until my static is done! woot!
Last edited by Psyrus on 2012-05-29 16:27, edited 1 time in total.
Pvt.LHeureux
Posts: 4796
Joined: 2009-04-03 15:45

Re: [Help!] Lightmapping a static

Post by Pvt.LHeureux »

It took so long to make that one, better be in PR :)
Image

Chuva_RD : You want to remove bugged thing but dont tell how to fill formed void.
Psyrus
Retired PR Developer
Posts: 3841
Joined: 2006-06-19 17:10

Re: [Help!] Lightmapping a static

Post by Psyrus »

Pvt.LHeureux wrote:It took so long to make that one, better be in PR :)
I don't have a lot of free time, and what I do have, I use in other ways like socialising and actually playing PR... plus I moved cities and workplaces in the middle of making this one. This would've taken a good modeler/exporter maybe a week in their free time I reckon. It took me like 4 months :P . The amount of time taken is not representative of the quality, but I hope it's at least up to standards.

I'm still learning though, each day I get more efficient. And despite my moaning, I do quite enjoy it :)

Next up will be the enter-able version. That should go much quicker since I learned from my mistakes on the sealed one.
Pvt.LHeureux
Posts: 4796
Joined: 2009-04-03 15:45

Re: [Help!] Lightmapping a static

Post by Pvt.LHeureux »

Yeah, this could be the kind of static used in USA maps or some European cities one ;)
Image

Chuva_RD : You want to remove bugged thing but dont tell how to fill formed void.
Post Reply

Return to “PR:BF2 Community Modding”