POV-Ray : Newsgroups : povray.general : Glories, POV-Ray, and diffraction Server Time
22 Feb 2025 11:55:44 EST (-0500)
  Glories, POV-Ray, and diffraction (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
From: Cousin Ricky
Subject: Glories, POV-Ray, and diffraction
Date: 8 Feb 2025 17:09:50
Message: <67a7d62e$1@news.povray.org>
Many years ago, alphaQuad aka Melody issued a glory ping pong challenge,
but was quite unsuccessful.

http://news.povray.org/povray.binaries.images/thread/%3Cweb.4834b239d2ad962989f6d7ba0%40news.povray.org%3E/

I tried my own tests, with unsatisfying results.  milco2006 had more
success, but warned it was probably not what alphaQuad was looking for.

Then I came across this video: https://youtu.be/24GfgNtnjXc

At 21:33, the video explains that glories rely on diffraction
interference; but, aside from the irid feature, POV-Ray doesn't do
diffraction!  It seems that glories were a fool's errand on this
platform... unless...

Unless someone can think of some clever way to simulate diffractive
effects.  I won't say it can't be done; that would only ensure that it
*won't* be done.  Perhaps some clever (ab)use of irid?  Or finding a way
to accurately fake it with regular ior and dispersion?


Post a reply to this message

From: Bald Eagle
Subject: Re: Glories, POV-Ray, and diffraction
Date: 8 Feb 2025 18:50:00
Message: <web.67a7ecb6dc4a579e1f9dae3025979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:

> At 21:33, the video explains that glories rely on diffraction
> interference; but, aside from the irid feature, POV-Ray doesn't do
> diffraction!  It seems that glories were a fool's errand on this
> platform... unless...
>
> Unless someone can think of some clever way to simulate diffractive
> effects.

Why not define a full-color pigment function that uses average {} and some kind
of function related to the distance from some point from the camera?
Then you could assign wavelengths and phase shifts, and get the overlapping
color effect?

Might be worth contacting Grant Sanderson (3Blue1Brown),
https://www.youtube.com/@ezfzx, or Eugene Khutoryansky
https://www.youtube.com/@EugeneKhutoryansky/videos,


If anyone could do it, these people could.

I would imagine that WFP, TOK, and Jerome Grimbert would have an idea or two.

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: Glories, POV-Ray, and diffraction
Date: 9 Feb 2025 11:45:00
Message: <web.67a8da99dc4a579e1f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Why not define a full-color pigment function that uses average {} and some kind
> of function related to the distance from some point from the camera?
> Then you could assign wavelengths and phase shifts, and get the overlapping
> color effect?

So, this jogged my memory of when i was playing with some optical effect
patterns.
Do we think this might be a way forward?

http://news.povray.org/povray.binaries.images/thread/%3Cweb.66a046cea7254f9e1f9dae3025979125%40news.povray.org%3E/


Post a reply to this message

From: Bald Eagle
Subject: Re: Glories, POV-Ray, and diffraction
Date: 9 Feb 2025 16:05:00
Message: <web.67a9178cdc4a579e1f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Do we think this might be a way forward?
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.66a046cea7254f9e1f9dae3025979125%40news.povray.org%3E/

Yep, I think we're on to something:

"Using the standard assumptions of diffraction theory, he formulated the local

renamed the Airy integral in his honor; it is related to the now familiar Airy
function. It is analogous to the Fresnel integrals which also arise in
diffraction theory."

https://digitalcommons.odu.edu/cgi/viewcontent.cgi?article=1157&context=mathstat_fac_pubs


Post a reply to this message

From: Bald Eagle
Subject: Re: Glories, POV-Ray, and diffraction
Date: 10 Feb 2025 09:50:00
Message: <web.67aa1176dc4a579e25b4de9225979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:

> Unless someone can think of some clever way to simulate diffractive
> effects.  I won't say it can't be done; that would only ensure that it
> *won't* be done.  Perhaps some clever (ab)use of irid?  Or finding a way
> to accurately fake it with regular ior and dispersion?

I took an initial stab at this using the interference model, and that was
probably too complicated an approach (for now).

My current experiment is trying to implement this:

We know that the effect is angle-dependent.  "The rainbow isn't at any distance
from you - it's simply coming from a _direction."

So I played a bit with calculating the angle on an image plane, using only the
2-4 degree angle of the glory, and then trying to remap those angles to
0-(approx) 280 so that I could just apply an HSV color gradient across it.

Sleep and coffee let my brain see that using something *like* a sky_sphere would
be the way to go.  Then it's just a matter of daisy-chaining functions together
to get the rgb 1 emissive inner circle, the Alexander's dark band, and whatever
other higher order rainbows the user decides to include.

Maybe there's somehow something that can be done with an actual cone {} spanning
the desired angles, and some kind of intersection {} with a hollow sphere could
be used?  Media with a df3?

I like the irid idea - I'll have to take a look at the source for that to see if
something can be implemented using that code.

With regard to my earlier recognition that the glory resembled the Fresnel
diffraction pattern in shadows:  What if one used an emissive light source that
had the ROYGBIV HSV gradient, and it cast a penumbral shadow?


Post a reply to this message

From: Bald Eagle
Subject: Re: Glories, POV-Ray, and diffraction
Date: 10 Feb 2025 12:20:00
Message: <web.67aa34fcdc4a579e25b4de9225979125@news.povray.org>
There are also thousands of shaders to use as inspiration.

https://www.shadertoy.com/view/WtGyW1

https://www.shadertoy.com/view/Wsj3zh

https://www.shadertoy.com/view/3dj3zh

https://www.shadertoy.com/view/WsS3Rz

https://www.shadertoy.com/view/WlfXzB

https://www.shadertoy.com/view/wtsyDl


Post a reply to this message

From: Cousin Ricky
Subject: Re: Glories, POV-Ray, and diffraction
Date: 10 Feb 2025 15:33:12
Message: <67aa6288$1@news.povray.org>
On 2025-02-10 10:47 )-4), Bald Eagle wrote:
> 
> With regard to my earlier recognition that the glory resembled the Fresnel
> diffraction pattern in shadows:  What if one used an emissive light source that
> had the ROYGBIV HSV gradient, and it cast a penumbral shadow?

How does one put a hue gradient on a light source?  Are you thinking
about a filter in front of the light source?  And how would you convert
ROYGBIV into an interference pattern?

It just occurred to me that I have played with diffraction interference:

  https://news.povray.org/55719ced%40news.povray.org

I did these images using layers of emissive media with a density
function.  For the RGB image, I stacked separate layers for red, green,
and blue respectively.  For the spectral image, I rendered an
intermediate EXR image for each of 36 wavelengths, then combined them.


Post a reply to this message

From: Bald Eagle
Subject: Re: Glories, POV-Ray, and diffraction
Date: 10 Feb 2025 16:05:00
Message: <web.67aa690ddc4a579e25b4de9225979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:

> How does one put a hue gradient on a light source?  Are you thinking
> about a filter in front of the light source?

Put a hue gradient on an object and give it an emission 1 finish?
Use projected_through?

  And how would you convert
> ROYGBIV into an interference pattern?

Look at the rainbow pages.  They have interference patterns for different
colors.  Then they sum them up.  Write a macro that creates the functions for
the wavelengths and sums them up.  Have the number of discrete wavelengths that
you want to use in the visible spectrum be the argument for the macro.

Something with a Fourier transform?

- or -

I don't think we would.  I think we'd diagram out what would happen if the
interference pattern was the originating mechanism of the result - but then see
if there's just some overall function that describes the HSV result.

Or just fake the hell out of it with something that for all intents and purposes
looks good enough.

My Fresnel diffraction pattern was rendered with a simple equation describing
the end result.  I didn't model the interference in any way whatsoever.

I think the key here is to not get all tangled up in trying to work _through_
all of the physically-based processes - but rather summarize the overall result.
Like writing out the big intermediate equation - and then canceling out a bunch
of terms.  Physicists apparently do intermediate calculations with imaginary
numbers and negative temperatures - but that's only the procedural path to the
answer.

I posted a lot of stuff that doesn't try to calculate an infinite number of
wavelengths.  Let those be the guide.

How do we calculate integrals?  Those can be considered the sum of an infinite
number of thin strips underneath the curve - but we don't actually process those
infinite number of strips, do we?  We just "do the math", and the result pops
out the end.

So we just find a way to "do the math" and get something that works.

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: Glories, POV-Ray, and diffraction
Date: 10 Feb 2025 16:15:00
Message: <web.67aa6b99dc4a579e25b4de9225979125@news.povray.org>
https://earthsky.org/space/glory-on-an-exoplanet-wasp-76b-exoplanets-glories/

relevant image:
https://earthsky.org/upl/2024/04/Glories-Earth-Venus-simulated-views-March-11-2014.jpg

"This is a _simulated_ comparison of a glory on Venus (left) and Earth (right)."

So people are actually simulating the effect - which means that we can do it in
POV-Ray.

Hell - even if we just scanned straight across the middle with eval_pigment ()
and made a spline function or a color_map directly, then there you go.
Instant glory to be used as a layered texture, a screen.inc object, or however
else you might decide to implement it.

K.I.S.S.    :*


Post a reply to this message

From: Alain Martel
Subject: Re: Glories, POV-Ray, and diffraction
Date: 11 Feb 2025 09:15:54
Message: <67ab5b9a$1@news.povray.org>
Le 2025-02-10 à 16:01, Bald Eagle a écrit :
> Cousin Ricky <ric### [at] yahoocom> wrote:
> 
>> How does one put a hue gradient on a light source?  Are you thinking
>> about a filter in front of the light source?
> 
> Put a hue gradient on an object and give it an emission 1 finish?
> Use projected_through?
> 
>  
Tried projected_through with a filtering pattern creating a gradient. It 
don't work. You get a warning about projected_through requiring a 
texture-less object, and the pigment or pattern is ignored.


Post a reply to this message

Goto Latest 10 Messages Next 7 Messages >>>

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