POV-Ray : Newsgroups : povray.binaries.images : Cylindrical light source casts a shadow on media Server Time
28 Aug 2025 18:30:10 EDT (-0400)
  Cylindrical light source casts a shadow on media (Message 1 to 8 of 8)  
From: Cousin Ricky
Subject: Cylindrical light source casts a shadow on media
Date: 25 Aug 2025 12:25:20
Message: <68ac8e70$1@news.povray.org>
I'm taking a stab at reproducing Bruno Cabbason's "Extreme optics," but
as far as I can tell, he has not published his source code.

Does anyone know how to get rid of that dark band across the spectrum
above the light source?  It is not an object casting a shadow; it is the
light source itself that is creating the shadow.  There is no such
shadow in Bruno's render.

---%<-----%<-----%<-----%<---[BEGIN CODE]---%<-----%<-----%<-----%<---
#version 3.7;

global_settings
{ assumed_gamma 1
  max_trace_level 50
  photons { spacing 0.02 media 200 autostop 0 }
}

#declare HALFH = 12.5;
#declare HALFW = HALFH * 16/9;
#declare DCAM = 60;
camera
{ location vrotate (-DCAM * z, -6 * x)
  look_at <0, -0.5, 0>
  right 16/9 * x
  angle 2 * degrees (atan2 (HALFW, DCAM))
}

box
{ <-HALFW - 1, -HALFH - 1, -6.01>, <HALFW + 1, HALFH, 0.01>
  hollow
  pigment { rgbt 1 }
  interior
  { media
    { scattering { 1, 1 extinction 0 }
      method 3
      intervals 1
      samples 3, 3
      aa_level 2
    }
  }
}

light_source
{ <0, -HALFH - 0.99, -3>, rgb 1
  cylinder radius 0.3 falloff 0.3
  parallel point_at <0, 0, -3>
}

#declare m_Refractor = material
{ texture
  { pigment { rgbf 1 }
    finish { reflection { 1 fresnel } conserve_energy }
  }
  interior { ior 1.5 dispersion 1.1 dispersion_samples 36 }
}

#declare m_Reflector = material
{ texture
  { pigment { rgb <0.93, 0.94, 0.95> }
    finish { reflection { 1 metallic } ambient 0 diffuse 0 }
  }
}

#declare Prism = prism
{ 0, 6, 4,
  <-1, 0>, <1, 1>, <1, -1>, <-1, 0>
  rotate -90 * x
  scale <1.5, 1.5, 1>
  material { m_Refractor }
  photons { target collect off reflection on refraction on }
}

#declare Mirror = difference
{ box
  { <-0.6, -3.2, -6>, <0.01, 3.2, 0>
    pigment { rgb <1, 1, 0> }
  }
  box
  { <0, -3, -5.8>, <0.1, 3, -0.2>
    material { m_Reflector }
  }
  photons { target collect off reflection on }
}

object { Prism translate <0, -10, 0> }
object { Mirror rotate 192 * z translate <3, -5, 0> }
--->%----->%----->%----->%----[END CODE]---->%----->%----->%----->%---


Post a reply to this message


Attachments:
Download 'extreme_optics-media.jpg' (22 KB)

Preview of image 'extreme_optics-media.jpg'
extreme_optics-media.jpg


 

From: William F Pokorny
Subject: Re: Cylindrical light source casts a shadow on media
Date: 25 Aug 2025 15:15:53
Message: <68acb669$1@news.povray.org>
On 8/25/25 12:25, Cousin Ricky wrote:
> Does anyone know how to get rid of that dark band across the spectrum
> above the light source?  It is not an object casting a shadow; it is the
> light source itself that is creating the shadow.  There is no such
> shadow in Bruno's render.

Most helpful will be increasing the media samples to say 10,10 or more.

There are secondary sampling frequency effects in play too: jitter 
on/off in the global_settings media block (use on); media jitter 
on/off(2); that official releases of POV-Ray have a banding effect in 
the media due how the photons are distributed - which has been removed 
in the yuqk branch (1); there are internal differences / fixes in media 
sampling between v3.7 and v3.8 - and of course AA.

Bill P.

(1) - Best guess is the photo deposit banding / shift effect was due 
some debug code added at some point and never removed.

(2) - The yuqk fork disables media 3 jitter because it does nothing but 
introduce 'more' noise given how the adaptive sampling works... And, at 
media container boundaries the jitter bleeds outside the container.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Cylindrical light source casts a shadow on media
Date: 25 Aug 2025 15:55:00
Message: <web.68acbefbbe0af49b60e0cc3d949c357d@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
>
> Does anyone know how to get rid of that dark band across the spectrum
> above the light source?  It is not an object casting a shadow; it is the
> light source itself that is creating the shadow.  There is no such
> shadow in Bruno's render.

I now see that this is related to the "Light beam won't refract from outside
media container" I posted in p.bugreports, and WFP has responded to that.  I
believe the shadow was caused by non-photon media interaction with the light
source.

But for some reason, the unrefracted light beam isn't showing.


Post a reply to this message


Attachments:
Download 'extreme_optics-media2.jpg' (23 KB)

Preview of image 'extreme_optics-media2.jpg'
extreme_optics-media2.jpg


 

From: William F Pokorny
Subject: Re: Cylindrical light source casts a shadow on media
Date: 25 Aug 2025 17:17:57
Message: <68acd305$1@news.povray.org>
On 8/25/25 15:52, Cousin Ricky wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
>>
>> Does anyone know how to get rid of that dark band across the spectrum
>> above the light source?  It is not an object casting a shadow; it is the
>> light source itself that is creating the shadow.  There is no such
>> shadow in Bruno's render.
> 
> I now see that this is related to the "Light beam won't refract from outside
> media container" I posted in p.bugreports, and WFP has responded to that.  I
> believe the shadow was caused by non-photon media interaction with the light
> source.
> 
> But for some reason, the unrefracted light beam isn't showing.

Interesting! I didn't even try 'media_interaction off' because I didn't 
think any actual scattering contribution could darken the media photons 
like that. I don't understand what is happening with the calculated 
scattering value where we have collected media photons...

This scene unlike the bug report one doesn't have the photon path cross 
back over the scattered media path...

(The initial beam probably isn't showing up because it depends 
completely on the scattering result - but I don't 'see' the geometries 
well enough to be sure.)

Out of time. I'll try to look at this again tomorrow

Bill P.


Post a reply to this message

From: William F Pokorny
Subject: Re: Cylindrical light source casts a shadow on media
Date: 25 Aug 2025 22:10:05
Message: <68ad177d@news.povray.org>
On 8/25/25 17:17, William F Pokorny wrote:
>> But for some reason, the unrefracted light beam isn't showing.
> 
> Interesting! I didn't even try 'media_interaction off' because I didn't 
> think any actual scattering contribution could darken the media photons 
> like that. I don't understand what is happening with the calculated 
> scattering value where we have collected media photons...
> 
> This scene unlike the bug report one doesn't have the photon path cross 
> back over the scattered media path...
> 
> (The initial beam probably isn't showing up because it depends 
> completely on the scattering result - but I don't 'see' the geometries 
> well enough to be sure.)

OK. The origin of the light source is inside the box{} media container - 
  which is invalid for scattering media calculations; Here in a way 
tangled with the photon + scattered media calculations(1).

In the light_source{} block:

     <0, -HALFH - 0.99, -3>, rgb 1

should read:

     <0, -HALFH - 1.01, -3>, rgb 1

With that change and adding:

     photons { target collect off reflection on refraction on }

to the media-box{} block - we get the, additive, results in the top row 
of the attached image as one might expect.

If we then add:

     media_interaction off

to the light_source{} block (as you already have), we get the results in 
the bottom row of the attached image.

Bill P.

(1) No. I've not run down 'exactly' why the scattering + photons 
calculation goes wrong when the light source is inside the media box. 
Given we know that's an invalid set up, I'm not motivated at the moment 
to run it down.


Post a reply to this message


Attachments:
Download 'ricky_brunocabbason_story.png' (158 KB)

Preview of image 'ricky_brunocabbason_story.png'
ricky_brunocabbason_story.png


 

From: Cousin Ricky
Subject: Re: Cylindrical light source casts a shadow on media
Date: 26 Aug 2025 19:45:00
Message: <web.68ae4651be0af49b60e0cc3d949c357d@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> I'm taking a stab at reproducing Bruno Cabbason's "Extreme optics," but
> as far as I can tell, he has not published his source code.

Yikes!  I just noticed I spelled "Cabasson" wrong.  My apologies.


Post a reply to this message

From: William F Pokorny
Subject: Re: Cylindrical light source casts a shadow on media
Date: 27 Aug 2025 08:34:17
Message: <68aefb49$1@news.povray.org>
On 8/26/25 19:42, Cousin Ricky wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
>> I'm taking a stab at reproducing Bruno Cabbason's "Extreme optics," but
>> as far as I can tell, he has not published his source code.
> 
> Yikes!  I just noticed I spelled "Cabasson" wrong.  My apologies.
> 
> 

And, I followed right along... :-(

I don't recall ever seeing that image. It's really cool! For others who 
might have been distracted too at the time:

https://news.povray.org/povray.binaries.images/thread/%3Cweb.4d54f6b329b411e54aa45fdf0@news.povray.org%3E/

He mentioned having to run with jitter off to avoid splotchy results - 
but then getting the banding (interference fringes). I think the banding 
spoken about is likely the photon distribution issue mentioned 
previously in this thread - which is fixed in the yuqk fork. Attached an 
image of your scene (plus previously mentioned adjustments), global 
photon jitter off, no AA, with v38 results on the top and yuqk on the 
bottom (1).

---

Aside: Puzzling performance results. I am unsure why yuqk is so much 
faster with the scene set up for the attached image?

v3.7
577.29user 0.33system 2:42.95elapsed 354%CPU

v3.8 beta 2
572.11user 0.35system 2:33.45elapsed 373%CPU

yuqk
105.71user 0.13system 0:33.08elapsed 320%CPU

Bill P.

(1) - Yuqk's global photon jitter on|off results look pretty much the same.


Post a reply to this message


Attachments:
Download 'bandingfixinyuqk.png' (162 KB)

Preview of image 'bandingfixinyuqk.png'
bandingfixinyuqk.png


 

From: William F Pokorny
Subject: Re: Cylindrical light source casts a shadow on media
Date: 27 Aug 2025 21:45:05
Message: <68afb4a1$1@news.povray.org>
On 8/27/25 08:34, William F Pokorny wrote:
> Aside: Puzzling performance results. I am unsure why yuqk is so much 
> faster with the scene set up for the attached image?
> 
> v3.7
> 577.29user 0.33system 2:42.95elapsed 354%CPU
> 
> v3.8 beta 2
> 572.11user 0.35system 2:33.45elapsed 373%CPU
> 
> yuqk
> 105.71user 0.13system 0:33.08elapsed 320%CPU

With global photon jitter on:

1) The number of stored photons for v3.8 beta 2 remains about the same 
whether the jitter is on or off. With yuqk there is an increase in 
stored photons of about 2.3% over yuqk run with global photon jitter off.

2) With global photon jitter on, the number of stored photons is exactly 
the same between v3.8 b2 and yuqk.

3) The performance given (2) becomes comparable too:

v3.8 beta 2
131.73user 0.20system 0:42.00elapsed 314%CPU

yuqk
131.10user 0.14system 0:40.54elapsed 323%CPU

---

So, the yuqk fix to the photon distribution where jitter is off seems to 
be the trigger for the many times better performance in that case. 
However, I'm left lost as to why a better distribution of stored photons 
matters so much to the 'render stage' performance.

Been a long time since I was in the photon code for the photon 
distribution fix, but IIRC, the global photon jitter is 'jittering' the 
spiral shooting pattern of forward tracing photon rays. The yuqk fix 
changed how the photons are distributed along each shot photon ray in 
the media.

Both the fix and the spiral photon shooting jitter make the distribution 
of stored photons more noisy / random in the stored media - and this 
apparently helps 'something' in the photon code work a lot faster.

Bill P.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.