Author Topic: Lights, Meshview, and other crap.  (Read 1191 times)

Offline [130.Pz]S.Lainer

  • FH-Betatester
  • ***
  • Posts: 1.934
    • View Profile
    • 130th
Lights, Meshview, and other crap.
« on: 18-08-2011, 22:08:59 »
Well first off this is what I think is the root of my problem.

http://www.bfeditor.org/forums/index.php?showtopic=12557

Or for those to lazy to read the link......



Any ideas?

This may be a related problem but I am not sure if I am even doing this right.  Okay so I have my happy house and some happy furniture and some happy lightsources from here D:\Program Files (x86)\EA GAMES\Battlefield 2\mods\fh2\Objects\Common\lightsources\houselight_small.  So now I line up my lightsource with my light fixture and it floods the room with light and looks very pretty.  Wonderful!  So then I lightmap the whole building complex only to have the bullshit I mention above pop up as well as couple other similar lines of crap (some having to do with light points as well).  After the editor is done fucking itself all I can really do is generate my atlas and exit out. 

Only to find my nice well lit room looks like this in game.



The house I did not lightmap but put a light source in looks fine however.



Get back in the editor and it is the same shit.   Lights look fine on non-lightmapped objects but don't show at all on my lightmapped bits.  I guess my real question here is whether or not I am even doing this right from the start or if it is a part of the problem in the first part of my post?

Ok and now for the meshview bit.  I made samples for all the parts of the sub pen and all seemed to work wonderfully....Well except the main structure.  Most all of it lightmaps pitch black.  Now there are a bunch of settings to this program in regards to doing up samples but I have no clue how to use any of them so I have resorted to just hammering on the "okay" button like a retard with a drum set.  If someone can nudge me in the right direction that would be swell.  I could even zip up the objects and let you have a look at them if it would help.



Not a very helpful picture because I already deleted the old lightmaps in a fit of rage. 
http://www.bfewaw.com/campaigns/waw24/promo/campaign/waw24banner1.png
The purpose of this deployment was to "annoy and defy the United States ... on her with Bofors 40 mm guns from a range of 650

Offline Natty

  • Developer
  • ******
  • Posts: 3.170
    • View Profile
Re: Lights, Meshview, and other crap.
« Reply #1 on: 19-08-2011, 10:08:35 »
To make houses nicely lit like on PeB, Phl, Anctoville etc:

Place like you did, a dynamic lightsource (which casts light on objects in editor) place the lightsource ~20-30centimeters, (that's ~10 inch you americanO) below the lamp that is supposed to cast the light. Then take the lamp, and shove it down underground. This is because if the lamp is too close to the lightsource, you will get ugly, blocky shadows from the lamp, on the roof or wall.

Do this now for all lamps/lights on the map. SAVE NOW

Once done, you select all the objects which will be affected, meaning the houses, furnitures, everything. Do a classic ctrl + left-click to mark many objects.

Make sure the Object Lightmap settings in the Tweaker window is correct, dont use too wide FoV, 10 is OK. GIFillLights > 0.45
Once all are selected: Lightmap > Selected > Final.


Then lightmap. Once Lightmapping is done, I too get the bug in your screenie. It is the editor losing connection with the viewport. Just CLOSE EDITOR WITHOUT SAVING.

Restart Editor: Select one dynamic lightsource then click > Select all > Replace all > replace with "Glow" which is vanilla object that does not contain dynamic Lights.

Once all the dynamic lightsources are replaced with Glow, you need to fly around and raise back all the lamps to their proper position.
Look at the map Lightsettings; check "singlepoint color" This is the color of the light which appears on lightmapped objects > Set it to a pale yellow or so, depending what you want.
(Technically: A lightmap object .dds has three channels, R,G,B. Dynamically lit areas use the R channel. Open a lightmapped house .dds and look at it, you see the pink areas? That's the Red channel. View only the red channel and you see the white parts, this is the light. These areas are where the SinglePointColor is affecting)

SAVE NOW. Now Lightmap the lamps themselves. Then compile Lightmap Atlases, then CLOSE EDITOR WITHOUT SAVING.

Go Ingame. you should see the Glow as the lightbulb, and the nice light on walls, floors etc.

That's my technique at least.

PS:: Dynamic lights does not look so nice ingame. That's the reason most of our maps use Glow to visualize the lightbulb, and pre-rendered lightmaps to visualize the lights.
+ This also means that players with "Dynamic lights" turned off in menu, will still see the light.
+ The dynamic lightsources also cast a light that doesnt belong in 1940. It is more fitted for vanilla BF2 street-lights or high-voltage lights of 1000W or so...
+ Pre-rendered lights is better for performance as well
We could develop more soft and warm dynamic lights for oil-lamps and old lightbulbs, but we haven't.
« Last Edit: 19-08-2011, 11:08:00 by Natty »

Offline [130.Pz]S.Lainer

  • FH-Betatester
  • ***
  • Posts: 1.934
    • View Profile
    • 130th
Re: Lights, Meshview, and other crap.
« Reply #2 on: 19-08-2011, 17:08:59 »
  Ohh happy days are here again!  Thank you so very much Natty.  Just about to head out for couple days but my initial dicking about with this looks promising.  Looks like those dynamic lights actually did bake themselves onto the lightmap when I did it after all.  They just did not show up because I had my singlepoint light set to black.  But since I left the fixtures it looks like poop.  When I get back I will do it up like you posted.

Thanks again!
http://www.bfewaw.com/campaigns/waw24/promo/campaign/waw24banner1.png
The purpose of this deployment was to "annoy and defy the United States ... on her with Bofors 40 mm guns from a range of 650

Offline [130.Pz]S.Lainer

  • FH-Betatester
  • ***
  • Posts: 1.934
    • View Profile
    • 130th
Re: Lights, Meshview, and other crap.
« Reply #3 on: 11-09-2011, 11:09:01 »
Mutha fucking bump!

A wonderful dev/angel/god by the name of Herc just got me straight on the lightmapping bit for the sub pens from shitty ass Dice.  In BFmesh use the following variables.

Size           512
UV Channel 4
Padding      2

And all your Dice Canada dreams will come true. 
http://www.bfewaw.com/campaigns/waw24/promo/campaign/waw24banner1.png
The purpose of this deployment was to "annoy and defy the United States ... on her with Bofors 40 mm guns from a range of 650

Offline Natty

  • Developer
  • ******
  • Posts: 3.170
    • View Profile
Re: Lights, Meshview, and other crap.
« Reply #4 on: 11-09-2011, 16:09:37 »
they aren't shitty asses just because they didnt release .samples files for the booster packs  ::)

Offline [130.Pz]S.Lainer

  • FH-Betatester
  • ***
  • Posts: 1.934
    • View Profile
    • 130th
Re: Lights, Meshview, and other crap.
« Reply #5 on: 11-09-2011, 22:09:58 »
Well they can't be to awful shitty if I am this jacked over stealing there crap.   ;D
http://www.bfewaw.com/campaigns/waw24/promo/campaign/waw24banner1.png
The purpose of this deployment was to "annoy and defy the United States ... on her with Bofors 40 mm guns from a range of 650

Offline Herc

  • Developer
  • ******
  • Posts: 110
    • View Profile
Re: Lights, Meshview, and other crap.
« Reply #6 on: 21-09-2011, 14:09:38 »

Size           512
UV Channel 4
Padding      2


padding should probably be higher like 5-6 but the UVs were pretty tightly packed. hopefully no lightmap bleeding occurs