Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Different Lighting Tutorial?
Author Message
Kaizerwolf Offline
Junior Member

Posts: 45
Joined: Oct 2010
Reputation: 0
Post: #1
A Different Lighting Tutorial?

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
10-13-2010 01:18 PM
Find all posts by this user Quote this message in a reply
ide Offline
Junior Member

Posts: 20
Joined: Oct 2010
Reputation: 0
Post: #2
RE: A Different Lighting Tutorial?

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.
10-13-2010 01:33 PM
Find all posts by this user Quote this message in a reply
locker Offline
Junior Member

Posts: 14
Joined: Sep 2010
Reputation: 0
Post: #3
RE: A Different Lighting Tutorial?

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.
10-13-2010 07:08 PM
Find all posts by this user Quote this message in a reply
Kaizerwolf Offline
Junior Member

Posts: 45
Joined: Oct 2010
Reputation: 0
Post: #4
RE: A Different Lighting Tutorial?

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
Find all posts by this user Quote this message in a reply
HakePT Offline
Junior Member

Posts: 49
Joined: Sep 2010
Reputation: 0
Post: #5
RE: A Different Lighting Tutorial?

(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...
10-13-2010 10:57 PM
Find all posts by this user Quote this message in a reply
Kaizerwolf Offline
Junior Member

Posts: 45
Joined: Oct 2010
Reputation: 0
Post: #6
RE: A Different Lighting Tutorial?

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
10-17-2010 02:26 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)