POV-Ray : Newsgroups : povray.general : multiple pigment use--a basic inconsistency? : multiple pigment use--a basic inconsistency? Server Time
29 Jul 2024 04:18:21 EDT (-0400)
  multiple pigment use--a basic inconsistency?  
From: Kenneth
Date: 26 Jan 2013 16:15:00
Message: <web.5104465b4da84da9c2d977c20@news.povray.org>
This is something that has been bugging me for a long time, and I've finally
gotten up the nerve to post about it ;-)

It concerns the use of multiple 'bare' pigment statements in an object. Not
something I ever do, simply because it doesn't work. But the documentation at
various places makes it unclear as to why.

For example, this doesn't work:

object{...some object...
 pigment{...}
 pigment{..another pigment with some transparency...}
      }

The 2nd pigment *completely* overrides the first; there's no 'layering.'

Essentially, the problem as I see it has to do with 'default' (implied) texture
wrappers around pigments, vs. explicit (user-added) texture wrappers. The two
cases seem to show different behaviors, and it's not clear why.

Here's the basis for my possible misunderstanding:
In 2.3.4.1 (part of 2.3.4 "Advanced Texture Options") it says: "Pigments can
also be layered one on top of the next so long as the uppermost layers are at
least partially transparent so the ones beneath can show through." Is this meant
to imply that the pigments need no explicit texture wrappers? Seen 'in
isolation', it could be read that way. Yet all the examples there make use of
explicit wrappers--no simple 'naked' pigments. And other parts of the docs (and
examples) generally use explicit textures too.

However, in 3.5.1 "Pigment" is says:
"A pigment statement is part of a texture specification. However it can be
tedious to use a texture statement just to add a color to an object. Therefore
you may attach a pigment directly to an object without explicitly specifying
that it as part of a texture...Doing so creates an entire texture structure with
default normal and finish statements just as if you had explicitly typed the
full texture {...} around it."

So it's clear that an implicit texture wrapper is added around a bare pigment
statement...one that *should* be equivalent to typing a full  texture{...}.

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?

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.)


Post a reply to this message

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