POV-Ray : Newsgroups : povray.general : how (if at all) can i change the wavelength of light in pov? Server Time
13 Aug 2024 19:24:30 EDT (-0400)
  how (if at all) can i change the wavelength of light in pov? (Message 11 to 13 of 13)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Dan Connelly
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 19 Aug 1998 07:16:05
Message: <35DAA5EB.BD9BA1FE@flash.net>
> It helps me for one. I have a (much more difficult to answer) question: how
> about Fourier analysis of a rgb coded color?

I think there is a problem with this statement, or in my
interpretation of it.

Fourier analysis is based on the principle that for linear
systems, functions continuous to all derivatives can be expressed
as a superposition of sinusoids.  However, for functions
of unconstrained periodicity, it takes a superposition over all
possible wavelengths to do so optimally.

The fourier representation of a color of frequency f1 is a
color of frequency f1 -- this means that one cannot express
all colors in terms of RGB components : if sinusoids are
chosen as a basis function, you still need all of them to
do the job correctly.

However, the human eye happens to be sensitive to R, G, and B 
due to its limited capacity to perceive color.  If, like some
species, we had 4 color receptors, RGB displays would appear
as distorted as an RG display does to us.

So Physics can't be represented as a superposition of red, green,
and blue -- it requires a much finer sampling across the optical
spectrum to yield credible results in many cases.  Otherwise
rainbows would be red, green, and blue bands instead of a continuous
spread.

Dan
-- 
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: 20 Aug 1998 00:45:03
Message: <35db9bbf.0@news.povray.org>
Dan Connelly wrote in message <35DAA5EB.BD9BA1FE@flash.net>...
>> It helps me for one. I have a (much more difficult to answer) question:
how
>> about Fourier analysis of a rgb coded color?
>
>I think there is a problem with this statement, or in my
>interpretation of it.
>


Must be my fault, I'm not a math person

>Fourier analysis is based on the principle that for linear
>systems, functions continuous to all derivatives can be expressed
>as a superposition of sinusoids.

Well, there's discrete FFT... maybe another means of finding out what
wavelengths *might* be responsible for a rgb colors

However, for functions
>of unconstrained periodicity, it takes a superposition over all
>possible wavelengths to do so optimally.
>


Well, some degree of accuracy can be a threshold, right?

>The fourier representation of a color of frequency f1 is a
>color of frequency f1 -- this means that one cannot express
>all colors in terms of RGB components : if sinusoids are
>chosen as a basis function, you still need all of them to
>do the job correctly.
>

You are right. I think the problem is that the physical representation of a
rgb color (almost certainly) is not unique. Foe example, rgb <0,1,0> is
550nm, but can also be a sum of several wavelengths, wide bands and thin
lines in the spectrum etc. This is due to the imperfections of the eye

>However, the human eye happens to be sensitive to R, G, and B
>due to its limited capacity to perceive color.  If, like some
>species, we had 4 color receptors, RGB displays would appear
>as distorted as an RG display does to us.

Agreed on that.

>So Physics can't be represented as a superposition of red, green,
>and blue -- it requires a much finer sampling across the optical
>spectrum to yield credible results in many cases.  Otherwise
>rainbows would be red, green, and blue bands instead of a continuous
>spread.

Yes, but still a nice approximation may be possible. POV approximated
inter-diffuse reflection in two ways, one cheap 'n' cheesy, the other slow
but more realistic, both being imperfect, but satisfying as a final result.
My question arose several years ago (back on POV 2.2) when I saw the books
behind my aquarium and how light was dispersed, nd how hard it was to model
in pov. Now, this problem solved, the problem with nice coloured refractive
custics remains. I've been willing to model a spectrograph for years now,
but that will have to wait. Maybe some day...

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

Thanks for your input.

--Peter

pet### [at] usanet


Post a reply to this message

From: Daren Scot Wilson
Subject: Re: how (if at all) can i change the wavelength of light in pov?
Date: 25 Aug 1998 20:42:48
Message: <35E3142F.2432C419@pipeline.com>
Color dispersion is old stuff to me - I altered POVRay's source code to
do dispersion and described my results on the web page.  If you're a
programmer, or want to see samples, 

http://www.newcolor/darenw/dswpov/dswpov.html

I will be rewriting my web pages soon, so if this is gone just go to
www.newcolor.com and click your way from there.  

Not only do I describe what I did to do dispersion, but I describe a bad
way of doing dispersion - like what others have been suggesting to try.

Dispersion was actually fairly easy to implement, except for three
things:

1) converting RGB to a 9-component color was easy, but I had to convert
back to RGB for display on the screen.  My way wasn't based on known
color science, but chosen for artistic reasons, as I had a project to
finish.  This took a lot of trial and error.

2) The RGB Colour data structure is used in a zillion places, and it
took several days to update all the source files.  But it's just grunt
work.

3) To prevent catastrophic slowdown of execution time I had to create
what I call the "k-only" mechanism.   Bottom line:  raytracing with
dispersion is maybe 1 to 10% slower than normal.  Heck, I use the
dispersion version just to trace ordinary scenes all the time.

I do not have an executable to pass out - I can't support all the
operating systems, etc.   But I could e-mail a source code tarball if
you like.    If you're not a programmer though, you'll have to ask some
of the other regulars in this newsgroup if they've incorporated my
changes in their versions. I don't know of any, but then, I live under a
rock <g>.

Someday, someday... I'll have a custom POV-Ray that I can offer, or at
least a decent patch file....

-- 

Daren Scot Wilson
Member, ACM
dar### [at] pipelinecom
www.newcolor.com
---
   "If you saw the poisons we put on them you wouldn't ask that
    question. You'd never eat another ..."
What is this farmer talking about?
Find out at http://www.ratical.com/LifeWeb/Erthdnce/chapter21.html


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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