POV-Ray : Newsgroups : povray.general : how (if at all) can i change the wavelength of light in pov? Server Time
16 Nov 2024 09:21:04 EST (-0500)
  how (if at all) can i change the wavelength of light in pov? (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From:
Subject: how (if at all) can i change the wavelength of light in pov?
Date: 17 Aug 1998 19:50:13
Message: <35D8B42C.469871E6@shaw.wave.ca>
um... subject kinda says it all.  i remember way back when, there being
the whole question of modelling a sparkling diamond.  the proposed
answers hinted at rendering the scene 3 times.  once with a red light,
once a green, and once a blue.  then composite them.  of course, each
render would see the light's wavelength altered such that the images
would be different.  unfortunately, i don't remember how this could (or
IF it could) be accomplished


Post a reply to this message

From: Philippe Debar
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 17 Aug 1998 20:24:39
Message: <35d8bbb7.0@news.povray.org>

>um... subject kinda says it all.  i remember way back when, there being
>the whole question of modelling a sparkling diamond.  the proposed
>answers hinted at rendering the scene 3 times.  once with a red light,
>once a green, and once a blue.  then composite them.  of course, each
>render would see the light's wavelength altered such that the images
>would be different.  unfortunately, i don't remember how this could (or
>IF it could) be accomplished
>

You could try rendering the scene three times, each with a differently
colored
light (rgb <1,0,0> ; <0,1,0> and <0,0,1> would be favorite) and a different
IOR
for the diamond - and the composite the images.

A finer approach would be, with the animation clock variable:
(1) vary the color of lighting according to the light spectrum
     to simulate different wavelengths;
(2) at the same time, vary the ior value, according to the real
     ior(wavelength law);
(3) composite the resulting images (as many as you want)

Don't ask me about how to get a monochromatic wavelenght
in rgb color space, nor the ior(wavelength) formula :-)

I hope this helps you...

(I would be interested to see the results)

Ray-tracingly,


Philippe

phi### [at] hotmailcom


Post a reply to this message

From:
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 17 Aug 1998 22:01:53
Message: <35D8D2E4.7829448F@shaw.wave.ca>
> (2) at the same time, vary the ior value, according to the real
>      ior(wavelength law);

the problem with this, however, is that any background picture would be
kinda blurry & trippy, no?


Post a reply to this message

From: Thomas Willhalm
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 18 Aug 1998 05:20:53
Message: <qqmyasmn1jv.fsf@goldach.fmi.uni-konstanz.de>
"Philippe Debar" <phi### [at] hotmailcom> writes:


> >um... subject kinda says it all.  i remember way back when, there being
> >the whole question of modelling a sparkling diamond.  the proposed
> >answers hinted at rendering the scene 3 times.  once with a red light,
> >once a green, and once a blue.  then composite them.  of course, each
> >render would see the light's wavelength altered such that the images
> >would be different.  unfortunately, i don't remember how this could (or
> >IF it could) be accomplished
> >
> 
> You could try rendering the scene three times, each with a differently
> colored
> light (rgb <1,0,0> ; <0,1,0> and <0,0,1> would be favorite) and a different
> IOR
> for the diamond - and the composite the images.
> 
> A finer approach would be, with the animation clock variable:
> (1) vary the color of lighting according to the light spectrum
>      to simulate different wavelengths;
> (2) at the same time, vary the ior value, according to the real
>      ior(wavelength law);
> (3) composite the resulting images (as many as you want)
> 
> Don't ask me about how to get a monochromatic wavelenght
> in rgb color space, 

But you can ask me:

// --- frequency.inc ----
// Tho### [at] uni-konstanzde
// usage:
//  #declare wavelength= ...
//  #include "frequency.inc"
//
pigment { color rgb
#if (wavelength<440)
  <(440-wavelength)/60,0,1>
#end
#if ((wavelength>=440)&(wavelength<490)) 
  <0,(wavelength-440)/50,1>
#end
#if ((wavelength>=490)&(wavelength<510))  
  <0,1,(510-wavelength)/20>
#end
#if ((wavelength>=510)&(wavelength<580))  
  <(wavelength-510)/70,1,0>
#end
#if ((wavelength>=580)&(wavelength<645)) 
  <1,(645-wavelength)/65,0>
#end
#if (wavelength>=645)
  <1,0,0>
#end

#if (wavelength>700)
    *(0.3+0.00875*(780-wavelength))
#else 
  #if (wavelength<420)
    *(0.3+0.0175*(wavelength-380))
  #end
#end
}
// --- end of frequency.inc ---

It is only a linear interpolation, but I hope it helps.

Thomas

-- 
http://www.fmi.uni-konstanz.de/~willhalm


Post a reply to this message

From: Fabien Mosen
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 18 Aug 1998 13:24:44
Message: <35d9aacc.0@news.povray.org>
Sorry, but none of the proposals will achieved the desired result.
Changing IOR only change the way you see trough an object, but
doesn't (in Pov) affect the path of the light passing trough.

I know an example of "diffractive" raytracing :
http://math1.uibk.ac.at/%28de%29/~werner/light/spectrum/

But current Pov implementation doesn't allow that.

What I would suggest is : render your scene with 3 or more
lights, each having a color from the spectrum, and make them
slightly shifted from each other.
This would, at least, make interesting shadows...

Cheers,
Fabien.


Post a reply to this message

From: Philippe Debar
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 18 Aug 1998 18:17:07
Message: <35d9ef53.0@news.povray.org>
Uho...

...You're right, Fabien...

...I guess that'll teach me to play Mr Clever...

...I should have turned my mouse seven times around its pad before posting
my reply...

...maybe next time ...


Post a reply to this message

From: K  Tyler
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 18 Aug 1998 18:28:52
Message: <35D9E3AA.DC6BF064@pacbell.net>
Fabien Mosen wrote:

> Sorry, but none of the proposals will achieved the desired result.
> Changing IOR only change the way you see trough an object, but
> doesn't (in Pov) affect the path of the light passing trough.
>
> I know an example of "diffractive" raytracing :
> http://math1.uibk.ac.at/%28de%29/~werner/light/spectrum/
>
> But current Pov implementation doesn't allow that.
>
> What I would suggest is : render your scene with 3 or more
> lights, each having a color from the spectrum, and make them
> slightly shifted from each other.
> This would, at least, make interesting shadows...
>
> Cheers,
> Fabien.

There is an old porgram that yeilds some interesting though perhaps
not the desired results your seeking. Here is the entirety of the programs
docs.

------------------

Prisms - Chromatic Dispersion Simulation Program

  (c) Jeff Bowermaster
      Splat! Graphics
      5/23/92

     Adds together three separate Targa images one color from each.
     When refractive objects are given slighty different ior's in each image,
     the effect simulates chromatic dispersion (i.e., prisms 'n rainbows).

        Usage: Prisms [infiles prefix]

     Each file has a prefix name with numeric suffix's 1, 2 and 3.


     Example:

        PICTURE1.TGA, PICTURE2.TGA, PICTURE3.TGA are three images created
        with refractive elements whose ior values differ slightly.  These
        three images would be combined by typing

             Prisms PICTURE

        The summed image will be written to PICTURES.TGA

     This only works with uncompressed type 2 TGA's.  It's easier.

     Some suggested ior values would be 1.4, 1.45 and 1.5 for glass,
     2.4, 2.5 and 2.6 for diamond.  These changes in ior greatly exceed
     reality (a tenth this change is more like it) but when real values
     are used the effects are too subtle to notice.

     Please experiment.

     I experimented with using 6 images instead of three, but the colors
     started washing out.  I did try a variety of range combinations and
     certain refractive objects looked better using certain ranges, but
     the only way to find out is to try 'em.

     No provisions are made for garbage in/garbage out.
------------------------

If anyone is interested I have the program and will foreward it those who ask.

K.Tyler


Post a reply to this message

From: Dan Connelly
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 18 Aug 1998 19:43:47
Message: <35DA03A5.F3ACAC5@flash.net>
As is mentioned in 
http://math1.uibk.ac.at/%28de%29/~werner/light/spectrum/

even 6 colors is inadequate.

Consider a vertical slit white light souce (we are neglecting
the wave nature of light, of course) which enters a prism.

What comes out isn't 3 slits of light, one red, one green,
and one blue, but a rectangular band of light encompassing 
the entire spectrum.

To properly model prisms, one must either use a large number
of color samples (whose rgb components sum to 1) or to apply
some sort of spatial broadening algorithm based on
d ior / d k_light to each of the r, g, and b beams.

Dan

K. Tyler cited:
> 
>   (c) Jeff Bowermaster
>       Splat! Graphics
>       5/23/92
>      I experimented with using 6 images instead of three, but the colors
>      started washing out.


-- 
http://www.flash.net/~djconnel/


Post a reply to this message

From: Peter Popov
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 19 Aug 1998 00:36:32
Message: <35da4840.0@news.povray.org>
>> cut
>But you can ask me:
>
> (frequency.inc) code cut
>
>It is only a linear interpolation, but I hope it helps.

It helps me for one. I have a (much more difficult to answer) question: how
about Fourier analysis of a rgb coded color? Will it be easier if
light_sources are (optionally) specified as wavelengths? What if there is a
filter_map and reflecton_map to specify the absorbtion and reflection
spectra of a bofy? Won't these give more realistic light dispersion than the
current dispersion patch gives? I once wanted to develop (only the math
stuff of) a dispersion patch but gave up at the above questions. I came up
with the same sampling algorithm used in the dispersion patch (back then I
was thinking of more user control to it but it turned  out it looks fine as
is)


>
>Thomas
>
>--
>http://www.fmi.uni-konstanz.de/~willhalm

Regards,

--Peter

pet### [at] usanet


Post a reply to this message

From: Chris Maryan
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 19 Aug 1998 02:19:21
Message: <35DA5E0C.B5F1EF25@geocities.com>

<some stuff if snipped, and then he said>
> IF it could) be accomplished

I played around with rendering three times with different IORs and then
compositing the resulting images and have come to the conclusion that
most of the time this does not work, although occasionally a good effect
can be achieved. In most of my attempts, a slight change in the IOR (I
played with +- 0.05 and 0.02, from a base IOR of 2.7) made a large
difference in how large surfaces reflected internally (i.e. the larger
facets on a diamond), that is after compositing (I replaced the R, G and
B channels with the corresponding channels from the images with the
appropriate IOR) whole facets would be brightly tinted with either R,G
or B. On large facets the effect was unacceptable because there was no
blending between colours and the effect did not look realistic.
HOWEVER, I accidentally rendered my diamond with the equivalent of very
small facets, I used smoothed triangles for the facets instead of
unsmoothed accidentally, this resulted in very fine lines of rainbow
colours that looked very realistic.

So there is my contribution to this disscussion.
-- 
Chris Maryan
mailto:cma### [at] geocitiescom
***
My ideas are free,
Work is at least minimum wage.
***
Email me if you are interested in donating
to the Chris Maryan needs money fund.


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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