mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 07:11:41 +00:00
[client] Add a comment on light attenuation
Saves me having to look in the shader every time.
This commit is contained in:
parent
2a28b342ee
commit
99d32d5e54
1 changed files with 6 additions and 0 deletions
|
@ -216,6 +216,12 @@ parse_light (light_t *light, int *style, const plitem_t *entity,
|
|||
}
|
||||
}
|
||||
|
||||
// The light's intensity is calculated as
|
||||
// I = (1 - a.w * r.y) / dot (a, r)
|
||||
// where a is attenuation and r = vec4 (d*d, d, 1, 0)
|
||||
// thus giving linear falloff for a = vec4 (0, 0, 1, 1/maxdist)
|
||||
// and 1/(A*d*d + B*d + C) for a = vec4 (A, B, C, 0)
|
||||
// Other factors contribute to the final intensity (cone angle etc)
|
||||
vec4f_t attenuation = { // inverse square
|
||||
1, 0, 0,
|
||||
0,
|
||||
|
|
Loading…
Reference in a new issue