POV-Ray : Newsgroups : povray.advanced-users : Strange colors for SpectralRender metals Server Time
31 Oct 2024 19:36:56 EDT (-0400)
  Strange colors for SpectralRender metals (Message 1 to 7 of 7)  
From: Cousin Ricky
Subject: Strange colors for SpectralRender metals
Date: 2 Jan 2014 14:25:01
Message: <web.52c5ba798f4d4bea306548240@news.povray.org>
Using Ive's SpectralRender, I get strange colors for chrome and gold.
M_Chrome() renders a dark navy blue, and M_Gold() renders a pure yellow that
seems much too garish.  I'm sure the little bit of gold I've seen in person is
only 14 kt, but the images of pure gold I've seen are less saturated and have an
orange cast.

Using C_Metal in preview mode yields rgb <0.5496, 0.5559, 0.5549> for chrome and
rgb <1.0224, 0.7810, 0.3449> for gold, which are much more the colors I expect.
However, M_Chrome() and M_Gold() in preview mode yield smoky black and silvery
white, respectively.

The following scene description file illustrates the anomalies:
_______________________________________________________________

#version 3.7;
#include "spectral.inc"

#ifndef (Rad) #declare Rad = yes; #end
global_settings
{ assumed_gamma 1
  max_trace_level 15
  #if (Rad)
    radiosity
    { count 100
      error_bound 0.5
      pretrace_end 2 / image_width
      pretrace_start 32 / image_width
      recursion_limit 2
    }
  #end
}
camera
{ location <0.0, 1.25, -7.0891>
  look_at <0.0, 1.25, 0.0>
  angle 38.8508
}
light_source
{ <-3.6875, 8.6250, -6.3869>,
  SpectralEmission (E_D65) * 5013.1
  fade_power 2 fade_distance 0.10417
  spotlight point_at <0.0, 1.25, 0.0> radius 45 falloff 90
}
#default { finish { diffuse 1 ambient SpectralEmission (E_D65) * 0.24520 } }
box
{ -1, 1 scale <9, 10, 9>
  pigment { rgb 0.6 }
}
plane
{ y, 0
  pigment { checker rgb 0.03 rgb 0.6 }
}

sphere
{ <-1.2, 1, 0>, 1
  M_Chrome (1)
}
sphere
{ <1.2, 1, 0>, 1
  M_Gold (1)
}
_______________________________________________________________


Post a reply to this message

From: clipka
Subject: Re: Strange colors for SpectralRender metals
Date: 3 Jan 2014 07:05:27
Message: <52c6a787@news.povray.org>
Am 02.01.2014 20:14, schrieb Cousin Ricky:
> Using Ive's SpectralRender, I get strange colors for chrome and gold.
> M_Chrome() renders a dark navy blue, and M_Gold() renders a pure yellow that
> seems much too garish.  I'm sure the little bit of gold I've seen in person is
> only 14 kt, but the images of pure gold I've seen are less saturated and have an
> orange cast.

I wouldn't expect "classic" materials (i.e. defined in terms of an RGB 
colour) to work "out of the box" with SpectralRender. There are 
infinitely many spectra that match any given RGB triplet, and 
SpectralRender needs to resort to wild guessing in order to pick one of 
them.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Strange colors for SpectralRender metals
Date: 3 Jan 2014 11:00:01
Message: <web.52c6dd1d2edc18a6306548240@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> I wouldn't expect "classic" materials (i.e. defined in terms of an RGB
> colour) to work "out of the box" with SpectralRender. There are
> infinitely many spectra that match any given RGB triplet, and
> SpectralRender needs to resort to wild guessing in order to pick one of
> them.

That's not what I'm doing.  I'm using the spectral definitions of the metals
that are bundled with SpectralRender.  (The only RGB colors in the example are
for the plain gray floor and walls, which I didn't see the need to jump through
hoops just to get a flat spectral curve, and which turned out as expected
anyway.)


Post a reply to this message

From: clipka
Subject: Re: Strange colors for SpectralRender metals
Date: 4 Jan 2014 11:48:50
Message: <52c83b72$1@news.povray.org>
Am 03.01.2014 16:54, schrieb Cousin Ricky:
> clipka <ano### [at] anonymousorg> wrote:
>> I wouldn't expect "classic" materials (i.e. defined in terms of an RGB
>> colour) to work "out of the box" with SpectralRender. There are
>> infinitely many spectra that match any given RGB triplet, and
>> SpectralRender needs to resort to wild guessing in order to pick one of
>> them.
>
> That's not what I'm doing.  I'm using the spectral definitions of the metals
> that are bundled with SpectralRender.  (The only RGB colors in the example are
> for the plain gray floor and walls, which I didn't see the need to jump through
> hoops just to get a flat spectral curve, and which turned out as expected
> anyway.)

I see...

Looking at the M_Spectral_Metal macro, I find that it looks bogus to me. 
For starters, instead of "#if (WavelengthIndex < 0)" the tests should be 
"#if (!SpectralMode)"; the "fresnel on" should only be used in spectral 
mode (if at all); and in non-spectral mode there should only be one 
parameter to reflection, as the "metallic" keyword already takes care of 
all variable effects applicable to metals.

I get good results with the following:


#macro M_Spectral_Metal (N, K, Reflectance)
   material {
     texture {
       pigment { C_Metal(N, K) }
       finish {
         ambient 0  emission 0  diffuse (0.5 - Reflectance*0.45)
         reflection { Reflectance metallic }
         conserve_energy
         brilliance EXT_Metal(N, K)
         metallic
       }
     }
   }
#end


I concede that this is probably not 100% exact regarding the variable 
reflection effects, but it's certainly better than what the current 
macro gives us ;-)


Post a reply to this message

From: clipka
Subject: Re: Strange colors for SpectralRender metals
Date: 4 Jan 2014 17:45:13
Message: <52c88ef9@news.povray.org>
Am 04.01.2014 17:48, schrieb clipka:
> Am 03.01.2014 16:54, schrieb Cousin Ricky:
>> clipka <ano### [at] anonymousorg> wrote:
>>> I wouldn't expect "classic" materials (i.e. defined in terms of an RGB
>>> colour) to work "out of the box" with SpectralRender. There are
>>> infinitely many spectra that match any given RGB triplet, and
>>> SpectralRender needs to resort to wild guessing in order to pick one of
>>> them.
>>
>> That's not what I'm doing.  I'm using the spectral definitions of the
>> metals
>> that are bundled with SpectralRender.  (The only RGB colors in the
>> example are
>> for the plain gray floor and walls, which I didn't see the need to
>> jump through
>> hoops just to get a flat spectral curve, and which turned out as expected
>> anyway.)
>
> I see...
>
> Looking at the M_Spectral_Metal macro, I find that it looks bogus to me.
> For starters, instead of "#if (WavelengthIndex < 0)" the tests should be
> "#if (!SpectralMode)"; the "fresnel on" should only be used in spectral
> mode (if at all); and in non-spectral mode there should only be one
> parameter to reflection, as the "metallic" keyword already takes care of
> all variable effects applicable to metals.
>
> I get good results with the following:
>
>
> #macro M_Spectral_Metal (N, K, Reflectance)
>    material {
>      texture {
>        pigment { C_Metal(N, K) }
>        finish {
>          ambient 0  emission 0  diffuse (0.5 - Reflectance*0.45)
>          reflection { Reflectance metallic }
>          conserve_energy
>          brilliance EXT_Metal(N, K)
>          metallic
>        }
>      }
>    }
> #end

Maybe this is what it was supposed to be:

#macro M_Spectral_Metal (N, K, Reflectance)
   material {
     texture {
       pigment { C_Metal(N, K) }
       finish {
         ambient 0  emission 0  diffuse (0.5 - Reflectance*0.45)
         reflection {
           #if (SpectralMode)
             Reflectance * C_Metal_(N,K), Reflectance fresnel on
           #else
             Reflectance metallic
           #end
         }
         conserve_energy
         brilliance EXT_Metal(N, K)
         metallic
       }
     }
     interior { IOR_Metal(N, K) }
   }
#end

(where C_Metal_(N,K) is identical to C_Metal(N,K) except that it omits 
the "rgb" keyword)


Post a reply to this message

From: Cousin Ricky
Subject: Re: Strange colors for SpectralRender metals
Date: 5 Jan 2014 10:25:01
Message: <web.52c979082edc18a6306548240@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> (where C_Metal_(N,K) is identical to C_Metal(N,K) except that it omits
> the "rgb" keyword)

Rather than write a new macro, I replaced:

  Reflectance * C_Metal_(N,K), Reflectance fresnel on

with:

  #local C_Metal_ = C_Metal (N, K);
  Reflectance * C_Metal_.x, Reflectance fresnel on

(With or without the .x makes no difference.)  Your first attempt looks more
believable.  I have posted some results in p.b.i.


Post a reply to this message

From: Ive
Subject: Re: Strange colors for SpectralRender metals
Date: 7 Jan 2014 11:43:08
Message: <52cc2e9c$1@news.povray.org>
Am 02.01.2014 20:14, schrieb Cousin Ricky:

> Using Ive's SpectralRender, I get strange colors for chrome and gold.
> M_Chrome() renders a dark navy blue, and M_Gold() renders a pure yellow that
> seems much too garish.  I'm sure the little bit of gold I've seen in person is
> only 14 kt, but the images of pure gold I've seen are less saturated and have an
> orange cast.
>

Well, it happened *AGAIN* that I did mess things up.
As Christoph spotted the statement #if (WavelengthIndex) doesn't make 
any sense (a relict from version 0.1) but the whole file is the wrong one.
I have a quite automated way of generating the zip file and updating the 
web-page and somehow managed it to copy the wrong file while I use local 
the correct one, so would never have spotted my mistake.

Anyway, I'll find some time tomorrow and correct this mess. And BTW 
thanks for trying the whole spectral thing.

-Ive


Post a reply to this message

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