PDA

View Full Version : Matching light props with their sources


m0_fugga
07-31-2007, 12:40 PM
Ok, keep in mind, I am a noob with Hammer. I am building my first map and I have added light sources and am trying to pair them up with the light props so that the light isn't disembodied but it's not working out well. If I put the light source directly below the bulb (in the prop) the bottom of the bulb is lit up but the top of it is not. If I put it above the prop, the top of the bulb is lit up, but the bottom is not. I would like for the light to appear to be emanating from within the bulb as would be expected.

Another problem I am having is that many materials appear to fluoresce under these lights as if a white shirt would fluoresce under black light.

Any ideas would be greatly appreciated.

deadollie
07-31-2007, 12:54 PM
Have you tried going into the properties of the light entity (Alt+Enter) and setting its parent to the light source prop?

This might work... i know it will to make lights that you can pick up with the gravity gun

m0_fugga
08-01-2007, 11:17 AM
Ok, cool. Kinda like when you Tie to Entity to create a buyzone? I'll check that out and let you know if that works. Thanks, btw...

Anyone have any ideas on the fluorescing lights?

Kev_Boy
08-01-2007, 11:59 AM
There's absolutely no reason to do this, just make the light sit just on top or in front or below the model. It'll look fine :)

m0_fugga
08-01-2007, 12:17 PM
Kev:

That is what I was trying to do and it's not working out well. Does anyone know of a repository to put works in progress so that others can check them out first hand to see what I am talking about?

Kev_Boy
08-01-2007, 12:50 PM
Try cramming an env_sprite point entity inside the bulb giving the illusion that the bulb is giving off the light :)

gulliwog
08-01-2007, 12:58 PM
I think I know what you are talking about. I used a light bulb prop once that was grey and unlit on top when I put the light entity underneath. I think though that its just that particular prop.

If you look in your model browser you will notice that some light model props have "lit" and "unlit" versions. In the "lit" version the bulb itself seems brighter, almost self-illuminating, elminating the problem you are talking about. I just assumed that the prop I had chosen was not suppost to be used as a lit blub prop. You are simply seeing you light entity casting shadows on your prop.

Change the prop would be the easier solution. Other wise play around with the prop set-up, try disable shadows, but i'm not sure it would work. Otherwise put in two light entities, one above and one below the prop, to light it from both sides...

GuLLiWoG

PS. Have you checked your map for leaks? Are you trying to use dynamic lights? Thats often why things go fluorescent.

m0_fugga
08-02-2007, 05:23 PM
How do I check for a leak? Is there a log or something somewhere I can refer to? I don't believe I am using any dynamic lighting...

Spider-Baby
08-03-2007, 03:41 AM
yes, go to map -> load pointfile and it will show you if there is a leak or not. if you're using an entity called light_dynamic, that is dynamic lighting, and they are extremely fussy, i wouldn't recommend using them to any but a very experienced hammer mapper. in the model browser, check the "skins" to see if there is a lit version of the model, or it may be just a completely different one.

PuddingWagon
08-03-2007, 07:21 AM
Firstly, put the light ('light' entity) slightly below (say ~4 units) the bottom of the model (NOT inside), give it a brightness of around 40 (depends on brightness of scene of course) and also give it a maximum distance of about 128 (so it only really affects the light prop, it will still do full distance for pre-compiled lighting).

Secondly, use a light_spot entity, pointing downwards, which is as close as possible (the 'x') to the bottom of the light prop without touching it. Use this as the actual light, since it looks better (may not seem realistic but it does suit games better). Set the outer distance and inner distance according to the type of light prop you are using, and of course point the light_spot in the right direction (turn on helpers - default on - to see the approximate light cone). The brightness should be around 500 for a reasonably bright indoors room (trial and error until you know what value does what really, needs a higher setting than the 'light' entity).

Thirdly, use an env_sprite which is as close as possible to the light model to give it a light halo. This shouldn't be inside the prop, since it just makes doing the rest harder and buggier. Set the Render Mode (I think, doing this without Hammer. Look around in the properties for what you need to set it to) to World Space Glow. Then select a sprite texture (make sure you add '.vmt' to the end of the sprite name, otherwise it won't show up in game, in Hammer it does though). The sprite scale is to your liking, you get a reasonably good preview in Hammer. Set the colour of the sprite to the same colour as your actual light (ie light_spot). Look around in the property window for anything else that might be relevant to your map, remember the 'Help' button in there does actually show what the properites do.

Fourthy, check to see if there is a lit skin, or a similar model with a lit skin. It does help the illusion of lighting a bit (the env_sprite does make up a bit for it though).

There we go, should be working fine now unless there is something weird with the model (in that case just move the entites away from the model a bit). Remember, you probably notice this more than anyone playing the map would, so don't waste too much time on the specific lighting of the model. Even in some Valve maps there are some dodgy things happening, but you just don't notice it unless you're looking for it.


Oh and if you want somewhere to upload files (eg vmf or bsp) then you can use Megaupload (http://www.megaupload.com/, there are other sites as well) to temporarily store the file (does get deleted after a certain time, so don't use it to store stuff as backups).

gulliwog
08-03-2007, 07:24 PM
At the risk of polluting the thread, as you've been talking dynamic and spot lights... I have had a lot of trouble getting these to work in maps.

Dymanic lights just tend to give a white fluo effect on the player, but no lighting. The same with spots, or more often nothing at all.

Compiling in LDR or HDR should make no difference to these types of lights, no? I compile in LDR for the moment, I'm still learning! Is there a trick to using these lights? I am quite careful about looking at the setup when I put entities into my maps

GuLLiWoG

PS Is it worth putting the env_sprite with ALL lights? Does it make them look more realistic?

Kev_Boy
08-04-2007, 04:13 AM
Sprites render like peanuts in a scene of a lush amazonian jungle. No... I do not know whether the amazon has peanuts ;)

Just saying... it is very much so worth it!!!

PuddingWagon
08-04-2007, 07:36 AM
gulliwog,
not sure what the problem is with the dynamic and spot lights, no idea what a white fluo effect is (does the lighting just look wrong?). Check the flags page on the dynamic light, it could be defaulting to off or something similar.
If you aren't getting any light from a light_spot, then you probably haven't positioned it right. It is probably getting blocked by a model, try temporarily deleting the model/clearing any brushwork that could block the light, then test. Remember, the light is cast from where that yellow line (in Hammer) comes from (starts at a little 'x'). Also check that its all pointing in the correct direction, the brightness is set correctly and you haven't gone at or above 90* for the inner/outer angles (inner<outer).

On your env_sprite question, you can use it for all, or at least most. It does make them look a bit better imo, but again it's all up to what the area should look like, I can't really think of anywhere where it wouldn't be suited, but it could happen.

gulliwog
08-05-2007, 02:13 PM
The flou thing I didnt explain... basically the dynamic light will give off no "visible" light, doesn't light the scene, brushes or models... but when a player passes under where the light is placed, you get a bright "white" reflection showing on the arms and gun. Thats all really, I never got much further, like i say I an "advanced" beginner, I have a good grip of the basics of HAmmer but there are many things I haven't had time to explore. Spider said that these lights were very fussy, and I tend to agree, but I don't know about what. Im pretty sure it wasn't cos I was putting them into props, I am careful about this sort of thing.

Anyway thanks for the answer

GuLLiWoG

PS I gotta post a new thread tomorrow about cubemaps; if anyone chould check it out and give me some abvice it would be GREATLY appriciated

Spider-Baby
08-05-2007, 02:45 PM
as i said before, dynamic lights are damn picky but i've gotten them to work before. the "maximum distance" keyvalue needs to be greater than the distance from the light to the surface that is supposed to be illuminated, and the "brightness" keyvalue must be between -64 and 64, but 6 or 8 are the best values. also, the angles are ridiculously screwed, if you set the angle using the circle thing in the top-right it will only adjust the angle of the cone model light, you also have to type the value in the correct axis spot in the keyvalue to move the spot world light, and for some reason you have to type in the opposite value that you want to get it to point the right way.
don't use them if you don't need a light to move around!!!

EDIT: I adjusted the wiki definition (http://developer.valvesoftware.com/wiki/Light_dynamic#Entity_Description) to be more clear on how to use them.

gulliwog
08-08-2007, 02:58 PM
I tried putting in some sprites. In game they came out looking exactly like they do in Hammer... in other words they had black squares around them which showed up against the geometry behind (ceiling, walls etc). Surely this can't be right...

GuLLiWoG

perrapaap
08-09-2007, 10:05 AM
i find it better if you put the light source maybe 16 inches away from the wall. in cs_office they put the light 32 inches from the ceiling. it's just so the wall isn't full lit. no light is completely lit the wall it's hanging from ;)

Spider-Baby
08-09-2007, 05:34 PM
for the sprites, set the "render mode" keyvalue to "world space glow". Also, you must manually type in .spr or .vmt after the sprite name.