Aller au contenu

Photo

Lighting for dummies (Q&A)


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
AmstradHero

AmstradHero
  • Members
  • 1 239 messages
For anyone who originally read this post... I've changed it significantly. So, now this post is part tutorial, part question.  For simplicity's sake, I'll assume everyone has configured the toolset so lightmapping works.  So, for a simple rundown on lighting an exterior area:

Basic glossary: (partially taken from wiki, and expanded upon in order to provide a "simpler" explanation)
Baked light - this is a light that is pre-calculated when you hit the "generate lightmaps" button on the toolbar.  This only affect the level layout as you create it in the level editor. It will not have any effect on items placed within the area editor, nor will it cast shadows for any moving object/create - e.g. the player.
Dynamic light - this will affect the player only.
Static light - this is a non-moving light that is pre-calculated when you generate lightmaps, but ALSO affects placeables and moving objects, which is calculated during gameplay. Too many of these can cause a slowdown in framerates.
Animated - this is a light that can change its properties but not its location. It is not precalculated..This light can be used to simulate the flickering light from (for example) a fire or candle.

Questions:
a) How do you configure the shadow settings of each light places to configure their color/intensity?
B) Do dynamic and static lights casts dynamic shadows for the player/creatures?
c) Do animated lights cast shadows?

Step 1
Create your export area using the purple plus in the toolbar.  You can then use the "Exportable Area Properties" dialogue box to configure the sunlight/moonlight for the area.  Use the "set Sunlight" button to set it's direction, and then the Color/Color Multiplier options to set its lighting.

Questions:
1a) What does "Char. sunlight can be occluded do, exactly/"
1b) What does character color do?  I can only assume it is for lighting the player as a default static light for the area. Is this correct?

Step 2
Create an ambient light.  You should only have one of these.  Apparently this is used to set the shadows from the sunlight.  The suggestions I've read say to pick a dark blue.  I have no idea what the color intensity should be.  In fact, while I've been able to produce satisfactory results, my changes to the ambient light didn't seem to modify the base shadows much, if at all.

Questions:
2a) What does the ambient light actually do?
2b) How do you change the intensity/color of the shadows for the area's sunlight?

Step 3
Create a light probe.  Without a light probe, you cannot show any reflection, and the game cannot calculate how to illuminate characters. (That means the player, among others)  As far as I can tell, you only need one light probe, and all you have to do is place it in the area. You may want/need multiple light probes if you've got several bodies of water in your level, but I haven't experimented with it, so I can't say for certain.

Questions:
3a) Are multiple light probes ever needed/useful? If so, why?

Step 4
Render your lightmaps and see what they look like.  Click the render lightmaps button, and wait until the process is finished (it may take a while, depending upon your computer). In the view settings (between area export and the speedtree rendering distance) there are two buttons you are interested in. The first is "View Models Fully lit" which is probably on. You want to turn that OFF. The second is to its left, and is "Display lightmaps on/off". You want that ON.  Note that if you've just regenerated your lightmaps and that is on, you will need to turn it off and back on again for your results to display.

Step 5
If you want to lighten specific areas (and in most cases, you do), create additional light sources to lighten them.  Point lights are the most generally used/useful lights in computer game lighting. Imagine them as a single lightbulb emitting a light of your chosen color within your chosen radius. Obviously, as with a light bulb, the closer an object is to the light, the more light it will receive.  Check out the single player levels for some guidance on how to do this for some examples on how to do this.

Step 6
Repeat steps 4 and 5 until you are happy with the lighting for your level. This may take a while.

Questions:
Is there anything else I have forgotten? Any other salient points of wisdom from lighting gurus?

Modifié par AmstradHero, 04 avril 2010 - 08:36 .


#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
For interiors,
1) You need to make sure that rooms are connected via the Room Properties button at the top right of the toolbar. This will allow you to configure which rooms are connected and which rooms receive light effects from other rooms. Without configuring this, you will not be able to see into physically connected rooms - not even the ambient lighting will show up
2) Going by the same logic above, it is generally useful (or mandatory?) to have a light probe for each room which will be based on the light effects in that room
3) I believe for interiors, you should not set a skydome model.

Tip: If, after rendering lightmaps, you see a lot of black shadows in the level editor, you can do one of two things:
a) Close and re-open the toolset and re-open the level. If that doesn't help,
B) create an area based on the level and make sure to turn on in-game lighting (the icon with the sun at the top). This will show you the lighting as it will appear in-game.

Tip: Generally, evident light sources like torches or flames require a Baked light (for level art) and a Static light (for designer resources and creatures). However, if you have these light sources close by - eg: on opposite sides of a single floor tile, you can have just one static light in-between the Baked lights. This will give a similar lightmap as having 2 static sources and help performance (especially if you have a large number of such light sources).

Modifié par TimelordDC, 05 avril 2010 - 04:56 .


#3
Challseus

Challseus
  • Members
  • 1 032 messages

TimelordDC wrote...
2) Going by the same logic above, it is generally useful (or mandatory?) to have a light probe for each room which will be based on the light effects in that room


I'm pretty sure there is a bug where you can only have one light probe. I guess, whatever is the last one you place down, that's the one the level uses. I'll try to dig up Bryan Derksen's post about it.

#4
TimelordDC

TimelordDC
  • Members
  • 923 messages

Challseus wrote...

TimelordDC wrote...
2) Going by the same logic above, it is generally useful (or mandatory?) to have a light probe for each room which will be based on the light effects in that room


I'm pretty sure there is a bug where you can only have one light probe. I guess, whatever is the last one you place down, that's the one the level uses. I'll try to dig up Bryan Derksen's post about it.

Yep, I recall reading something about that but I do not remember what the bug actually refers too. I have an interior level with 2 light probes in different rooms and the lightmaps render just fine. I didn't actually check the reflection on the light probe - will do that when I get home and post.

#5
TimelordDC

TimelordDC
  • Members
  • 923 messages
I checked my 2 light probes and both have the same reflection as the last one placed. Guess it is bugged.

I hope this gets fixed though since the Single Player campaign does use different light probes and it helps when you have dark rooms or rooms with different lighting colors/effects.

#6
Challseus

Challseus
  • Members
  • 1 032 messages
*Fingers crossed for next toolset update to fix a whole host of lighting issues*

#7
JasonNH

JasonNH
  • Members
  • 237 messages
One thing to keep in mind for planning purposes is that you can only have one static light active in any given chunk. You can, however, have multiple baked lights in the same chunk where a static light is active.

Just few other things I'll add that I've learned over time:

Placeables take the longest time for the lightmapper to process. Since I often playtest my areas under development to check out texture, vegetation, and atmospheric appearances, I will usually disable the lightmaps on my placeables to speed up the process. You can set the lightmaps to "FALSE" under their properties and save a lot of time if you don't really need them for a playtest.

Even though the toolset does not have instantaneous visual feedback for baked lights, you can take some of the guesswork out by setting them to be static and adjusting the color and intensity until they look good, and then set them back to baked lights. Although it doesn't correspond exactly, it does get you close enough so that you can just tweak it a bit from there.

The fog settings can also significantly affect how bright an exterior area can "feel". If you plan to use it for purposes of limiting the far plane or adding some haze to your area, you may want to settle on your choices early and have the atmospheric settings enabled in the toolset while you are trying to get your lighting correct. Otherwise, you may find it doesn't look right once the fog is in place.

#8
TimelordDC

TimelordDC
  • Members
  • 923 messages

JasonNH wrote...

One thing to keep in mind for planning purposes is that you can only have one static light active in any given chunk.

Is this a limitation of the lightmapper script released for our use? Because the Single Player levels have multiple static lights in one chunk.

#9
-Semper-

-Semper-
  • Members
  • 2 256 messages
yes. the given lightmapper isn't exactly that good. it will do the job but we have to live with many restrictions.