Frictional Games Forum (read-only)

Full Version: A Different Lighting Tutorial?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Perhaps a video? I'm finding it hard to understand the current lighting tutorial on the HPL2 wiki. I've got a basic idea of placing lights, as well as using spot lights, but I have no real understanding of box lighting and point lighting.

If someone could link me to a good tutorial, I would really appreciate it! I'm starting to understand more of the editor itself, so any help on lights would be awesome. Smile

-Kw
In quick:
Boxlight:
area inside the box has light.
Pointlight:
The light object emanates light. Much like lamp. Without the actual lamp.
Spotlight:
Spotlight/flashlight kinda light that emanates light only to one direction.

Increase radius if you can't see the light.
Box-light is artificial. It lits a boxed volume with no attenuation. Kinda like
an ambient light with limits.
Point light is a "point in space" that emits light to every direction from the point. Usually it has attenuation. I think Amnesia has quadratic attenuation , but it could be linear(not very natural) and other types of non linear attenuation based on some funky formulas Smile
Spot light is point light that has limits and direction. Basically if the dot product between the ray from pixel in world space to the light position and the direction ray of the light itself is greater than some value, then the pixel is not lit. There could some attenuation by distance from the light and distance from the center of the light spot etc.
Directional light (sun light) has no position, only a direction, but I think HPL2 does not expose these.
Alright, that was more of a help. If someone can answer this though, I would appreciate that.

1. How do I have a point light not show in game? How do i have the point light turn on when i light another source with a tinderbox? I know about attaching entities to the point light, but it always looks weird with the point light already showing.

2. My point lights always seem to bright or too dim. I can't seem to get a good medium of ambient light. Any tips?
(10-13-2010, 10:00 PM)Kaizerwolf Wrote: [ -> ]1. How do I have a point light not show in game? How do i have the point light turn on when i light another source with a tinderbox? I know about attaching entities to the point light, but it always looks weird with the point light already showing.

2. My point lights always seem to bright or too dim. I can't seem to get a good medium of ambient light. Any tips?

1- Simply set the light to inactive, or set it to have a (0,0,0,0) color.
1.1- In the lamp entity there is a way to assign a light source to that lamp, and when the lamp lights a percentage of its light goes to the light source. This is all done in the entity of the lamp.
One lamp can only be assigned one light but one light can be assigned to many lamps. Remember that if you have 3 lamps all connected to one source transferring 0.3 (30%) light you will end up with a sun.

2-This is how I light rooms. There are many ways and people that do it differently. Don't by any means take this as a must follow or a rule. It all comes down to the type of place or mood you want.

First engulf the hole room with one or more (for complex shaped rooms) very dark box lights. If you use more that 1 box light make sure they don't overlap or leave a gap, it will look unnatural. By very dark i mean 0.05 at max. Having a room where sanity just doesn't drop, without dark corners makes less scary gameplay. Unless there is an enemy. Then there is just no place to hide. Only use big box lights in small zones or in Hub levels.
Now had spotlights on windows, fireplaces, etc.
Finally place lamps and light them. The light of the lamps will look unnatural so correct it using point lights: in a hallway with on light on each side, a single point light in the middle of the lights will do the trick. These point lights are 100% dark, and receive light when the player lights the lamps. I generally make it so all the lamps together won't exceed 0.3 light transfered. Example: 0.1 from each with 3 lamps. Now just set some lamps already lit to help and your done. How much lamps are lit and how many there are depend on the type of room you want. Be sure to try out all the rooms by lighting all the lights one by one and adjust accordingly. No one get a correct light on their 1st try.

Make sure no light casts shadows. ONLY enable shadows on important lights places for a good visual effect. For optimization set the floor and carpets to not cast shadows. A good looking laggy level isn't good.
Set 1~3 shadow lights per room. The more shadow a light casts the more hard it is on the machine.
Never, unless in a very small level, make lights casting shadows cross each other. This will slow down big time.

Advanced tips:
.Creating a red light makes a realistic fire type light (from a fireplace example).
.Dark bluish lights make for a night time light.
.Green lights are best saved to make strange effects.

-Lights can flicker. This means they will can go from a light with a color A to a color B. You can set how often they change and how random the time can be. The change can be made in a instant, or by slowly fading. You can also adjust the fade time and make it a little random. The second light can also have a smaller radius than the original. I use this in spotlights, to make it seem like its nighttime and the color changes slowly and slightly from dark blue to a lighter blue.
I also use this to make fireplace spotlights. Change the color from a more yellow to a red tone with a small fading time and a random duration also small. To make the final touch i also change the radius of the second light, to fake the cracking of fire.
To do all this go to the light and on the option flicker set it to active. Change the self explanatory values. Fading is done the same way just bellow the flicker option. Just test until you get what you want.

-Placing a light in a important place, like near the handle of a hard to find door or on a desk with a note will make it easier for the player to find what to do next, and where he needs to go. These lights must always be very dim and placed carefully to not look unnatural. This works when there is no other lit light source near. Can also work with decals (ex: blood trail).
A nice effect you can script is a light disappear when the player picks the designated item. Like a glowing diary entry or a key shining.


Long post is LOOOOOOONNNNNNNGGGG, only made longer by this. Still no match for LONG cat...
Hello. I took this advice to heart, and made another level. If anyone is willing to try it out and see what I've done, that would be awesome. I havent made any real dark areas, I mostly focused on making brighter lights. I'll likely expand on this level, as I like where it's heading.

Download the level here; http://www.sendspace.com/file/7r4o6x