Joined: Sep 2011
RE: The Keystone to Great Lighting
(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.
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.
Dim point lights are your friends!
I am merely showing you how to optimize lighting. Don't be afraid to experiment!
Lol thanks Khyrpa, that's news to me as well.
|12-30-2011 02:15 AM