POV-Ray : Newsgroups : povray.general : multiple pigment use--a basic inconsistency? : Re: multiple pigment use--a basic inconsistency? Server Time
29 Jul 2024 04:18:21 EDT (-0400)
  Re: multiple pigment use--a basic inconsistency?  
From: clipka
Date: 27 Jan 2013 03:15:19
Message: <5104e217@news.povray.org>
Am 26.01.2013 22:10, schrieb Kenneth:

> But here's the basic question: If a bare pigment has a 'default' (implicit)
> texture wrapper, then why does using a 2nd bare pigment (also in a 'default'
> texture wrapper) completely override it? That doesn't happen when *explicit*
> texture wrappers are used. There's no (clear?) distinction made in the docs
> between the two situations. *Is* there a clearly-understood difference (one that
> needs an explanation in the docs)? Or does this indicate a bug?

Here's the catch:

- Bare pigment statements are not implicitly wrapped in texture 
/statements/ (which define textures) but in /textures/.

- To define layered textures, you don't specify multiple /textures/ for 
the object, but multiple /consecutive/ texture /statements/. (You can't 
even put a "#declare" in between.)

When this syntax was originally designed, it /should/ have been 
something like:

     texture {
         layered
         texture { ... }
         texture { ... }
         ...
     }

But whoever added this feature to POV-Ray chose to do it differently.


> Something else I discovered: Using multiple bare pigment statements causes some
> really weird behavior in the final result. Example:
>
> box{0, 1 scale <1,1,.0001>
>   pigment{bozo scale .2}
>   pigment{
>    gradient y
>    color_map{
>     [0 rgb <1,0,0>]
>     [1 rgbt 1]
>     }
>    }
>   }
>
> Aside from the 2nd pigment completely replacing the 1st, the SCALE in the 1st
> pigment inexplicably affects the 2nd one! This is certainly not right. (Of
> course, I'm doing something apparently 'incorrect' here anyway, by applying
> multiple naked pigments.)

Sounds weird and unintentional. I'll have a closer look at this. I'll 
also check whether this affects stuff like:

   #declare BOX = box { 0, 1 scale <1,1,.0001>
     pigment { bozo scale .2 }
   }
   object { box
     pigment{
       gradient y
       color_map{
         [0 rgb <1,0,0>]
         [1 rgbt 1]
       }
     }
   }

becase this should effectively be the same as your construct.


Post a reply to this message

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