POV-Ray : Newsgroups : povray.binaries.images : No color from image_map pigment Server Time
29 Jul 2024 18:28:08 EDT (-0400)
  No color from image_map pigment (Message 1 to 5 of 5)  
From: jceddy
Subject: No color from image_map pigment
Date: 24 Sep 2013 10:05:02
Message: <web.52419aebcf1f2a1b314aa6840@news.povray.org>
Hopefully this will be quick for someone...I'm banging my head against it and I
know it should be simple, but not quite getting it.

I'm texturing a box using a pigment gradient with two image maps as input. When
I render I don't get any color from the original images...what am I missing?

The attachment has the output on top and the original image maps on the bottom.

Here's the relevant code:

#declare White_Texture =
pigment {
  image_map {
    jpeg "white_hq.jpg"
    map_type 0
    interpolate 2
  }
}

#declare Red_Texture =
pigment {
  image_map {
    jpeg "red_hq.jpg"
    map_type 0
    interpolate 2
  }
}

box {
  <-12, -7, -0.1>, <12, 7, 0.1>

  texture {
    pigment {
      pigment_pattern {
        gradient x
        pigment_map {
          [0.00 Red_Texture]
          [0.25 Red_Texture]
          [0.75 White_Texture]
          [1.00 White_Texture]
        }
      }

      translate <0.5, 0.5, 0>
      rotate 180*y
      scale <24, 14, 1>
    }
    finish {
      ambient 1
      diffuse 0
    }
  }
}


Post a reply to this message


Attachments:
Download 'nocolor.jpg' (225 KB)

Preview of image 'nocolor.jpg'
nocolor.jpg


 

From: scott
Subject: Re: No color from image_map pigment
Date: 24 Sep 2013 10:14:19
Message: <52419e3b@news.povray.org>
>    texture {
>      pigment {
>        pigment_pattern {
>          gradient x
 >          }

>          pigment_map {
>            [0.00 Red_Texture]
>            [0.25 Red_Texture]
>            [0.75 White_Texture]
>            [1.00 White_Texture]
>          }


Try the above change, the pigment_map should be part of pigment, not 
pigment_pattern...


Post a reply to this message

From: Thomas de Groot
Subject: Re: No color from image_map pigment
Date: 24 Sep 2013 10:19:19
Message: <52419f67$1@news.povray.org>
Not immediately sure, but I /think/ it is because you use a 
pigment_pattern which only reads black/white.

Have you tried this?
     texture {
       pigment {
           gradient x
           pigment_map {
             [0.00 Red_Texture]
             [0.25 Red_Texture]
             [0.75 White_Texture]
             [1.00 White_Texture]
           }

         translate <0.5, 0.5, 0>
         rotate 180*y
         scale <24, 14, 1>
       }
etc...

Thomas


On 24-9-2013 16:00, jceddy wrote:
> Hopefully this will be quick for someone...I'm banging my head against it and I
> know it should be simple, but not quite getting it.
>
> I'm texturing a box using a pigment gradient with two image maps as input. When
> I render I don't get any color from the original images...what am I missing?
>
> The attachment has the output on top and the original image maps on the bottom.
>
> Here's the relevant code:
>
> #declare White_Texture =
> pigment {
>    image_map {
>      jpeg "white_hq.jpg"
>      map_type 0
>      interpolate 2
>    }
> }
>
> #declare Red_Texture =
> pigment {
>    image_map {
>      jpeg "red_hq.jpg"
>      map_type 0
>      interpolate 2
>    }
> }
>
> box {
>    <-12, -7, -0.1>, <12, 7, 0.1>
>
>    texture {
>      pigment {
>        pigment_pattern {
>          gradient x
>          pigment_map {
>            [0.00 Red_Texture]
>            [0.25 Red_Texture]
>            [0.75 White_Texture]
>            [1.00 White_Texture]
>          }
>        }
>
>        translate <0.5, 0.5, 0>
>        rotate 180*y
>        scale <24, 14, 1>
>      }
>      finish {
>        ambient 1
>        diffuse 0
>      }
>    }
> }
>


Post a reply to this message

From: jceddy
Subject: Re: No color from image_map pigment
Date: 24 Sep 2013 11:15:00
Message: <web.5241ac2da1609435314aa6840@news.povray.org>
You are correct, I just had to pull the pigment_pattern block out completely...I
knew it was something simple.

This works:

box {
  <-12, -7, -0.1>, <12, 7, 0.1>

  texture {
    pigment {
      gradient x
      pigment_map {
        [0.00 Red_Texture]
        [0.25 Red_Texture]
        [0.75 White_Texture]
        [1.00 White_Texture]
      }

      translate <0.5, 0.5, 0>
      rotate 180*y
      scale <24, 14, 1>
    }
    finish {
      ambient 1
      diffuse 0
    }
  }
}


Post a reply to this message

From: scott
Subject: Re: No color from image_map pigment
Date: 24 Sep 2013 11:47:49
Message: <5241b425$1@news.povray.org>
> Not immediately sure, but I /think/ it is because you use a
> pigment_pattern which only reads black/white.

pigment_pattern takes a full-colour pigment and returns a greyscale 
pattern. It's useful if you want to use a pigment as a pattern.

For example if you wanted to use a defined pigment instead of "gradient 
x" you can do this:

       texture {
         pigment {
             // gradient x
             pigment_pattern { myPigment }

             pigment_map {
               [0.00 Red_Texture]
               [0.25 Red_Texture]
               [0.75 White_Texture]
               [1.00 White_Texture]
             }

           translate <0.5, 0.5, 0>
           rotate 180*y
           scale <24, 14, 1>
         }

However note the pigment_map is not inside pigment_pattern, otherwise 
the Red_Texture or White_Texture would get chosen inside 
pigment_pattern, then converted to greyscale (as the OP code did).


Post a reply to this message

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