POV-Ray : Newsgroups : povray.binaries.images : Problem with multi-layered texture Server Time
1 Aug 2024 00:19:15 EDT (-0400)
  Problem with multi-layered texture (Message 1 to 5 of 5)  
From: Jörg 'Yadgar' Bleimann
Subject: Problem with multi-layered texture
Date: 1 Apr 2009 13:30:45
Message: <49d3a4c5@news.povray.org>
High!

Meanwhile, I finally found out how to display object patterns produced 
from bitmaps vectorized with Inkscape correctly... but then, I found 
that either the lowest layer (a simple three-column flag gradient 
pattern) is darkened completely or significantly brightened (see 
attached image).

Here is the current version of my AfghanFlag() macro:

// beginning of code

#macro Flags_AfghanFlag()
    Flags_ThreeColumnFlag(0, <0.74509805, 0, 0>, <0, 0.6, 0>) // Layered 
texture, coat of arms object-patterned texture yet to be added!
    texture
    {
      pigment
      {
         object
         {
           path2428
           translate -y*0.5
           rotate -x*90
           scale <1/410*(Flags_Height/Flags_Width), 1/410, 0>
           translate <0.3335, 0.32, 0>
           color rgbft <1, 1, 1, 1, 1>
           color rgbft <0.98431373, 0.96862745, 0.96078432, 0, 
0>*ambientFactor
         }
       }
       finish { ambient Flags_Brightness/ambientFactor }
       normal { Flags_Normal }
     }
     texture
     {
       pigment
       {
         object
         {
           path2426
           translate -y*0.5
           rotate -x*90
           scale <1/410*(Flags_Height/Flags_Width), 1/410, 0>
           translate <0.3335, 0.32, 0>
           color rgbft <1, 1, 1, 1, 1>
           color rgbft <0.90588236, 0.79607844, 0.66274512, 0, 
0>*ambientFactor
         }
       }
       finish { ambient Flags_Brightness/ambientFactor }
       normal { Flags_Normal }
     }
     texture
     {
       pigment
       {
         object
         {
           path2424
           translate -y*0.5
           rotate -x*90
           scale <1/410*(Flags_Height/Flags_Width), 1/410, 0>
           translate <0.3335, 0.32, 0>
           color rgbft <1, 1, 1, 1, 1>
           color rgbft <0.88627452, 0.67058825, 0.58431375, 0, 
0>*ambientFactor
         }
       }
       finish { ambient Flags_Brightness/ambientFactor }
       normal { Flags_Normal }
     }
     texture
     {
       pigment
       {
         object
         {
           path2422
           translate -y*0.5
           rotate -x*90
           scale <1/410*(Flags_Height/Flags_Width), 1/410, 0>
           translate <0.3335, 0.32, 0>
           color rgbft <1, 1, 1, 1, 1>
           color rgbft <0.82745099, 0.59215689, 0.34509805, 0, 
0>*ambientFactor
         }
       }
       finish { ambient Flags_Brightness/ambientFactor }
       normal { Flags_Normal }
     }
     texture
     {
       pigment
       {
         object
         {
           path2420
           translate -y*0.5
           rotate -x*90
           scale <1/410*(Flags_Height/Flags_Width), 1/410, 0>
           translate <0.3335, 0.32, 0>
           color rgbft <1, 1, 1, 1, 1>
           color rgbft <0.83529413, 0.38039216, 0.36862746, 0, 
0>*ambientFactor
         }
       }
       finish { ambient Flags_Brightness/ambientFactor }
       normal { Flags_Normal }
     }
     texture
     {
       pigment
       {
         object
         {
           path2418
           translate -y*0.5
           rotate -x*90
           scale <1/410*(Flags_Height/Flags_Width), 1/410, 0>
           translate <0.3335, 0.32, 0>
           color rgbft <1, 1, 1, 1, 1>
           color rgbft <0.77647060, 0.39607844, 0.14117648, 0, 
0>*ambientFactor
         }
       }
       finish { ambient Flags_Brightness/ambientFactor }
       normal { Flags_Normal }
     }
     texture
     {
       pigment
       {
         object
         {
           path2416
           translate -y*0.5
           rotate -x*90
           scale <1/410*(Flags_Height/Flags_Width), 1/410, 0>
           translate <0.3335, 0.32, 0>
           color rgbft <1, 1, 1, 1, 1>
           color rgbft <0.76862746, 0.14117648, 0.09803922, 0, 
0>*ambientFactor
         }
       }
       finish { ambient Flags_Brightness/ambientFactor }
       normal { Flags_Normal }
     }
     texture
     {
       pigment
       {
         object
         {
           path2414
           translate -y*0.5
           rotate -x*90
           scale <1/410*(Flags_Height/Flags_Width), 1/410, 0>
           translate <0.3335, 0.32, 0>
           color rgbft <1, 1, 1, 1, 1>
           color rgbft <0.74509805, 0.00000000, 0.00000000, 0, 
0>*ambientFactor
         }
       }
       finish { ambient Flags_Brightness/ambientFactor }
       normal { Flags_Normal }
     }

#end

// end of code

Inkscape generated 8 vectorized layers from the original coat-of-arms 
bitmap; originally, I just used finish { Flags_Finish } as defined 
further up in flags.inc. As in flags.pov, the flag object is called with 
the newly introduced "lights" parameter set to 0, the ambient value in 
Flags_Finish is 1.

The original color values for the three-column pattern are (in 8-bit 
notation):
<0, 0, 0>
<191, 0, 0>
<153, 0, 0>

But when I add the first layer with object pattern, the colors beneath 
darken significantly:
<0, 0, 0>
<125, 0, 0>
<51, 0, 0>
- although the color for all parts outside the bezier spline is set to 
rgbft 1 and also the finish of the object pattern texture layer is 
ambient 1! From the second layer on, the red and green beneath is even 
reduced to a total black! How is this possible?

On the other hand, when I instead divide the ambient value by a value 
higher than 1.7 (and, in turn, multiply color triple of the inner parts 
of the object pattern with the same value), the colors of the flag are 
brightened to:
<0, 0, 0>,
<255, 0, 0>,
<0, 255, 0>

Why?

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'afghanflag.png' (66 KB)

Preview of image 'afghanflag.png'
afghanflag.png


 

From: gonzo
Subject: Re: Problem with multi-layered texture
Date: 1 Apr 2009 16:00:00
Message: <web.49d3c6a44290308ea0c272b50@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> High!

Good for you! Enjoy!


> - although the color for all parts outside the bezier spline is set to
> rgbft 1


Not sure, but for what you are doing I think you just need the transmit and not
the filter.  If I understand filter (and that's by no means certain) it
averages all the layers, so rgbft 1 averaged with anything less than 1 will
always be darker.

Try just your rgb values with transmit and no filter.

RG


Post a reply to this message

From: Jörg 'Yadgar' Bleimann
Subject: Re: Problem with multi-layered texture
Date: 1 Apr 2009 18:57:44
Message: <49d3f168@news.povray.org>
High!

> Good for you! Enjoy!

...high on POV-Ray, of course! Quite a digital psychedelicum...

> Not sure, but for what you are doing I think you just need the transmit and not
> the filter.  If I understand filter (and that's by no means certain) it
> averages all the layers, so rgbft 1 averaged with anything less than 1 will
> always be darker.
> 
> Try just your rgb values with transmit and no filter.

Yep, that's the ticket! Thank you very much!

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'afghanflag.jpg' (37 KB)

Preview of image 'afghanflag.jpg'
afghanflag.jpg


 

From: clipka
Subject: Re: Problem with multi-layered texture
Date: 2 Apr 2009 04:40:00
Message: <web.49d479624290308ef708085d0@news.povray.org>
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmxde> wrote:
> Meanwhile, I finally found out how to display object patterns produced
> from bitmaps vectorized with Inkscape correctly... but then, I found
> that either the lowest layer (a simple three-column flag gradient
> pattern) is darkened completely or significantly brightened (see
> attached image).
> The original color values for the three-column pattern are (in 8-bit
> notation):
> <0, 0, 0>
> <191, 0, 0>
> <153, 0, 0>
>
> But when I add the first layer with object pattern, the colors beneath
> darken significantly:
> <0, 0, 0>
> <125, 0, 0>
> <51, 0, 0>

An interesting thing to note is that the color values are not attenuated
linearly.

I suspect a gamma issue. You may want to check what happens if you choose
assumed_gamma 1.0 *and* File_Gamma 1.0 - I'd expect the output file colors to
match the input file then.


> - although the color for all parts outside the bezier spline is set to
> rgbft 1 and also the finish of the object pattern texture layer is
> ambient 1! From the second layer on, the red and green beneath is even
> reduced to a total black! How is this possible?

Did you check your max_trace_level and adc_bailout?


Post a reply to this message

From: clipka
Subject: Re: Problem with multi-layered texture
Date: 2 Apr 2009 04:55:00
Message: <web.49d47c484290308ef708085d0@news.povray.org>
"gonzo" <rgo### [at] lansetcom> wrote:
>> - although the color for all parts outside the bezier spline is set to
>> rgbft 1

I just noticed this.

It's quite uncommon to set both filter and transmit to 1; it *may* have
undesired effects, for instance I wouldn't be surprised if it would multiply
the light intensity of the *deeper* layers by 2 (which would physically be
nonsense).

I suggest using rgbt 1, although rgbf 1 should to the same job.

> Not sure, but for what you are doing I think you just need the transmit and not
> the filter.  If I understand filter (and that's by no means certain) it
> averages all the layers, so rgbft 1 averaged with anything less than 1 will
> always be darker.

No, that's not the case. Filter multiplies the intensity of lower layers with
the upper layer's filter value *and* color, but as the color is plain white
(all 1's), it does not make a difference here.

(It is actually transmit that has a plain (weighted) averaging effect, but at
"transmit 1" the lower layer gets 100% weight and the upper one 0%, so even
there the lower layer is not dimmed.)


Post a reply to this message

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