POV-Ray : Newsgroups : povray.programming : True Diffraction Server Time
29 Jul 2024 04:29:48 EDT (-0400)
  True Diffraction (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
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 10 Messages Goto Initial 10 Messages

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