POV-Ray : Newsgroups : povray.programming : True Diffraction Server Time
29 Jul 2024 04:32:40 EDT (-0400)
  True Diffraction (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Mike
Subject: Re: True Diffraction
Date: 9 Feb 1999 05:19:59
Message: <36C00AFF.93F2F37@aol.com>
I have a book that talks about diffraction gratings.  Says a typical one
has 14,000 to 15,000 rulings per inch and that for maximum efficiency
the seperation of them should be on the order of 1/50,000 inch, or about
the wavelength of light.

I would think aliasing would be a problem. ;)

-Mike

Carl Bartels wrote:
> 
> Does anybody have any thoughts about making a patch to add true
> diffraction
> to povray.  For example, the idea of double slit interfearence pattern
> or the
> diffraction of a pinhole (good-grief, Bessel functions!)  Or would
> mathematical
> optics (vs. geometrical optics) not be raytracing anymore?
> 
> I've never done much with pov except apply patches and trace scenes so
> if anyone
> has some idea, please let me know.
> --
> Carl Bartels, Department of Chemsitry, Mcgill University, to reply to
> me,
> just kill a and 5 from the email name, Montreal, QC, cAnAdA


Post a reply to this message

From: Ken
Subject: Re: True Diffraction
Date: 9 Feb 1999 10:55:55
Message: <36C05A4A.F28CD725@pacbell.net>
Mike wrote:
> 
> I have a book that talks about diffraction gratings.  Says a typical one
> has 14,000 to 15,000 rulings per inch and that for maximum efficiency
> the seperation of them should be on the order of 1/50,000 inch, or about
> the wavelength of light.
> 
> I would think aliasing would be a problem. ;)
> 
> -Mike

Wouldn't that depend on how far the camera were placed from the surface ?

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Carl Bartels
Subject: Re: True Diffraction
Date: 9 Feb 1999 19:23:14
Message: <36C0D164.66A25154@bravo436.chem.mcgill.ca>
Mike wrote:
> 
> I have a book that talks about diffraction gratings.  Says a typical one
> has 14,000 to 15,000 rulings per inch and that for maximum efficiency
> the seperation of them should be on the order of 1/50,000 inch, or about
> the wavelength of light.
> 
> I would think aliasing would be a problem. ;)

Well, that's because of what they are designed to do.  One big use is in
spectroscopy where they want a nice reliable, computable relationship
between the angle of deflection and wavelength.  Prisms don't cut it
because the dispersion isn't a linear (or anything else) function of
wavelength.  Diffraction off that sort of grating is very well defined
though.  But you don't need a grating.  Find your local gadget freak and
try to borrow their laser pointer.  While you're at it, yank one of
their hairs out.  Now find a white wall and blast the laser at the wall
and stick the hair in the way.  You get the main spot from the pointer,
but also some nifty satelite spots on either side.  Or, try flashing it
off a CD and see how many spots you get.  That's the sort of thing I'm
talking about.  

My guess is that it would have to deal with things in two ways. 
Diffraction due to the shape of some small, individual object (hair,
pinhole, etc.) and diffraction due to a grating type texture that would
treat things like the opalescence does now.

-- 
Carl Bartels, Department of Chemsitry, Mcgill University, to reply to
me,
just kill a and 5 from the email name, Montreal, QC, cAnAdA


Post a reply to this message

From: Nathan Kopp
Subject: Re: True Diffraction
Date: 9 Feb 1999 21:29:25
Message: <36C0EF4F.EE512811@Kopp.com>
Ken wrote:
> 
> Mike wrote:
> >
> > I have a book that talks about diffraction gratings.  Says a typical one
> > has 14,000 to 15,000 rulings per inch and that for maximum efficiency
> > the seperation of them should be on the order of 1/50,000 inch, or about
> > the wavelength of light.
> >
> > I would think aliasing would be a problem. ;)
> >
> > -Mike
> 
> Wouldn't that depend on how far the camera were placed from the surface ?
> 
> --
> Ken Tyler
> 

How close do you want to get?  ;-)

Seriously... doing this kind of diffraction would be very difficult.  First,
as someone else mentioned, it would require backwards ray tracing.
Secondly, it would require modeling light as waves instead of particles.
The ray-tracing model can be visualized as lots of tiny particles flying
through space.  I'm not sure how you'd change this model to incorporate
expanding wavefronts.

If anyone has any ideas, I'd be interested to hear them.  Keep in mind
the very small size of these objects/slits that will be causing
diffraction, and how dense you would need to trace rays in order to
guarantee enough rays going through the slit or getting close enough
to the strand of hair.

Also keep in mind the (amount of work):(amount it affects an image)
ratio.  ;-)

-Nathan


Post a reply to this message

From: Peter Popov
Subject: Re: True Diffraction
Date: 10 Feb 1999 00:22:56
Message: <36c2135b.3559612@news.povray.org>
On Tue, 09 Feb 1999 21:30:39 -0500, Nathan Kopp <Nat### [at] Koppcom>
wrote:

>Seriously... doing this kind of diffraction would be very difficult.  First,
>as someone else mentioned, it would require backwards ray tracing.
>Secondly, it would require modeling light as waves instead of particles.
>The ray-tracing model can be visualized as lots of tiny particles flying
>through space.  I'm not sure how you'd change this model to incorporate
>expanding wavefronts.

>If anyone has any ideas, I'd be interested to hear them.  Keep in mind
>the very small size of these objects/slits that will be causing
>diffraction, and how dense you would need to trace rays in order to
>guarantee enough rays going through the slit or getting close enough
>to the strand of hair.
>
>Also keep in mind the (amount of work):(amount it affects an image)
>ratio.  ;-)
>
>-Nathan

You don't need to model waves (id est, trace spheres) and you can't. A
spherical wave has infinitely many intersection with a plane, the ones
cophasal forming ellipses. OTOH, if you trace rays and remember that
not only x,y and z, but also phi (phase shift) are functions of t. So
for interference, once you've told the program where the slit is, it
will trace it's bounding box with a number of rays and then treat the
rays hitting the edges of the slit (in an epsilon vicinity) as
secondary sources. Now if you look at the screen (i.e. send a camera
ray to it) you'll see that is is lit by these secondary light sources
(or photons if you wish :) ), but if you keep in mind phase shifts you
can correctly calculate the total light intensity at a point, i.e. get
minima and maxima. Same counts for diffraction (what are 100000
photons for Pete's sake? :) ), if the program knows where the grating
is and how dense, it could send a ray per aperture quite precisely.
Hair, too. In summary, you don't want diffraction etc. patterns
throrought the whole pic, so concentrate the rays where you know you
need them.

Another problem is wavelength. While one can specify it implicitly for
the aforementioned purposes, it is needed for dispersion, Rayleigh
scattering, etc. I have given thought to this and even tried to find
away to Fourier-analyse rgb components :) (I was young and naive then,
now I'm only young), but gave up and concluded that simple sampling
will be easier. Someone else found this before I did (Greetings Mr.
Wilson ), it seems. I thought that, instead of rgbf colours, light
spectrum could be used (like a color_map, but shows the intensity and
absorption of light for different wavelenghts), but then again,
nobody's *that* crazy to use this things.

Well that's my 35lv on the topic.

Peter


Post a reply to this message

From: Nathan Kopp
Subject: Re: True Diffraction
Date: 11 Feb 1999 00:26:04
Message: <36C26A31.B9F85D0D@Kopp.com>
Peter Popov wrote:
> 
> Another problem is wavelength. While one can specify it implicitly for
> the aforementioned purposes, it is needed for dispersion, Rayleigh
> scattering, etc. I have given thought to this and even tried to find
> away to Fourier-analyse rgb components :) (I was young and naive then,
> now I'm only young), but gave up and concluded that simple sampling
> will be easier. Someone else found this before I did (Greetings Mr.
> Wilson ), it seems. I thought that, instead of rgbf colours, light
> spectrum could be used (like a color_map, but shows the intensity and
> absorption of light for different wavelenghts), but then again,
> nobody's *that* crazy to use this things.
> 

I just added (to my photon mapping stuff) an option to define a light's
color as a color_map, replacing the single color.  This color_map
defines all of the frequencies/intensities inside the single light, so
that it is properly split up when it hits an object that causes
dispersion.  It's neat, because you can have one scene where a yellow
light gets split into red and green, and another where the same yellow
stays yellow (pure yellow wavelength).

-Nathan


Post a reply to this message

From: Ken
Subject: Re: True Diffraction
Date: 11 Feb 1999 00:48:22
Message: <36C26EEC.2C30E68B@pacbell.net>
Nathan Kopp wrote:
> 
> Peter Popov wrote:
> >
> > Another problem is wavelength. While one can specify it implicitly for
> > the aforementioned purposes, it is needed for dispersion, Rayleigh
> > scattering, etc. I have given thought to this and even tried to find
> > away to Fourier-analyse rgb components :) (I was young and naive then,
> > now I'm only young), but gave up and concluded that simple sampling
> > will be easier. Someone else found this before I did (Greetings Mr.
> > Wilson ), it seems. I thought that, instead of rgbf colours, light
> > spectrum could be used (like a color_map, but shows the intensity and
> > absorption of light for different wavelenghts), but then again,
> > nobody's *that* crazy to use this things.
> >
> 
> I just added (to my photon mapping stuff) an option to define a light's
> color as a color_map, replacing the single color.  This color_map
> defines all of the frequencies/intensities inside the single light, so
> that it is properly split up when it hits an object that causes
> dispersion.  It's neat, because you can have one scene where a yellow
> light gets split into red and green, and another where the same yellow
> stays yellow (pure yellow wavelength).
> 
> -Nathan


  Does this take into account color temperature as measured in kelvins ?

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Nathan Kopp
Subject: Re: True Diffraction
Date: 11 Feb 1999 13:30:24
Message: <36C32204.9488C681@Kopp.com>
Ken wrote:
> 
> 
>   Does this take into account color temperature as measured in kelvins ?
> 

Probably not.  The code does an RGB->HSV conversion, uses the hue as
an estimate of wavelength, and then uses one of DSW's routines to find
the new IOR for that wavelength.  It's all kind of faked (not real
physics, AFAIK).

-Nathan


Post a reply to this message

From: Daren Scot Wilson
Subject: Re: True Diffraction
Date: 13 Feb 1999 19:55:32
Message: <36C5D8B9.1B6AE1C5@pipeline.com>
Wow, the things I miss when I stay off-line for three days..

> , uses the hue as
> an estimate of wavelength, and then uses one of DSW's routines to find
> the new IOR for that wavelength.


The hue -> color routine probably should be polished up, renamed, documented,
and put in colour.c.   User-defineable functions should be allowed, too.  

But too much messing with such things causes our new & improved povray to
diverge from the official one.   



-- 
Daren Scot Wilson
dar### [at] pipelinecom 
www.newcolor.com
----
"A ship in a harbor is safe, but that is not what ships are built for"
                                            -- William Shedd


Post a reply to this message

From: Daren Scot Wilson
Subject: Re: True Diffraction
Date: 13 Feb 1999 20:51:22
Message: <36C5E5CE.5289B028@pipeline.com>
After finishing my first dispersion patch, the messy one using an exanded
Colour structure, I thought about diffraction.  

 There were two situations to consider: one-slit diffraction, and two-slit
diffraction.  There's also the one-edge situation which made things hard.
 
 One-slit would need for light from a light_source to spread after passing
through a small hole or close to an edge.  I don't trust software to recognize
such things, and to keep the computational load down, I'd have put in a new
keyword for any object, or part of an object such as a CSG-made hole, or edges
of objects, to indicate they should affect light in a diffractive way.   Most
objects in a typical scene would should not do this.   Also, those
light_sources providing the light to be diffracted would be marked with a new
keyword, although I wasn't sure if this was really needed.

The light coming out of a small hole would actually be no different than light
form a light source.   Any diffraction object could be modelled as a pseudo
light_source, with a phase.     Really, to get light to spread from a pinhole
or slit wasn't going to be any trouble.

Two-hole diffraction requires interference, and would need a phase to be
attributed to each ray landing on the spot whose illumination is being
computed.  This would apply only to the rays coming from the specially marked
light sources.  Other sources are assumed to add incoherently - no interference
effects.

Phase would depend on wavelength, but to make the geometric part of the
calculation easier, rays would carry only distance, and when needed phase would
be calculated from the rays total distance (from its light source) divided by
wavelenght.  For how many wavelengths do we repeat the calculation?  At the
time, I was using a 9-component "rgb" value.  (See
http://www.newcolor.com/darenw/dswpov/disp0.html)  It would be better to stick
with regular 3-comp rgb, and run a loop like I do in my recent dispersion patch
(the one that's making me rich and famous :-).   

When povray computes the illumination at some point on a surface, it normally
adds all the light coming from all visible light sources, accounting for fading
laws, etc.   Just need to toss in one more term in the formula, one that adds
the diffracting objects (pinholes) which, as I've said, would be pseudo light
sources, taking into account phases.  Simple math.

That didn't seem too hard, either, at least for tiny pinholes.  But what about
larger openings in objects?  Model them with an array of pseudo light sources.
A larger circular aperture could be filled in with 100 light sources, no need
for Bessel functions. Any shape of aperture would be no problem.

What about light grazing the edge of an object?  An array, again, but couldn't
think of any well-defined way to set it up.  Do something special using Airy
functions and all that?  Maybe.  IN any case, it did not seem to be a big
problem, just one needing some thought and time.


I would have done diffraction a year ago, except: 1) was job hunting and had
the misfortune of actually finding a good full-time job, so there went my free
time.  2) had great ideas for scenes not requiring diffraction. One thing at a
time....  3) The parser was harder to work with back then.   

Now, I'm still busy doing other things, but it's always been in the back of my
mind to try diffraction.  I hope someone else beats me to it, then I can
concentrate on art :-)

BTW, I would never attempt to optically model a diffraction grating, but set up
fake invisible light source for the colors, and a plain simple gray rectangle
for the grating.  Tha't simple.  Physics is Hard ;-)

-- 
Daren Scot Wilson
dar### [at] pipelinecom 
www.newcolor.com
----
"A ship in a harbor is safe, but that is not what ships are built for"
                                            -- William Shedd


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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