Talk:Lighting

From Dragon Age Toolset Wiki
Jump to: navigation, search

Article Updates

Writing here as a scratch pad for topics that could probably go into the main page.

Trying to answer a few of those topics here. Posted on the forums that I want to write a nice big lighting article, but so far no additional hours between the standard 24 have materialized in my days :P ThebigMuh 03:26, 10 February 2010 (UTC)

Character and level lights

There doesn't seem to be a strong emphasis about character vs. level lights. Reading it the first time it sounds like the difference might be between baked and static lights, but apparently there's a property field "Affects Characters" in the light's property sheet.

Characters can't be affected by baked lights (that one should be obvious). Static and Dynamic lights can affect characters (and area placeables) by setting the "Affects Characters" true. Should only be done fore extremely prominent light sources for in-level lights, light for huge bonfires or similar stuff, all other character lighting should be done with separate character lighting rooms (see below) ThebigMuh 03:26, 10 February 2010 (UTC)
Yep, baked lights I understood not affecting the character. It's just the wiki description might make it seem like a static light should. Dedicated character-lighting rooms is an interesting design... probably worthy of a proper write up in the main article or an article of its own even. --FollowTheGourd 14:55, 10 February 2010 (UTC)

Looking at some of the Orzammar level layouts, it seems that the designers made some of the character lights have an incredibly large point radius for point static-lights to assumably light most of the level (100,000 in Orz000d.lvl to even the lava's 5,000,000 in Orz100d.lvl). I suppose the performance for doing that is OK and what matters is how many lights are overlapping or maybe other considerations...? These huge ones are also placed far out of the level, but that might just be for organization reasons given how large they are anyway.

Bioware seems to have handled their character lighting as follows, which works really well, is light on processing power, and very customizible:
The lights in all their rooms are set to only light the level (the default setting). Only exemption are extremely prominent lights - huge fires, a fat ray of sunlight in a dark cavern, similar stuff. To get character lights, they created new empty rooms with a few lights in them, usually a three point setup. Those three are set to light characters only, not the level. Then, through the room properties, the add all affected rooms to the "These rooms are LIT by lights from the currently selected room:" list. Example: Orz700d.lvl, Caridin's Cross. Consists of 12 "normal" rooms, and 4 character lighting rooms. The lighting rooms only contain static lights that affect several other rooms, with each lighting room giving a certain lighting "mood". ThebigMuh 03:26, 10 February 2010 (UTC)
Interesting. The main wiki article makes it less than clear about how rooms are affected by other rooms. In one paragraph it says it needs to be added to a list, while in another it just talks about "visibility". I suspect it still needs to be added to the list though - of course I could just experiment more. --FollowTheGourd 14:55, 10 February 2010 (UTC)

Light Probes

Besides water, is there any easy way to know when you should place a light probe? In the Orzammar levels, they seem to be around lava, but that doesn't appear to be reflective. Armour doesn't seem to reflect things, so I'm not sure what they're being used for here.

Always use lightprobes. And armor actually does reflect things (but only lightprobes), as do stone, wood, snow and pretty much all surfaces in the game. As here: [1] ThebigMuh 03:26, 10 February 2010 (UTC)
Unfortunately there's currently a bug involving multiple light probes: Bug: multiple light probes all generate the same reflection. If there's a workaround, we don't know it. :( BryanDerksen 17:21, 10 February 2010 (UTC)
Hah, no kidding - just checked my level and all light probes show exactly the same reflection map. I didn't notice it because the reflections work nicely for each room in my cave system :) It seems the last probe being rendered gets used, so it's easy to pick one reasonably representative location and make that THE probe for the level. ThebigMuh 19:05, 10 February 2010 (UTC)

Pointers for Num Samples

It seems some of the fires and other baked lights usually have about 20 for Num Samples, where the main article says that should make the shadows crisper. I'll have to play around with that to see the different results, but the levels have so-called "bounce lights" which might be worth writing about if they're a useful design concept.

First of all - I'm 99.98% certain that BioWare used a different rendering engine for calculating their lightmaps than the Yafray thing included with the toolset. Since they are 3DS MAX users, my bet is on mental ray or something similar. There are several options and settings that do not currently get exported to eclipseray via the lightmapper script, most notably normals (horrible!!!), but also other stuff. Num Samples is a candidate for such a non-exported thing. In a normal rendering context I'd say the num samples parameter sets the number of shadow map samples that are taken (which would also fit the description here on the lighting page). Since it's in the "Soft Shadows" category on the light, I'd rather think that it sets the number of sample rays to get soft shadows from are light sources. Doesn't work, btw., and neither does creating an area light source via the Light Size parameter. ThebigMuh 03:26, 10 February 2010 (UTC)

Processing Time

There doesn't seem to be a lot of feedback from the toolset when it's still generating your lightmaps. If you get impatient and toggle showing them, then you might run into an error with temporary directories. For some bigger levels it takes my system about 6 minutes to finish them... I'm sure that'll will vary wildly. In the meantime, I've just opened the windows task manager as an assurance that the process is still running.

6 minutes? Do you have a render farm or something? Calculating a single room can take more than 20 minutes in the level I'm working on, and it has 6 rooms so far :P ThebigMuh 03:26, 10 February 2010 (UTC)
Well... I think that was for the Orzammar Hall of Heroes and maybe some others (can't recall why I wrote "bigger" anymore). It took me about 2h 40m to do the Orzmmar Commons, and that while doing other stuff on the machine as well. --FollowTheGourd 15:01, 10 February 2010 (UTC)
Here's a way to get a bit more feedback from the lightmapper: Go to Tools->Options, select Level Editor, and in the Lightmapper Command field remove the "--terse" part from the command line. You'll now get a log entry for each unwrapped surface that is being rendered. ThebigMuh 04:33, 11 February 2010 (UTC)

Lighting Bugs

OK, lighting is borked for creating new levels. Lets get some conversation going that doesn't get buried under endless posts about making characters bi and taking their clothes off :p I'll start by listing the bugs we have found so far.

  1. The lightmap 'cracks' along chunk boundaries in terrain levels, producing unexplained shadows.
  2. Sunlight doesn't work in terrain levels. An ambient light must be added
  3. Water is broken in game. Looks fine in editor, but non-existent in game.

Reproduction Steps: All steps assume starting with a clean terrain level built with these options:

ExtLevelOptions.png

Base Steps

And all have the following basic steps:

  1. Save the level
  2. Add export area
  3. Define area - set the green square to cover the entire mesh
  4. Add a start point roughly in the center - Possible bug? If I add the start point before the area, path finding will not recognize it.
  5. Set start point in export area
  6. Click Render Lightmaps
  7. Toggle Lightmap on and Fully Lit off to verify there is no light. This confirms bug 2, no sunlight. Unless I've missed where it says sunlight doesn't act like, well, sunlight.
  8. Add a light roughly in center. Change type to Ambient, Postion.Z to 25
  9. Toggle Lightmap off
  10. Hit the Render Lightmap button
  11. Toggle Lightmap back on to verify ambient is working. I have never seen lightmap cracking at this point.

Phew. And I don't really want to admit how many times I've gone through this.


Lightmap Cracking

This one is beating me. I cannot come up with a 100% sure-fire way to force cracking. This time it happened when I did a full local post for the second time. If someone can come up with repro steps, it would be much appreciated. Here's a screen shot of the cracked level. Edit: Messing around and noticed that the cracking happened again on the second Do All Local Posts. However it's 1am so further testing will have to wait.

Edit from Languard:Dug a hole and placed three baked point lights to light it up. After rendering lightmaps and before posting, the lightmaps cracked. Tried to reproduce but on the second time instead of cracking, one chunk became fully lit and completely unaffected by baked point lights.

Edit from Ainiana:In my experience the 'cracked' light map appears to occur when multiple baked lights are applied to the same exterior area. I have also have experienced the 'one chunk unaffected by baked point lights' on another occasion (this only took 1 baked light to reproduce). On all occasions water was not visible in game when testing (using the steps outlined below).

An example of a 'cracked' lightmap.

LightmapCrack.png


We've seen this internally as well, there appears to be a bug with how sunlight is handled. Our lightmapper guru has had the bug passed on to him so hopefully a fix will come along soon but at this point we don't know exactly what's wrong so we can't give any sort of estimate. BryanDerksen 17:49, 16 November 2009 (UTC)

Lightmapping guru here: If anyone sees this happening, please send me the level via our support email. I have played around with sunlight with the lightmapper on my own machine and can not repro it here, so I need your help.

Update 11/24/09: Bug squashed! Head on over to http://social.bioware.com/social.bioware.com/project/717/ to get the new files (you will need the new eclipseray.exe binary)

No Water

  1. Use the deform tool to dig a hole
  2. Right-Click->Insert->New Water Mesh
  3. Drag it over to the hole
  4. Make it large enough to cover the hole
  5. Right-Click->Insert->New Light Probe
  6. Drag light probe so that is roughly centered on the water and slightly above it
  7. Place some small oaks around for reflection
  8. Render Lightmaps
  9. Render Light Probes
  10. Verify that yes, it looks correct
    LevelWater.png
  11. Do All Local Posts
  12. Save and close level
  13. Create new area, set level as layout
  14. Add a waypoint
  15. Override Export starting area
  16. Get into game, verify that water is...missing
IngameNoWater.png


Please, if anyone else has anything to add to this, do so. The more info we can concentrate here, the easier it will be for BioWare to fix this :)

The missing water planes actually doesn't have anything to do with the light mapper, it's a separate system. We've got someone looking at that to see what's going on. BryanDerksen 23:51, 24 November 2009 (UTC)
Found a workaround: Bug: Water plane missing in-game BryanDerksen 23:37, 25 November 2009 (UTC)

Lightmapper Glitch

This glitch appears to be something to do with the configuration of the lightmapper or the script itself.

Chantry2.JPG

It was tested on a BioWare computer in an attempt to figure it out and appeared to work fine there. It may be packaged incorrectly, or there may of been a fault with the installation.

Compiling lightmaps appears to work before a certain amount of props have been added, after which this bug begins to appear. At first, I installed Python 2.6, after which I uninstalled that and installed 2.5. Could this of caused any problems?


~ Shadow180

New lightmapper

We've got a new lightmapper going up at the lightmapper project shortly that should hopefully fix a lot of the issues that have been reported above. Check it out and see if it solves things for you. (It won't solve the missing water plane issue, that's something separate that we're still investigating). BryanDerksen 23:51, 24 November 2009 (UTC)