POV-Ray : Newsgroups : povray.general : Can use TWO image_map on ONE heigh_field? Server Time
2 Nov 2024 11:24:49 EDT (-0400)
  Can use TWO image_map on ONE heigh_field? (Message 1 to 5 of 5)  
From: jong
Subject: Can use TWO image_map on ONE heigh_field?
Date: 14 Apr 2004 13:30:00
Message: <web.407d73dd1e4177bdaf9f3afa0@news.povray.org>
Hi,

I try to use two image_map on the heigh_field.
But the result always show the later one.
Here is the simplified scene:

height_field {jpeg "mount.jpg" smooth
pigment {image_map{jpeg "mount_green.jpg"}}
pigment {image_map{jpeg "road.jpg"}}
finish  {ambient 0.1 diffuse 0.9 phong 0.5}
             }

I also try to use pigment_map. But the result
is not change. It always only show the later one
(road.jpg) on the heigh_field.

Is there any mistake in the syntax?
How can I do to show both of them?

Thanks all,

Shiann-Jong


Post a reply to this message

From: Mike Williams
Subject: Re: Can use TWO image_map on ONE heigh_field?
Date: 14 Apr 2004 14:42:17
Message: <Khme2DAb2XfAFwwa@econym.demon.co.uk>
Wasn't it jong who wrote:
>Hi,
>
>I try to use two image_map on the heigh_field.
>But the result always show the later one.
>Here is the simplified scene:
>
>height_field {jpeg "mount.jpg" smooth
>pigment {image_map{jpeg "mount_green.jpg"}}
>pigment {image_map{jpeg "road.jpg"}}
>finish  {ambient 0.1 diffuse 0.9 phong 0.5}
>             }
>
>I also try to use pigment_map. But the result
>is not change. It always only show the later one
>(road.jpg) on the heigh_field.
>
>Is there any mistake in the syntax?
>How can I do to show both of them?

1. You can't layer just the pigments, you can only layer complete
textures.

2. When you layer textures, the last one needs to have some sort of
transparency (filter or transmit) otherwise you can't see through it to
the underlying layer.


 height_field {jpeg "mount.jpg" smooth
   texture {pigment {image_map{jpeg "mount_green.jpg"}}}
   texture {
     pigment {image_map{jpeg "road.jpg" transmit all 0.75}}
     finish  {ambient 0.1 diffuse 0.9 phong 0.5}
   }
 }


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Samuel Benge
Subject: Re: Can use TWO image_map on ONE heigh_field?
Date: 14 Apr 2004 16:01:32
Message: <407D9847.6070407@hotmail.com>
jong wrote:

> Hi,
> 
> I try to use two image_map on the heigh_field.> 


Do not worry, Shiann-Jong. There is a way to average two images together 
for use in a height_field. Unfortunately each image must be in 24-bit 
color or 8-bit grayscale. 16-bit grayscale images will *not* work with 
this method.

Here's some code which I just tested:

height_field{
  function 200,200{
   pigment{
    average
    pigment_map{
     [1
      image_map{tga"image_1.tga"
      interpolate 2}
     ]
     [1
      image_map{
      jpeg"image_2.jpg" interpolate 2
      }
     ]
    }
   }
  }
}

Look for 'average' in the POV-Ray documentation to learn how to control 
the average pattern and its pigment_map.

-Samuel Benge


Post a reply to this message

From: Alain
Subject: Re: Can use TWO image_map on ONE heigh_field?
Date: 14 Apr 2004 21:29:30
Message: <407de57a$1@news.povray.org>
jong nous apporta ses lumieres ainsi en ce 2004/04/14 13:26... :

>Hi,
>
>I try to use two image_map on the heigh_field.
>But the result always show the later one.
>Here is the simplified scene:
>
>height_field {jpeg "mount.jpg" smooth
>pigment {image_map{jpeg "mount_green.jpg"}}
>pigment {image_map{jpeg "road.jpg"}}
>finish  {ambient 0.1 diffuse 0.9 phong 0.5}
>             }
>
>I also try to use pigment_map. But the result
>is not change. It always only show the later one
>(road.jpg) on the heigh_field.
>
>Is there any mistake in the syntax?
>How can I do to show both of them?
>
>Thanks all,
>
>Shiann-Jong
>
>
>
>  
>
OK you have the hight_map and want to apply both images to it.
Have the second image be a 4 chanels PNG or TGA (RedGreenBlueAlpha). The 
alpha chanel can make the image transparent where you want the 
underlaying image to be seen.
Your third sample line will then read as: pigment{image_map{png "road.png"}}
This should work on any type of object, not just height_fields.
POVRay, Gimp, Paintshop can produce 4 chanels PNGs and TGAs. Others can 
surely do the same.

Alain


Post a reply to this message

From: Mike Andrews
Subject: Re: Can use TWO image_map on ONE heigh_field?
Date: 15 Apr 2004 07:25:00
Message: <web.407e70da94e902359735c0c0@news.povray.org>
"jong" <sjl### [at] earthsinicaedutw> wrote:
> Hi,
>
> I try to use two image_map on the heigh_field.
> But the result always show the later one.
> Here is the simplified scene:
>
> height_field {jpeg "mount.jpg" smooth
> pigment {image_map{jpeg "mount_green.jpg"}}
> pigment {image_map{jpeg "road.jpg"}}
> finish  {ambient 0.1 diffuse 0.9 phong 0.5}
>              }
>
> I also try to use pigment_map. But the result
> is not change. It always only show the later one
> (road.jpg) on the heigh_field.
>
> Is there any mistake in the syntax?
> How can I do to show both of them?

I'd probably use a pigment_pattern{} block. If you can produce an image that
is white where you want the road and black elsewhere (call it something
like 'road_binary.jpg') then this might work:-

height_field {
  jpeg "mount.jpg" smooth
  pigment {
    pigment_pattern{image_map{jpeg "road_binary.jpg"}}
    pigment_map{
      [0.5 image_map{jpeg "mount_green.jpg"}]
      [0.5 image_map{jpeg "road.jpg"}]
    }
  }
  finish {ambient 0.1 diffuse 0.9 phong 0.5}
}

>
> Thanks all,
>
> Shiann-Jong

Bye for now,

Mike Andrews.


Post a reply to this message

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