POV-Ray : Newsgroups : povray.binaries.images : Problem with multi-layered texture : Problem with multi-layered texture Server Time
31 Jul 2024 22:19:58 EDT (-0400)
  Problem with multi-layered texture  
From: Jörg 'Yadgar' Bleimann
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


 

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