The Keystone to Great Lighting - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Articles (https://www.frictionalgames.com/forum/forum-40.html) +---- Thread: The Keystone to Great Lighting (/thread-12147.html) Pages:
1
2
|
The Keystone to Great Lighting - Statyk - 12-28-2011 Light. What would the world be without it? Besides "dark", obviously. The point is, light is a big deal when it comes to real life, AND all forms of entertainment. So why would you slack on it? Surprisingly, lighting can make one area either scary, peaceful, serene, or even funny. Light is the key to making a campaign 100% complete. And sadly, more than a few campaigns don't grasp the concept of light, so much, that I'm here to help you out on it. This is NOT a tutorial, I am merely showing you the effects of taking care on lighting an area JUST right and hopefully inspire you to get creative. Don't be afraid to experiment! ~Comparison screenshots can be found at the end of the article.~ First off... Let's go over the types of lights given in the HPL2.. BoxLights Boxlights consume every angle and crevice of an area in light and will end abruptly at the boxlight's edges. It is HIGHLY suggested that you try to keep the boxlight dark, even when covering an exterior area in mid-daylight. This will set a base for shadows when you make a large spotlight, otherwise, shadows will produce a pitch-black silhouette that will make the player lose his sanity... It's daylight out, a shadow shouldn't make him cripple (excluding Sciophobia).
A boxlight that is too bright will also look unnatural. I see this mistake being put into way too many campaigns as a shortcut to putting pointlights. Don't get lazy! Trust me, it will be worth the effort in the end!
I almost never use boxlights, but when I do, it covers an area with a light with settings as: R: 0.1 G: 0.1 B: 0.1 A: 1
Side-Tip: The player loses sanity in dark colors under 0.15... If you would like the player NOT to lose anity, but don't want the room to be lighter, you will have to script: SetSanityDrainDisabled(bool abX);
Which makes it hardly visible. Again, a base for shadows. Colors can be SLIGHTLY altered for matching environment light. For example, a Boxlight at night would have the same settings but blue would be set to something like 0.14, giving an EVER-SO-SLIGHT hue to it. This trick was used in "Oh Silent Night".
Remember, boxlights are more for setting a BASE lighting, otherwise the game will run in pitch-darkness. Blackness such as that should ONLY be used in areas with absolutely NO source of light. Imagine boxlights as the color for all your shadows.
Now, let's move to the next one...
Pointlights Pointlights are the step up from boxlights, setting standards for lighting. They produce light at a center point and spread out in all directions, consuming most edges and areas in light, but not ALL like its Grandfather, boxlights. But this doesn't mean this is the best you can do! I personally, use pointlights around spotlights to make the light fade smoother, this trick was also used in "Oh Silent Night" for spotlights around candles and the fireplace. It CAN be used on candles to make the light range larger, but I suggest only using it in areas with no objects around it. Such as an empty hallway.
These sources are great, but again, not the BEST for complete immersion. It can actually make a place look worse than being completely dark. Use it wisely!
Let's meet the best-man of light.
Spotlights Spotlights are the best sources of light, in my opinion. I use these more than the other two sources of light, as they can be increased in range AND field of view. A great trait! The biggest reason I love these is because they cast shadows in real-time and can turn a mood from poor to great. Everything in the world produces a shadow when a source of light is present, so this is why I refrain from pointlights as much as necessary.
"But Statyk! Spotlights don't spread out in all directions like pointlights, having these on a candle would look terrible!"
Not exactly my friend! To fix this, increase the field of view of the spotlight and duplicate it, keeping it in the same position, but simply rotating it so it fits alongside the other spotlights. Duplicate and repeat! This trick was used in almost every candle in "Oh Silent Night" as well as the Theater Room in "Sciophobia".
So remember, don't be afraid to experiment! Spotlights as well as correct lighting are your keystone to CS-making. Without it, the campaign will fall! _________________________________________________________________
Let's get to some examples through "Oh Silent Night"...
This is in comparison from pointlights to spotlights. I actually have the spotlights flicker a VERY small change in color to represent candle flicker. As well as moonlight spotlights to fade the candle light and show how light bleeds through.
Another comparison between point and spotlights.
Another comparison.
The kitchen was my favorite scene in Oh Silent Night. The kitchen island and counters are actually made of primitives, and primitives don't like to cast shadows, even when spotlights say so. To fix this, I actually hid a black technical plane inside of the island countertop, giving the shadow you see below it. Go above and beyond! __________________________________________________
(cont'd) In Sciophobia:
The last one got cut off, it just showed the amount of arrays. =\ But this is the theater boxroom in Sciophobia. See how spotlights give subtle, but BIG differences, like the banner and sofas? __________________________________________
Errors and bugs of lighting: Here, you can see the pointlights in the kitchen from the demonstration above bleed through the walls and into the bathroom. This is a common issue that sometimes seems unavoidable! But not if you have Spotlights!
In Oh Silent Night, the floors and ceilings were made with primitives. Which, described earlier, do not produce shadows, even when "cast shadows" is selected. So when using spotlights, the light still bled through the ceiling, into the 2nd floor. It was an ugly sight. Placing a large Technical Black Plane (static_objects) in between the floor of the second floor and the ceiling of the first cleaned it all up instantly. You get can an image/understanding by saying the mouse is where the kitchen island is and I flipped the viewpoint of the editor upside-down, so I am looking through the floor, to the ceiling. Again, think outside of the box! __________________________________________________________ Lastly, here's an outside environment with a sunset. A boxlight surrounds the entire area in the color shown in the dark side of the trees. The bright color is actually the VERY large spotlight up at the top of the shot. It's size is actually so large, the shadows of the trees dropped quality BIGTIME... Unfortunately. But I think it still looks decent.
So what to take from this? - Boxlights are helpful, but DO NOT USE THEM FOR SOURCES OF LIGHT. - Pointlights are best for smoothing out lights or in areas with no objects around, such as an empty hallway. - Spotlights are your best friend. They cast shadows and can make a room go from a laugh, to horrifying. - Don't be afraid to tweak the rules and place technical black planes to block light from bleeding into nasty areas. [/align]
RE: The Keystone to Great Lighting - Your Computer - 12-28-2011 I wonder how all the extra shadows would affect performance. RE: The Keystone to Great Lighting - Statyk - 12-28-2011 (12-28-2011, 08:38 PM)Your Computer Wrote: I wonder how all the extra shadows would affect performance.It's up to the player to determine which has shadows and which do not. For example, spotlights pointing at walls from candles should not, as no shadows would be casted anyway. Of course, with a very large map, it is not recommended to put it on every lightsource. But Oh Silent Night was a small area. I suggest only keeping it in places where there are many objects in one place, or where the player will be for an extended amount of time. In the kitchen, they will be circling around, looking for a key, but in the 2nd floor hallway, the lights at the "intersection" are actually pointlights. No spotlights where there, as no objects around and the player simply walks past it. This is to give people an idea on how to blend light into areas properly. I see many campaigns with unmatched lighting and it makes me sad =[ It's up to the creator to wield the sword correctly. RE: The Keystone to Great Lighting - Mine Turtle - 12-28-2011 now i know who to ask if i need a light x) you have serious skill! ^^ RE: The Keystone to Great Lighting - Khyrpa - 12-30-2011 If you carve your keystone full of emblems and markings to make it look good, it will make it weak and the whole structure might collapse. I tested Oh Silent Night's fps on my computer. (The version without the heavy particle effects). With all the spot lights my fps was about 20-50 When I removed every spot light the fps increased to 50-80 That is pretty big improvement in performance. Everyone should agree that frictional knows their engine inside and out and know how to optimize a map. I will gather here some important parts from this extremely great tutorial on wiki, because many seems to not acknowledge its existence or skim through it so fast they miss the important parts. Jens tells the secrets of lighting: "The most common and general purpose light is the Point light, while the Spot and Box are lights for more specific purpose" "The different types of lights make it crucial to use a combination of them to create the right type of light design for your level" "Rotate lamp entities to see how the point light is placed on it inside model editor (its not straight on top of the entity)" "Each room has one light that casts a shadow. What light it should be is chosen by what gives the biggest impact on the room or what would create the nicest effect" "Spot Lights can use a much smaller radius if you place them more efficiently, they do not need to be at the exact correct location. It will not be very noticeable if the light location is not at the window, rather a few meters in and closer to the ground" "Avoid having too many shadow casting lights, in particular try to make sure that two or more shadow casting lights do not cross each other, that really slows down" "When having two or more shadow casting lights close to each other (ingame they will be visible at the same time) lower the shadow quality of the lights" "When using a shadow casting light you can turn of shadows on objects that do not need it. For example the floor, ceiling, walls with no other room behind it, carpets, paper, books in a shelf etc. Everything that is in contact with the light but that does not really cast a visible shadow or a very noticeable shadow. To turn off shadows you select the object and uncheck CastShadows. For entities this is under the Entity tab and for Static it is under the Static Object tab" "A trick when dealing with many shadow casting lights that are close to each other. Turn off all shadows and alpha for the lights and then create an additional light, that casts a shadow and has alpha, make it as large as the area the other lights cover. Then by placing the new light at a good position, you can create the impression of all other lights casting shadows even though it is only the new light that casts the shadow" Many don't seem to know what alpha value in lights mean or just ignore it completely. Try placing a point light in level editor, setting it to flicker from 0 alpha to 1, then rotate around it to see the effect. Having alpha value slows the game down! The lower the overall value of the light, the less visual intensity the alpha value has. You should use alpha value only for lights that have clear visual benefit from it. Box light has no benefit from alpha value! I'm not sure yet if alpha value in box light slows the game, because tutorial says it does, but some of TDD's maps have 1 and some 0. Don't be lazy though and just use the half a second it takes to change it to 0 just in case. When it comes to lamps light leaking through walls, clever placement is the most important thing. Spoiler below!
Dim point lights are your friends! I am merely showing you how to optimize lighting. Don't be afraid to experiment! RE: The Keystone to Great Lighting - Statyk - 12-30-2011 (12-30-2011, 01:16 AM)Khyrpa Wrote: If you carve your keystone full of emblems and markings to make it look good, it will make it weak and the whole structure might collapse.For you: Lol thanks Khyrpa, that's news to me as well. RE: The Keystone to Great Lighting - palistov - 01-02-2012 One way I avoid the performance drop from having a lot of shadowcasters clustered together is avoiding placing lights in spots that would require it to cast so many shadows! For example, that screenshot with the candle on the 2 small tables and the 2 couches next to it? I would just remove one of the couches and move the other slightly farther away, as well as adjusting the small square table appropriately. RE: The Keystone to Great Lighting - Statyk - 01-02-2012 (01-02-2012, 08:36 PM)palistov Wrote: One way I avoid the performance drop from having a lot of shadowcasters clustered together is avoiding placing lights in spots that would require it to cast so many shadows! For example, that screenshot with the candle on the 2 small tables and the 2 couches next to it? I would just remove one of the couches and move the other slightly farther away, as well as adjusting the small square table appropriately.or just set one light facing 90 degrees to one couch, another 90 degrees to the other, and another 45 to the table and leave the rest to a pointlight. =P This way they don't touch/cross each other. RE: The Keystone to Great Lighting - Khyrpa - 01-03-2012 (01-02-2012, 09:17 PM)Statyk Wrote: or just set one light facing 90 degrees to one couch, another 90 degrees to the other, and another 45 to the table and leave the rest to a pointlight. =P This way they don't touch/cross each other.And then at least turn down the shadow resolution of the spot lights! RE: The Keystone to Great Lighting - Kman - 01-03-2012 I've actually seen quite a few people have trouble with shadow quality when they make large spotlights for sunlight.I haven't tried it myself,but a solution to that might be to just duplicate a semi-large spotlight a bunch so you have many individual spotlights closer up, which might solve the problem. I don't know though,it's just a theory, haven't actually tested it out. |