POV-Ray : Newsgroups : povray.binaries.images : Complementary colors with high filter and transmit? Server Time
29 Mar 2024 09:17:18 EDT (-0400)
  Complementary colors with high filter and transmit? (Message 1 to 2 of 2)  
From: Bald Eagle
Subject: Complementary colors with high filter and transmit?
Date: 7 Aug 2016 21:55:01
Message: <web.57a7e643418f435e7df57c0@news.povray.org>
I noticed this recently, and wanted to make some reference renders.
As you can see in the bottom right, there is a pronounced magenta.

It gives me a headache to look at, and I can't really puzzle out what the
mechanism of this is.

White plain and wall, white light.  Nothing special.



//#######################################################################
#version 3.7;

global_settings {assumed_gamma 1.0}

#include "colors.inc"
#include "textures.inc"
#include "shapes3.inc"

camera {  location <16, 35, -47> look_at  <16,  0, -15>}
//camera {  location <30, 10, -36> look_at  <30,  0, -32>}

light_source {<40, 50, -60> White}

//###########################################################################################

// floor
plane {<0, 1, 0>, 0  hollow // normal vector, distance to zero ----
 texture {
  pigment {color rgb <1, 1, 1> }
 } // end of texture
} // end of plane

// upright
plane {<0, 0, -1>, 0  hollow // normal vector, distance to zero ----
 texture {
  pigment {color rgb <1, 1, 1> }
 } // end of texture
 rotate <0, 0, 0>
} // end of plane

#declare Dia = 2;

#for (X, 0, 10)
 #for (Z, 0, 10)
  sphere{<X*Dia*1.5, Dia, -(Dia*2)-(Z*Dia*1.5)>, Dia/2 pigment {rgbft <0, 1, 0,
X/10, Z/10>}}
 #end // end for Z
#end // end for X

text {ttf "arial.ttf",  "f=0, t=0",  0.02, 0.0 // thickness, offset
 texture{ pigment {color rgb <0, 1, 0>*0.4 }
                finish {specular 0.6 phong 1}
              } // end of texture
 rotate x*90
 scale <1, 1, 1>
 translate <-4.5, 4, -5>
 no_shadow
} // end of text

text {ttf "arial.ttf",  "f=1, t=0",  0.02, 0.0 // thickness, offset
 texture{ pigment {color rgb <0, 1, 0>*0.4 }
                finish {specular 0.6 phong 1}
              } // end of texture
 rotate x*90
 scale <1, 1, 1>
 translate <31, 4, -5>
 no_shadow
} // end of text

text {ttf "arial.ttf",  "f=0, t=1",  0.02, 0.0 // thickness, offset
 texture{ pigment {color rgb <0, 1, 0>*0.4 }
                finish {specular 0.6 phong 1}
              } // end of texture
 rotate x*90
 scale <1, 1, 1>
 translate <-4.5, 4, -35>
 no_shadow
} // end of text

text {ttf "arial.ttf",  "f=1, t=1",  0.02, 0.0 // thickness, offset
 texture{ pigment {color rgb <0, 1, 0>*0.4 }
                finish {specular 0.6 phong 1}
              } // end of texture
 rotate x*90
 scale <1, 1, 1>
 translate <31, 4, -35>
 no_shadow
} // end of text

#declare R=0.02;
cylinder {< 0, 0,  -2>, <40, 50, -60>, R texture {pigment {White} finish
{specular 0.6}} no_shadow}
cylinder {< 0, 0, -32>, <40, 50, -60>, R texture {pigment {White} finish
{specular 0.6}} no_shadow}
cylinder {<30, 0,  -2>, <40, 50, -60>, R texture {pigment {White} finish
{specular 0.6}} no_shadow}
cylinder {<30, 0, -32>, <40, 50, -60>, R texture {pigment {White} finish
{specular 0.6}} no_shadow}


Post a reply to this message


Attachments:
Download 'filter_and_transmit.png' (314 KB)

Preview of image 'filter_and_transmit.png'
filter_and_transmit.png


 

From: clipka
Subject: Re: Complementary colors with high filter and transmit?
Date: 8 Aug 2016 02:39:43
Message: <57a8292f$1@news.povray.org>
Am 08.08.2016 um 03:54 schrieb Bald Eagle:
> I noticed this recently, and wanted to make some reference renders.
> As you can see in the bottom right, there is a pronounced magenta.
> 
> It gives me a headache to look at, and I can't really puzzle out what the
> mechanism of this is.

When POV-Ray encounters a surface with `transmit T`, it computes the
effective resulting colour (`Ce`) as a weighted average of the following
two components:

- The effective colour the background would have if the surface was
entirely transparent (`Cb`).
- The effective colour the surface would have if it was opaque (`Cs`).

The weighting factors for the two components are `T` and `1-T`,
respectively. Thus, the formula is:

    Ce = Cb*T + Cs*(1-T)

When POV-Ray encounters a surface with `filter F`, it computes the
effective resulting colour as a weighted average of the following two
components:

- The effective colour the background would have if the surface was
entirely transparent, multiplied by the surface's pigment colour (`Cb*Cp').
- The effective colour the surface would have if it was opaque (`Cs`).

The weighting factors for the two components are `F` and `1-F`,
respectively. Thus, the formula is:

    Ce = Cb*Cp*F + Cs*(1-F)


Now how should the two mechanisms interact if both are used? In that
case, POV-Ray uses:

    Ce = Cb*(Cp*F+T) + Cs*(1-F-T)

As a result, if F+T>1, `Cs` will be multiplied with a negative value,
resulting in a negative colour contribution from the surface. Add this
to a positive colour contribution from the background, and you'll get
the complementary colour, which in case of green happens to be magenta.


=> For realistic results, make sure `filter` plus `transmit` never
exceeds 1.


Post a reply to this message

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