<p>I am obviously not understanding something related to light for a ray tracer.</p>
<p>Reading <a href="https://pbr-book.org/3ed-2018/Color_and_Radiometry/Spectral_Representation#Spectrum" rel="nofollow noreferrer">Spectral representation</a>
and <a href="https://pbr-book.org/3ed-2018/Light_Sources/Point_Lights#" rel="nofollow noreferrer">Point light calculation</a></p>
<h3>A bit of a context:</h3>
<p>My question is: in room at X degrees Celsius, for ray of light with an originating linear RGB color of (0.4,0.6,0.6), with an originating power in Watts of 750W, at what distance would it become invisible, with a color (0,0,0)?</p>
<p>My limited understanding tells me that light intensity decreases at the rate given by 1/(d*d).</p>
<p>At 500 meters: (what I am about to write is so ridiculous, but let's do it)
So we would have A = 750 / (500*500) = .765 and put back in sRGB I multiply by 255</p>
<p>(A * 0.4, A * 0.6, A* 0.6) = (0, 0, 0) approx.</p>
<p>500m look way to high for a 750W light to reach a sRGB color of 0.
So my calculation is wrong from the start.</p>
<h3>My experiments so far:</h3>
<p>Using Blender, with a white spotlight of 750W oriented at 90d, it takes approx 80m for it to be invisible to my eye, on a white plane.</p>
<p>We are talking of very non scientific measure, obviously but it gives an order of magnitude: 80m is far more plausible.</p>
<p>Could someone tell me how to correctly calculate the power and color of a light, from its originating color at distance X meters?</p>
<p>Thanks!</p>
<h3>Edit:</h3>
<p>My current decision is to use a completely different light calculation and it yields visually correct results.
Instead of starting with known units, I just decide the length in meters a ray can have and apply my attenuation according to the cumulated distance.</p>
<p>It works.</p>

CC BY-SA 4.0
2023-03-15T08:35:39.613Z
Cycles in Blender does not produce correct light intensities for spotlights. If you set a light to emit some amount of watts and then reduce the spotlight angle, the light intensity does not increase.
SimonL
CC BY-SA 4.0
2023-03-15T08:39:26.837Z
Also it's not clear to me what you're actually asking...
SimonL
CC BY-SA 4.0
2023-03-15T08:54:21.797Z
I had an issue with the attenuation calculation for ray tracing. The result was very incorrect. Now it is a problem solved :)
LeXav
CC BY-SA 4.0
2023-03-15T09:40:36.673Z
A light source has the same apparent intensity regardless of how far away it is, assuming a perfect vacuum. Lights don’t get dimmer with distance; they just get smaller.
SimonL
CC BY-SA 4.0
2023-03-15T13:18:47.123Z
@SimonLundberg that's a good point; Is it something I can relate to Whitted or is there a better algorithm out there to mimick that effect?
LeXav
CC BY-SA 4.0
2023-03-15T14:18:38.660Z
Mimic it in what context? A naive path tracer solves it via monte carlo integration: the further away a light is, the less likely it is to be hit by a ray, so fewer rays will hit it, resulting in less light. Of course that's super noisy and only works with really big lights, so direct light sampling needs to estimate the probability first. If the light is a point source with zero surface area, you can use the inverse square law and just shoot a ray directly at it.
SimonL
CC BY-SA 4.0
2023-03-15T14:57:04.160Z
@SimonLundberg Thanks, you answered all my questions :)
LeXav
<raytracing><lighting>
Ray light color at distance
LeXav
# Ray light color at distance

(Asked by: username_0 on 2023-03-14)

I am obviously not understanding something related to light for a ray tracer.

Reading [Spectral representation](https://pbr-book.org/3ed-2018/Color_and_Radiometry/Spectral_Representation#Spectrum)
and [Point light calculation](https://pbr-book.org/3ed-2018/Light_Sources/Point_Lights#)

### A bit of a context:

My question is: in room at X degrees Celsius, for ray of light with an originating linear RGB color of (0.4,0.6,0.6), with an originating power in Watts of 750W, at what distance would it become invisible, with a color (0,0,0)?

My limited understanding tells me that light intensity decreases at the rate given by 1/(d\*d).

At 500 meters: (what I am about to write is so ridiculous, but let's do it)
So we would have A = 750 / (500\*500) = .765 and put back in sRGB I multiply by 255

(A \* 0.4, A \* 0.6, A\* 0.6) = (0, 0, 0) approx.

500m look way to high for a 750W light to reach a sRGB color of 0.
So my calculation is wrong from the start.

### My experiments so far:

Using Blender, with a white spotlight of 750W oriented at 90d, it takes approx 80m for it to be invisible to my eye, on a white plane.

We are talking of very non scientific measure, obviously but it gives an order of magnitude: 80m is far more plausible.

Could someone tell me how to correctly calculate the power and color of a light, from its originating color at distance X meters?

Thanks!

### Edit:

My current decision is to use a completely different light calculation and it yields visually correct results.
Instead of starting with known units, I just decide the length in meters a ray can have and apply my attenuation according to the cumulated distance.

It works.

**Tags:** raytracing, lighting

> **Comments:**
> **username_1**: Cycles in Blender does not produce correct light intensities for spotlights. If you set a light to emit some amount of watts and then reduce the spotlight angle, the light intensity does not increase.  
> **username_1**: Also it's not clear to me what you're actually asking...  
> **username_0**: I had an issue with the attenuation calculation for ray tracing. The result was very incorrect. Now it is a problem solved :)  
> **username_1**: A light source has the same apparent intensity regardless of how far away it is, assuming a perfect vacuum. Lights don’t get dimmer with distance; they just get smaller.  
> **username_0**: @SimonLundberg that's a good point; Is it something I can relate to Whitted or is there a better algorithm out there to mimick that effect?  
> **username_1**: Mimic it in what context? A naive path tracer solves it via monte carlo integration: the further away a light is, the less likely it is to be hit by a ray, so fewer rays will hit it, resulting in less light. Of course that's super noisy and only works with really big lights, so direct light sampling needs to estimate the probability first. If the light is a point source with zero surface area, you can use the inverse square law and just shoot a ray directly at it.  
> **username_0**: @SimonLundberg Thanks, you answered all my questions :)  

---

## 0 answers

