---
title: "Distance consideration in intensity"
subject: "Computer Graphics"
chapter: 8
key: "semester_5/computer_graphics:intensity-attenuation-distance"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/intensity-attenuation-distance
site: BCT Engineering
---

# Distance consideration in intensity

Computer Graphics · Chapter 8: Illumination and Surface Rendering methods

- Asked in: 2076 Chaitra, 3 marks; 2075 Chaitra, 4 marks (asked 2 times)
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/intensity-attenuation-distance
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-8

## Question

Write the expression for multiple light sources. How do you consider the distance (intensity attenuation) to calculate the intensity for specular and diffuse reflection?

## Short answer

For m light sources, the intensity is I = ka·Ia + Σ f(d_l)·IL_l·[kd(N·L_l) + ks(N·H_l)^n]. Distance attenuation f(d)=min(1/(a0+a1·d+a2·d²),1) multiplies both diffuse and specular terms for each source; the ambient term is not attenuated.

## Answer

#### Multiple light sources
When a surface is lit by m point sources, the contributions of all sources are added to the ambient term:

I = ka·Ia + Σ (l = 1 to m) f(d_l) · IL_l · [ kd (N·L_l) + ks (N·H_l)^n ]

(N = unit normal, L_l = unit vector towards source l, H_l = (L_l + V)/|L_l + V|, and (R·V)^n can replace (N·H)^n.) If the sum exceeds the maximum intensity, it is clamped to 1.

#### Distance (intensity attenuation)
Light from a point source gets weaker with distance d from the source. In theory the intensity falls as 1/d², but this changes too fast for a small scene, so a general function is used:

**f(d) = min( 1 / (a0 + a1·d + a2·d²), 1 )**

- a0, a1, a2 are constants chosen to give the best effect (a0 prevents division by a very small number when d is small).
- Taking f(d) = 1 means no attenuation (source at infinity).

Attenuation multiplies **both the diffuse and specular terms**, since they depend on the light source. The ambient term has no distance factor:

I = ka·Ia + f(d) · IL · [ kd (N·L) + ks (N·H)^n ]

For a source at infinity, d is not defined and f(d) = 1.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How are m light sources combined?
   A. Sum their attenuated contributions and add the ambient term
   B. Multiply them
   C. Take the brightest only
   D. Average ambient with each
   Answer: A. I = ka Ia + sum f(d_l) IL_l [...]. (Key point: Multiple sources)

2. Which is the attenuation function?
   A. f(d) = d^2
   B. f(d) = min(1/(a0 + a1 d + a2 d^2), 1)
   C. f(d) = a0 d
   D. f(d) = 1 + d
   Answer: B. It avoids the too-rapid pure 1/d^2 fall-off. (Key point: Attenuation function)

3. What does attenuation multiply?
   A. Ambient only
   B. All three terms
   C. Diffuse and specular terms, not ambient
   D. Specular only
   Answer: C. Ambient does not depend on a light source's distance. (Key point: What it multiplies)

4. For a source at infinity, f(d) is:
   A. 0
   B. Infinity
   C. 1/d
   D. 1
   Answer: D. Distance is undefined, so no attenuation. (Key point: Source at infinity)

## Related in Computer Graphics

- [Ambient, diffuse and specular light](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aambient-diffuse-specular-expressions) — Computer Graphics, chapter 8, asked 2×
- [Specular reflection](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aspecular-reflection-expression) — Computer Graphics, chapter 8, asked 4×
- [Diffuse reflection equation](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Adiffuse-reflection-equation) — Computer Graphics, chapter 8, asked 3×
- [Phong illumination model expression](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aphong-illumination-model-derive) — Computer Graphics, chapter 8, asked 8×
- [Short note: Intensity attenuation, transparency](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Ashort-note-intensity-attenuation-transparency) — Computer Graphics, chapter 8
- [Define terms; Phong intensity equation](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Adefine-terms-lambert-phong-equation) — Computer Graphics, chapter 8

## Related in other subjects

- [Light sources and specular reflection principle](https://www.bctengineer.com/question.md?key=semester_6%2Findustrial_power_distribution_and_illumination%3Alight-sources-specular-reflection) — Industrial Power Distribution and Illumination, chapter 6
- [Sources of attenuation and distortion](https://www.bctengineer.com/question.md?key=semester_8%2Ftelecommunications%3Aattenuation-distortion-sources) — Telecommunications, chapter 2
- [Total internal reflection as light conduit](https://www.bctengineer.com/question.md?key=semester_6%2Fpropagation_and_antenna%3Atotal-internal-reflection-light-conduit) — Propagation and Antenna, chapter 6
- [Short note: Light sources in optical communication](https://www.bctengineer.com/question.md?key=semester_6%2Fpropagation_and_antenna%3Alight-sources-short-note) — Propagation and Antenna, chapter 6
