POV-Ray : Newsgroups : povray.binaries.programming : Color Dispersion Patch Server Time
29 Mar 2024 10:20:42 EDT (-0400)
  Color Dispersion Patch (Message 1 to 5 of 5)  
From: Daren Scot Wilson
Subject: Color Dispersion Patch
Date: 29 Nov 1998 02:51:43
Message: <3660C507.EE074F44@pipeline.com>
The attached file is a tarred gzipped file containing a patch and a
readme.  The patch adds color dispersion to POV-Ray 3.10 (and I assume
3.10a, but I haven't tried it yet).

There are two new keywords:  dispersion and disp_nelems.  Use them like
this:

sphere { <...someplace...>, R
	pigment { color rgbf <1,1,1,1> }
	finish {
		ambient 0
		phong .3
		phong_size 120
	}
	interior {
		ior  1.3
		dispersion 1.05
		disp_nelems 15
	}
}


The dispersion value is the ratio of IOR values for violet to red.  Good
numbers are 1.01 to 1.1.    The IOR value given by the ior keyword is
taken to be for yellow-green, the color at the center of the spectrum.

The disp_nelems is optional, but the default value I gave it is only 7,
too small if the dispersion value is large, like > 1.1 or so.  

Because the dispersion modification was built on a version of source
code I had already added some features to, you get some other features: 
keywords #endif and #endwhile, to be paired with #if and #while
statements (only for the Human's convenience), and new degree-trig
functions  sind, cosd, tand, asind, acosd, atan2d  which take or return
degrees instead of radians.  Someday, I will separate the dispersion and
degrees-trig features as separate patches.  Someday....

Everything on my web site about dispersion that you've read before Nov.
29 1998 is obsolete. That was a clumsy brute-force algorithm that
affected many source code files. This patch is a new algorithm that
affects only one subroutine in one file, plus simple changes to add new
keywords to the parser.  It should be easy to combine with other
patches.

An example image will be posted to povray.binaries.images and
povray.binaries.scene-files.  All this stuff will appear on my web page
at http://www.newcolor.com/darenw/dswpov/disp.html.  (In a couple of
days)

Be careful, as this is the *first* release to the world of this patch. 
It works on my machine, but if it doesn't on yours, send me e-mail and
we'll fix it.  Stay tuned for corrections, updates, etc...

-- 

Daren Scot Wilson
Member, ACM
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


Attachments:
Download 'dswpov-disp.tgz.gz' (11 KB)

From: =Bob
Subject: Re: Color Dispersion Patch
Date: 29 Nov 1998 21:44:00
Message: <36620670.0@news.povray.org>
Wish I had looked here first.
A couple of the questions I asked at povray.binaries.images seem answered 
here. I was wondering if the bandwidth was adjustable, guess thats 
'dispersion'; and whether the contrast were changeable, but I guess not since 
both test images were of equal contrast and the only other keyword, 
'disp_nelems', is the smoothness of color not lightness/darkness.
Well, I'm not about to look a gift-horse in the mouth.
Great to see the spectral dispersion make it to 3.1 in source form.
Still would like to hear what render time is like with it as I'm sure many 
would.

Bob

Message <3660C507.EE074F44@pipeline.com>, Daren Scot Wilson  typed...
>
>This is a multi-part message in MIME format.
>--------------036A88D3F4349E816EB2C8BB
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>The attached file is a tarred gzipped file containing a patch and a
>readme.  The patch adds color dispersion to POV-Ray 3.10 (and I assume
>3.10a, but I haven't tried it yet).
>
>There are two new keywords:  dispersion and disp_nelems.  Use them like
>this:
>
>sphere { <...someplace...>, R
>        pigment { color rgbf <1,1,1,1> }
>        finish {
>                ambient 0
>                phong .3
>                phong_size 120
>        }
>        interior {
>                ior  1.3
>                dispersion 1.05
>                disp_nelems 15
>        }
>}
>
>
>The dispersion value is the ratio of IOR values for violet to red.  Good
>numbers are 1.01 to 1.1.    The IOR value given by the ior keyword is
>taken to be for yellow-green, the color at the center of the spectrum.
>
>The disp_nelems is optional, but the default value I gave it is only 7,
>too small if the dispersion value is large, like > 1.1 or so.  
>
>Because the dispersion modification was built on a version of source
>code I had already added some features to, you get some other features: 
>keywords #endif and #endwhile, to be paired with #if and #while
>statements (only for the Human's convenience), and new degree-trig
>functions  sind, cosd, tand, asind, acosd, atan2d  which take or return
>degrees instead of radians.  Someday, I will separate the dispersion and
>degrees-trig features as separate patches.  Someday....
>
>Everything on my web site about dispersion that you've read before Nov.
>29 1998 is obsolete. That was a clumsy brute-force algorithm that
>affected many source code files. This patch is a new algorithm that
>affects only one subroutine in one file, plus simple changes to add new
>keywords to the parser.  It should be easy to combine with other
>patches.
>
>An example image will be posted to povray.binaries.images and
>povray.binaries.scene-files.  All this stuff will appear on my web page
>at http://www.newcolor.com/darenw/dswpov/disp.html.  (In a couple of
>days)
>
>Be careful, as this is the *first* release to the world of this patch. 
>It works on my machine, but if it doesn't on yours, send me e-mail and
>we'll fix it.  Stay tuned for corrections, updates, etc...
>
>-- 
>
>Daren Scot Wilson
>Member, ACM
>dar### [at] pipelinecom
>www.newcolor.com
>--

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

From: Daren Scot Wilson
Subject: Re: Color Dispersion Patch
Date: 30 Nov 1998 11:38:21
Message: <36629200.11BE1A00@pipeline.com>
Bob wrote:
>  I was wondering if the bandwidth was adjustable, guess thats 
> 'dispersion'; and whether the contrast were changeable, but I guess not since 
> both test images were of equal contrast 

I'm not sure what you mean by "contrast" - dispersion only splits the
light that passes through a medium.  If you want stuff to look darker,
use a smaller filter or transmit value in the pigment statement.



> Still would like to hear what render time is like with it as I'm sure many 
> would.

Scenes render slower :(   Instead of tracing one ray for each pixel,
there are (disp_nelems) rays to trace.  Set disp_nelems to something big
like 100, and if the entire scene is filled with dispersive transparent
objects, the scene will take 100 times longer to render than if
dispersion were not used.  

Of course, most scenes are filled with mostly ordinary objects with
glass objects being only part of the scene.  Also, for realistic scenes,
glass and water would have small dispersion values (close to one, like
1.01)  which means you don't need a zillion colors, and may use small
disp_nelem values < 10.   

Unfortunately there's no getting around the fact that color dispersion
requires tracing these extra rays - each color of the spectrum goes in a
different direction. Go buy a Pentium II 400 MHz machine.   (Hey, if
this dispersion feature catches on big, I should buy stock in hardware
manufacturers....)

-- 

Daren Scot Wilson
Member, ACM
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: =Bob
Subject: Re: Color Dispersion Patch
Date: 2 Dec 1998 00:20:49
Message: <3664ce31.0@news.povray.org>
Well, no, not filter or transmit of the object color. I meant the intensity, 
or saturation, of the resulting colors. The more I think of it I understand 
your confusion with my question. Adding either white or black to the overall 
color intensities to get lighter or darker dispersion is what I'm talking 
about. Not reducing or increasing color contrast.
That obviously isn't simply "refracted" light, as it were; more so a color 
addition/subtraction effect. And it still doesn't quite sound right, since a 
filter value would indeed need to go along as well.
Think in terms of the 'irid' keyword and it's thin or thick "film" which tends 
to be either subdued or very colorful depending upon the amount given, if I 
have that figured right.
Well, besides this, I say again it's great to see in this possible in 3.1.

Message <36629200.11BE1A00@pipeline.com>, Daren Scot Wilson  typed...
>
>I'm not sure what you mean by "contrast" - dispersion only splits the
>light that passes through a medium.  If you want stuff to look darker,
>use a smaller filter or transmit value in the pigment statement.
>-- 
>
>Daren Scot Wilson
>Member, ACM
>dar### [at] pipelinecom
>www.newcolor.com
>--
>"A ship in a harbor is safe, but that is not what ships are built for"
>                     -- William Shedd

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

From: Daren Scot Wilson
Subject: Re: Color Dispersion Patch
Date: 10 Jan 1999 14:00:04
Message: <3698B27C.272ED68A@pipeline.com>
Update on dispersion patch...

The patch I provided not only adds dispersion, but also trig-degree
functions (sind, cosd, etc. that take/return degrees instead of
radians), and whatever else I had announced.

I failed to notice, though, that it also changes the mosaic preview step
size from a factor of two to a factor of three. This is a personal
preference of mine.  

Two people are working on binaries for Windows and Mac, and unlike
Linux, which is all I use, these platforms need to reset certain
variables before each render.  Solution: "...we had to set the variable
disp_elem and disp_nelems to zero in the function init_vars() in
povray.c"

But there were also some weird bugs that we haven't tracked down.  

Bottom line: dispersion patch *may* have a bug, so use with caution.

-- 
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

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