POV-Ray : Newsgroups : povray.advanced-users : custom dispersion curve Server Time
3 Jul 2024 05:34:06 EDT (-0400)
  custom dispersion curve (Message 1 to 10 of 10)  
From: AaronD
Subject: custom dispersion curve
Date: 18 Feb 2008 06:55:00
Message: <web.47b97198297bdf4b256ade900@news.povray.org>
I would like to render a material that has nonlinear dispersion.  For example,
the dispersion property allows us to set only a single parameter giving us the
strength of dispersion.  I don't know for sure about the implementation here,
but I am assuming that this means that the index of refraction has a linear
dependence on wavelength (color).

I want to specify the index of refraction for each color, in the number of steps
that I specify (just as with dispersion) only in a customized way, for example:

n=2 for red part of spectrum
n=1 for middle part of spectrum
n=3 for violet part of spectrum

Since I cannot do this with the dispersion property, how can I do this?  This
looks like it should be very easy to implement, given that POV-Ray can already
handle normal dispersion.  I just need to access the array where the indices
are held, if that is how dispersion works.

Any suggestion or help is very much appreciated.


Post a reply to this message

From: Bob Hughes
Subject: Re: custom dispersion curve
Date: 18 Feb 2008 13:36:34
Message: <47b9d032@news.povray.org>
"AaronD" <aar### [at] yahoocom> wrote in message 
news:web.47b97198297bdf4b256ade900@news.povray.org...
>
> I want to specify the index of refraction for each color, in the number of 
> steps
> that I specify (just as with dispersion) only in a customized way, for 
> example:
>
> n=2 for red part of spectrum
> n=1 for middle part of spectrum
> n=3 for violet part of spectrum
>
> Since I cannot do this with the dispersion property, how can I do this? 
> This
> looks like it should be very easy to implement, given that POV-Ray can 
> already
> handle normal dispersion.  I just need to access the array where the 
> indices
> are held, if that is how dispersion works.


Not sure about the program source code regarding that but you could do this, 
before interior {} was introduced, by using averaged textures. That's 
because finish {} had the ior within it in versions prior to 3.5. Checking 
on that, I don't think it's backwards compatible even using the #version 
change meaning you would need to use POV 3 if doing it in the SDL, if 
possible at all.

I have a file made from what Daren Scott Wilson first created, and his idea 
became the 'dispersion' used now in POV.

http://webpages.charter.net/omniverse/private/spectrar.zip

Maybe you can do something with it, if not the program source code. This 
does NOT work in versions 3.5 or above.

-- 
/*bob hughes*/


Post a reply to this message

From: Bob Hughes
Subject: Re: custom dispersion curve
Date: 18 Feb 2008 19:47:59
Message: <47ba273f$1@news.povray.org>
The 3.7 beta source code is available now so I gave it a look and found it's 
done (at least in part) in source\ backend\ lighting\ photons.cpp so thought 
I'd mention that. And I'm guessing that might be an easier read than 
previous source code, not that I know that for sure either but that's what I 
hear.

Didn't look trivial to use more than a single ior, but I don't know the 
coding at all. That's what the povray.programming group would be for, or 
someone else might have more to say here.
-- 
/*bob hughes*/


Post a reply to this message

From: bart
Subject: Re: custom dispersion curve
Date: 19 Feb 2008 03:40:13
Message: <47ba95ed@news.povray.org>
AaronD wrote:
> I want to specify the index of refraction for each color, in the number of steps
> that I specify (just as with dispersion) only in a customized way, for example:
> 
> n=2 for red part of spectrum
> n=1 for middle part of spectrum
> n=3 for violet part of spectrum
> 
> Since I cannot do this with the dispersion property, how can I do this?

As a very simple solution you can try
to split your scene into separate color channels,
render them independently, and then
just combine them all in a final image.


Post a reply to this message

From: AaronD
Subject: Re: custom dispersion curve
Date: 19 Feb 2008 04:05:02
Message: <web.47ba9b334c6a5a87256ade900@news.povray.org>
bart <bar### [at] barthome> wrote:

> As a very simple solution you can try
> to split your scene into separate color channels,
> render them independently, and then
> just combine them all in a final image.

I thought about that too, but I want to render a lot of materials this way and
thought it may be a good addition to POV-Ray anyway, since a lot of transparent
materials have nonlinear dispersion.  I found Element_IOR in lighting.cpp that
returns a modified ior dependent on disp and nelems so perhaps just that one
function could be modified to read from an array instead of disp and nelems,
but I don't know if that is the only place I would have to modify.


Post a reply to this message

From: Jan Dvorak
Subject: Re: custom dispersion curve
Date: 19 Feb 2008 04:07:02
Message: <47ba9c36@news.povray.org>
AaronD napsal(a):
> bart <bar### [at] barthome> wrote:
> 
>> As a very simple solution you can try
>> to split your scene into separate color channels,
>> render them independently, and then
>> just combine them all in a final image.
> 
> I thought about that too, but I want to render a lot of materials this way and
> thought it may be a good addition to POV-Ray anyway, since a lot of transparent
> materials have nonlinear dispersion.  I found Element_IOR in lighting.cpp that
> returns a modified ior dependent on disp and nelems so perhaps just that one
> function could be modified to read from an array instead of disp and nelems,
> but I don't know if that is the only place I would have to modify.
> 
> 
You can find out via T&E


Post a reply to this message

From: AaronD
Subject: Re: custom dispersion curve
Date: 19 Feb 2008 04:20:01
Message: <web.47ba9e2b4c6a5a87256ade900@news.povray.org>
bart <bar### [at] barthome> wrote:

> As a very simple solution you can try
> to split your scene into separate color channels,
> render them independently, and then
> just combine them all in a final image.

bart, by the way, if I do that, can you recommend any software that is already
set up to easily combine all the channels, since I would have a huge collection
of images?  I may also want to weight the brightness by the human spectral eye
response curve.


Post a reply to this message

From: bart
Subject: Re: custom dispersion curve
Date: 19 Feb 2008 06:28:47
Message: <47babd6f@news.povray.org>
> bart, by the way, if I do that, can you recommend any software that is already
> set up to easily combine all the channels, since I would have a huge collection
> of images?  I may also want to weight the brightness by the human spectral eye
> response curve.
> 

Check XnView/NConvert (www.xnview.com).It's free, available for many 
platforms
and can read raw RGB images. It also has a GFL SDK library for developers.


Post a reply to this message

From: AaronD
Subject: Re: custom dispersion curve
Date: 19 Feb 2008 07:00:00
Message: <web.47bac4ae4c6a5a87256ade900@news.povray.org>
bart <bar### [at] barthome> wrote:
> Check XnView/NConvert (www.xnview.com).It's free, available for many
> platforms
> and can read raw RGB images. It also has a GFL SDK library for developers.

Thanks for the suggestion, but I don't think it will work.  I won't have just 3
channels to combine (RGB).  Instead, I'll have 20 or 30 channels, spaced over
the visible spectrum.  All 30 channels would have to be combined with
appropriate weightings for the illumination source and eye responsivity to
create a single RGB image.  I can write a mathematica code to do it though I
think.


Post a reply to this message

From: Christian Froeschlin
Subject: Re: custom dispersion curve
Date: 19 Feb 2008 10:54:00
Message: <47bafb98$1@news.povray.org>
> Thanks for the suggestion, but I don't think it will work.  I won't have just 3
> channels to combine (RGB).  Instead, I'll have 20 or 30 channels, spaced over
> the visible spectrum.  All 30 channels would have to be combined with
> appropriate weightings for the illumination source and eye responsivity to
> create a single RGB image.

I'm not entirely sure how your input data looks like,
but possibly you can do what you want in SDL by stacking
partially transparent or filtered image_maps on a box
and rendering this with an orthographic camera.


Post a reply to this message

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