Light that only illuminates a radius, and nothing else? (pitch black elsewhere)

R

Release

Guest
I'm really embarrassed that I can't figure this out myself. I've read Valve's lighting doc about constant, linear and quadratic lights, and how the "50%" and "0%" values are easier to use and would override the first values if used..

I just want to make a Light that fades to complete black as the light gets too far from the source. So, let's say I want this light to be bright at the source, and fade out for 512 units, and then completely fade to black past that 512 unit mark.

How do I do that? I've tried using the constant/linear/quadratic values, but whatever combination I use, the light will dim down to very dark, but instead of fading to black, will continue on forever with very dark, but barely visible light. Also, if I use the 50% and 0% values, for example if I specify that it should fade to 50% at 256 units, and fade to 0% brightness at 512 units, it will indeed fade down to 50% brightness at 256 units, but at 512 units, it won't fade to 0% brightness. Instead, it will fade to very dark, but still barely illuminated, and then that barely visible light will continue on forever again. :(

It would seem that the "Hard falloff" and "Maximum Distance" values would be the answer to this problem (sort of), but it seems like both of the values are broken, or I just am putting the wrong values in them? (I assumed they both used values as units in Hammer, like, I assumed "512" in "Maximum Distance" would limit a light to spread out for 512 units and then stop, but putting "512" in that value seemed to do nothing)

Please, can someone tell me how to make a light that fades to black? It's driving me crazy. Thanks >_<
 
hmmm it should work


I've only ever used hard falloff with the 50%/100% falloff, but it worked for me AFAIK
 
Hmm, how exactly did you get hard falloff to work? The description for hard falloff is:

"If set, causes lights to fall to exactly zero beyond the zero percent distance. May cause unrealistic lighting if not used carefully."

This makes sense, because if a light was very bright in the middle, but then faded away to pitch black quite suddenly, it would be unrealistic. However, this is what I'm trying to achieve. Lights with a controllable radius and brightness?

I tried setting these values:

50% falloff distance: 32 units
0% falloff distance: 33 units

Supposedly, this should make a light that fades down to 50% and then almost immediately fades to black afterwards. Not the case. It goes off for VERY far. Even though I have set the 0% falloff distance at 33 units, it still depends on the "Brightness" value (the 4th number in brightness) to determine exactly how far the light travels. For example, if I put, 50% falloff: 32 units, and 0% falloff: 33 units, and a brightness of 500, you would THINK you would get a very bright light that only goes off for 33 units right? Nope, what happens is you get a pretty bland not-bright light that goes off for very, very far. If I leave the same values, 50%: 32 units and 0%: 33 units, and change the brightness to 50, then you would think the light would still "stretch out" for the same distance (after all, I specified how far it should go in the 50%/0% values), and just be less bright. Nope, you get the same exact intensity of light (the bland, not-so-bright brightness), but it just doesn't stretch out very far now.

So wtf, you can't control the brightness if you use the 50%/0% values or what? It seems that if you DO use the 50%/0%, then the brightness is actually what determines the light radius, not the distance values you inputted. :\

Also, for that 50% falloff: 32, 0% falloff: 33 light, I also tried setting Hard Falloff and Maximum Distance to 33, to kind of, reinforce, "Hey, do NOT shine past this distance" but it doesn't work. The light still stretches out solely according to my Brightness value. (i.e. 5000 brightness goes very very far out, 50 brightness goes only a very short distance, but both lights have the same "intensity")

Please help :(
 
haha I have the exact same problem with a map I'm working on now, there seems to be some difference but like you said, it's not even close to what I would expect it to do.

My only guesses at this point would be:

1)This type of falloff doesnt work

2)the light bounces are causing the light to get washed out.. of course limiting the bounces is simply not practical


I'm still going to be investigating this and I promise to update this thread if I make any headway but right now I'm out of ideas.

The only other idea I have is to set all the other falloff types to zero (even though the editor says it will get overridden if you set the 50%/0% limits).


good luck and if you find anything out please post in here as well :)
 
I think that the problem you are experiencing is due to bounce lighting. The light - the direct light - is indeed constrained to these numbers but bounce lighting has no such constraints. Test this simply by making your map leak. Yes, you heard me. Leaking will cause Vis to get upset and Rad to only add direct lighting. That way you should see if I am right and this is due to the bounce lighting.

IF it is bounce lighting then you can stop that by creating a cylinder - or a sphere if needed - of the BLOCKLIGHT material which will then stop ALL forms of light to exit through that sphere. That should give you complete and utter darkness outside.
 
Damn, I guess it is that.

I was going to make a clone of a multiplayer map from Deus Ex (Cathedral) - I might still finish it, it looks exactly the same so far (right down to the "1 unit" grid size, I scaled it evenly according to player size in each engine) - but I wanted to mimic the lights exactly the same as well. In the older UT engine that Deus Ex used, lights were simply a radius and a brightness. So you could have a very small radius with really bright light and it would fade to pitch blackness once the radius ended. I guess the more realistic HL2 bounce lighting prevents me from exactly duplicating the lighting of a map from Deus Ex. But that's OK I guess, HL2's lighting looks much better anyway. I'll probably just make it look at close as possible in the lighting aspect. Thanks for the explanation
 
Possible cure

-bounce # : Set max number of bounces (default: 10).

and set that to 0. That will stop bounce lighting making your shadows as you would want them, but would also remove all realistic shadows elsewhere.
 
Back
Top