<p>Most renderers allow you to set a flag on an object to make shadow rays ignore it (so it won't cast shadows). You could set this flag on your glazing.</p>

<p>That said, it's not unusual to make it so that refraction is disabled on shadow rays: that is, if they would be transmitted by an object, a child ray is traced in the same direction, ignoring any refraction that would be caused by the ior of the material. Although this gives wrong results for objects such as crystal balls, you need photon mapping or similar to get good results for that situation anyway. Just tracing a child ray is an easy way of making objects like stained-glass windows give simple coloured shadows.</p>

CC BY-SA 3.0
2017-03-14T17:13:53.010Z
Thanks for your answer. My aim is to calculate daylighting from the visible sky, seen through the glazing portal,on few measurement points. The transmitted ray will hit a different patch of sky with a different distribution than the initial shadow ray. And as you said this will give wrong results.
ali
CC BY-SA 3.0
2017-03-14T18:01:18.603Z
I am not sure any light tracing methods would help either as sampling the infinite area light source(sky) for an indoor scene is not efficient, and considering the window portal as the light source with the background sky distribution wouldn't help either as you sample the window area with a sample direction towards the room but still needs to trace one transmitted ray back to the sky to account for the glazing. Is this correct?
ali
CC BY-SA 3.0
2017-03-14T15:17:08.503Z
2017-03-14T15:17:08.503Z
Dan Hulme
<p>For rendering an indoor scene where light source is skylight coming in through
the window opening, one can consider the window polyline as the light 
source, with the sky distribution, in direct lighting calculation. And sample
the window area(or solid angle).</p>

<p>It works as long as it's just an opening. Once a glazing is introduced I cannot figure out how to do direct lighting(in a path tracer) correctly. Shadow rays either are transmitted or reflected. I guess the transmitted ray needs to be traced again but this is not easy I suppose(as the the Brdf.SampleDirection method returns only direction), considering also that it might be a double 
glazing which inter-reflection can happen too. </p>

<p>Does any one have any suggestion or experience on this?
Thanks,</p>

<raytracing><lighting><pathtracing><shadow><specular>
How to send shadow rays to window light source with glazing
ali
# How to send shadow rays to window light source with glazing

(Asked by: username_0 on 2017-03-13)

For rendering an indoor scene where light source is skylight coming in through
the window opening, one can consider the window polyline as the light
source, with the sky distribution, in direct lighting calculation. And sample
the window area(or solid angle).

It works as long as it's just an opening. Once a glazing is introduced I cannot figure out how to do direct lighting(in a path tracer) correctly. Shadow rays either are transmitted or reflected. I guess the transmitted ray needs to be traced again but this is not easy I suppose(as the the Brdf.SampleDirection method returns only direction), considering also that it might be a double
glazing which inter-reflection can happen too.

Does any one have any suggestion or experience on this?
Thanks,

**Tags:** raytracing, lighting, pathtracing, shadow, specular


---

## 1 answers

### Answer by username_1 on 2017-03-14. Score: 5 | Accepted answer

Most renderers allow you to set a flag on an object to make shadow rays ignore it (so it won't cast shadows). You could set this flag on your glazing.

That said, it's not unusual to make it so that refraction is disabled on shadow rays: that is, if they would be transmitted by an object, a child ray is traced in the same direction, ignoring any refraction that would be caused by the ior of the material. Although this gives wrong results for objects such as crystal balls, you need photon mapping or similar to get good results for that situation anyway. Just tracing a child ray is an easy way of making objects like stained-glass windows give simple coloured shadows.

> **Comments:**
> **username_0**: Thanks for your answer. My aim is to calculate daylighting from the visible sky, seen through the glazing portal,on few measurement points. The transmitted ray will hit a different patch of sky with a different distribution than the initial shadow ray. And as you said this will give wrong results.  
> **username_0**: I am not sure any light tracing methods would help either as sampling the infinite area light source(sky) for an indoor scene is not efficient, and considering the window portal as the light source with the background sky distribution wouldn't help either as you sample the window area with a sample direction towards the room but still needs to trace one transmitted ray back to the sky to account for the glazing. Is this correct?  

---

