Constant/linear/quadratic - No effect

View

Community Home > Half-Life 2 / Source Engine > Source Mapping > Constant/linear/quadratic - No effect

Page 1 of 1. Covering 19 Post(s). Viewed 3781 times.
Previous 1 Next
Constant/linear/quadratic - No effect
Dec 22nd 2005, 04:41
Bearcub

Post: #1
Reply to: #None

Joined: 21st Dec 2005
From: United States
Posts: 3

I've followed the instructions located at http://www.editlife.net/tutorials.php?id=15 as recommended, but adjusting any of these three values - (constant/linear/quadratic attenuation) causes absoultely NO effect on my light. It's as if I had not touched them, regardless if I set them to 1, 50000, 500000 or even 500000000. I've tried setting any combination of them with absoultely no results either.

All I am attempting to do is make a light give off a faint amount of light; picture the amount of light, say, a Christmas Light would give off. Or perhaps, slightly more than that, but I am looking for instructions on how to adjust this factor. I am severely lost and it's driving me crazy; it's one of the easiest things to do in UnrealED, as terrible as that program is. heh.

Thanks.

Note: I should say the lights *DO* get darker as distance goes on. But they never go completely out; thus a light with a small light radius will brightly illuminate the placed area and fade out, but a wall several hundred feed away still gains faint lighting from it.

Message last edited by VicMorson on Dec 22nd 2005 at 04:48.

Re: Constant/linear/quadratic - No effect
Dec 22nd 2005, 12:16
Sage

Avatar

Post: #2
Reply to: #1

Joined: 30th Jan 2005
From: United States
Posts: 4146

...Never make adjustments to any light entity that high, some of the values for example are only valid from 0-10.
The adjustments you've been making would have changed the way your light edges appear, you can for example make the ring at the edge of your light very sharp rather than blended.
The brightness is what you want to adjust, where a normal light entity gives off the approximate amount of light from a typical source values are most commonly between 60-120, with 200 being bright and 600 a blinding light.

SDK Nuts

Re: Constant/linear/quadratic - No effec
Dec 23rd 2005, 08:01
Bearcub

Post: #3
Reply to: #2

Joined: 28th Aug 2005
From:
Posts: 25

Wisemx, I see you have a fair amount of posts on me, but I'm sorry. I think you are wrong.

Constant, linear, and quadratic values HAVE to be huuuumongous. They're under the fraction in the equation Source uses to do the raytrace, which means to get any sort of change, you have to have huge numbers.

http://www.editlife.net/tutorials.php?id=15

Just trying to give you the facts here; if you have evidence otherwise, by all means share!

Re: Constant/linear/quadratic - No effec
Dec 23rd 2005, 08:38
Veteran

Post: #4
Reply to: #3

Joined: 31st Dec 2004
From: United States
Posts: 1377

A fair amount. I chuckle.

Modifying the brightness has a much more powerful (and in this case, desirable) effect than the QLC modifiers.

[ Word of the Random Time Period: Nominal ]

Re: Constant/linear/quadratic - No effec
Dec 23rd 2005, 12:12
Sage

Avatar

Post: #5
Reply to: #3

Joined: 30th Jan 2005
From: United States
Posts: 4146

...OK, fair enough.
Use Raeven0's attenuation factor of [1/(qd^2+Ld+c)] for a normal light entity and create an example for us.

With my previous post I was generally speaking but if you check you will find some light entity properties are only valid from 0-10.

Constant values can be changed but the brightness will be the same, what's effected is the distance of decay.

Linear and Quadratic are both used to adjust the light decay, with Quadratic being the quick fix, more harsh.

Max Distance is another value used for light decay.

SDK Nuts

Message last edited by wisemx on Dec 23rd 2005 at 12:47.

Re: Constant/linear/quadratic - No effec
Dec 23rd 2005, 15:51
Amateur

Post: #6
Reply to: #5

Joined: 3rd Dec 2004
From:
Posts: 501

From reading the VRAD source, the Q, L & C values are normalized before the light's effect is computed. Therefore, only their relative values matter.

(In utils/vrad/lightmap.cpp:

float ratio = (dl->light.constant_attn + 100 * dl->light.linear_attn + 100 * 100 * dl->light.quadratic_attn);

if (ratio > 0)
{
VectorScale( dl->light.intensity, ratio, l->light.intensity);
}
}

The attenuation coefficient is calculated at 100 units distance from the light, then the light intensity is reduced so that the attenuation is exactly 1 at 100 units.)

So setting Q=1000, L=200, C=5 produces exactly the same lighting effect as Q=1, L=0.2, C=0.005. To make the light brighter, you must use the brightness setting, which is a linear multiplier. Changing Q, L & C only effect the shape of the light fall-off with distance; the normalization above ensures that their values do not effect the overall brightness.

Also, since only relative values matter, if you have two of the constants set to zero (e.g. L=0, C=0) it doesn't matter if you set Q=1, Q=500, Q=70000000 or Q=0.00000001, it will have absolutely no effect on the way the light works.

-----
VMEX & Pakrat:
http://www.geocities.com/cofrdrbob/

Message last edited by Rof on Dec 23rd 2005 at 16:01.

Re: Constant/linear/quadratic - No effec
Dec 23rd 2005, 16:48
Sage

Avatar

Post: #7
Reply to: #6

Joined: 30th Jan 2005
From: United States
Posts: 4146

...Value added, thx Rof. ;)

SDK Nuts

Re: Constant/linear/quadratic - No effec
Dec 23rd 2005, 17:29
Bearcub

Post: #8
Reply to: #7

Joined: 28th Aug 2005
From:
Posts: 25

Rof:

I thought about this scenario, as I seemed to get slightly different results when C and L were 5000-1000 and Q was 10000, more so than with zero for the first two and very high for Q. Thank you very much for enlightening us.

**EDIT**

Forgot about this: the beta SDK includes new tags for light entities called "50 percent falloff distance" and "0 percent falloff distance"

The first is the distance where the light should fall to 50% of its set brightness, and the second is the distance at which the light should become almost non-existant. These two override linear, constant, and quadratic.

Message last edited by active.exe on Dec 23rd 2005 at 17:37.

Re: Constant/linear/quadratic - No effec
Dec 23rd 2005, 19:27
Apprentice

Post: #9
Reply to: #8

Joined: 5th Oct 2001
From: Austria
Posts: 212

I never dared to change any of the settings. A non-mathematical tutorial showing you the effect in game would be nice. (hope I didn't overlook a link here :D )

_____________________________________
Feel free to take a look at my Snarkpit profile :o :
http://www.snarkpit.net/users.php?name=reaper47

Re: Constant/linear/quadratic - No effec
Dec 23rd 2005, 22:34
Veteran

Post: #10
Reply to: #9

Joined: 31st Dec 2004
From: United States
Posts: 1377

I made a gallery of lights with different QLC settings.

The difference was akin to comparing sounds with volumes varying by fractions of decibels.

[ Word of the Random Time Period: Nominal ]

Re: Constant/linear/quadratic - No effec
Dec 24th 2005, 00:06
Master

Post: #11
Reply to: #7

Joined: 19th Jan 2005
From: United States
Posts: 1636

In the name of Accuracy, I have rewritten my lecture to show (my interpretation of) the Wisdom of Master Rof, which wisdom seems more logical anyway. I wasn't far off from the Basic Idea of the properties, but it's still not kay-o to spread misinformation :P

-----
Custom FGD: a mind-bogglingly better way to map
Edit Life: there're tutorials there... and stuff...

Re: Constant/linear/quadratic - No effec
Dec 25th 2005, 13:11
Apprentice

Post: #12
Reply to: #10

Joined: 5th Oct 2001
From: Austria
Posts: 212

Demented, sorry if I'm blind but where is this gallery? :)

_____________________________________
Feel free to take a look at my Snarkpit profile :o :
http://www.snarkpit.net/users.php?name=reaper47

Re: Constant/linear/quadratic - No effec
Dec 25th 2005, 13:31
Senior

Avatar

Post: #13
Reply to: #12

Joined: 22nd Nov 2004
From: Sweden
Posts: 1162

gief

Re: Constant/linear/quadratic - No effec
Dec 25th 2005, 20:12
Veteran

Post: #14
Reply to: #13

Joined: 31st Dec 2004
From: United States
Posts: 1377

It's one of my personal test maps. I don't have it hosted anywhere.

[ Word of the Random Time Period: Nominal ]

Re: Constant/linear/quadratic - No effec
Dec 25th 2005, 20:19
Sage

Avatar

Post: #15
Reply to: #14

Joined: 30th Jan 2005
From: United States
Posts: 4146

...If it's worthy I'll host it for you.

Fortunately the word of the day is Prepense, without malice. ;)

SDK Nuts

Re: Constant/linear/quadratic - No effec
Dec 25th 2005, 21:56
Veteran

Post: #16
Reply to: #15

Joined: 31st Dec 2004
From: United States
Posts: 1377

It was mainly a failed test, since I couldn't see the difference between a quadratic light and a linear light with any certainty.

As far as I know, the only use of the QLC values by valve was setting the constant to 500,000 for the Combine spotlights. Otherwise, it was always 1,0,0. Maybe they'll be more important for HDR.

[ Word of the Random Time Period: Nominal ]

Message last edited by Demented on Dec 25th 2005 at 21:57.

Re: Constant/linear/quadratic - No effec
Dec 27th 2005, 18:55
Apprentice

Post: #17
Reply to: #16

Joined: 5th Oct 2001
From: Austria
Posts: 212

Don't think it's an HDR thing. HDR is only for general brightness. These settings are for falloff/gradient of a light from its starting point.

If not even Valve really used I think I can do without it. Maybe some interesting spotlight effects or very special hacks/effects for example for radioactive/plasma sci-fi stuff though.

_____________________________________
Feel free to take a look at my Snarkpit profile :o :
http://www.snarkpit.net/users.php?name=reaper47

Re: Constant/linear/quadratic - No effec
Dec 27th 2005, 22:36
Veteran

Post: #18
Reply to: #17

Joined: 31st Dec 2004
From: United States
Posts: 1377

It's not an exclusively HDR thing. It's just that they don't seem to be exceptionally useful for everyday purposes. Since HDR has such a wider range of light values, manipulating the QLC and brightness values could be far more useful for controlling tonemapping limits and what-not.

In LDR circumstances, I know Valve normally uses 1,0,0 for everything.
Combine spotlights are 1,0,500000, so they make a kind of very-long-range one-color light.

Maybe if someone would make a gallery showing a few special effects the QLC values can be used to make, it would be worth hosting.

[ Word of the Random Time Period: Nominal ]

Re: Constant/linear/quadratic
Dec 27th 2005, 22:52
Sage

Avatar

Post: #19
Reply to: #18

Joined: 30th Jan 2005
From: United States
Posts: 4146

...I will, with a Video of the resulting effects, once the current SDK updates settle in.

SDK Nuts

Page 1 of 1. Covering 19 Post(s). Viewed 3781 times.
Previous 1 Next
Jump to Board