POV-Ray : Newsgroups : povray.newusers : Several textures/pigments on one surface Server Time
24 Nov 2024 06:40:36 EST (-0500)
  Several textures/pigments on one surface (Message 1 to 5 of 5)  
From: Jovian Ghost
Subject: Several textures/pigments on one surface
Date: 12 Oct 2009 22:50:01
Message: <web.4ad3ea18e8a97d86683b0b960@news.povray.org>
I've got a surface that I'd like to add multiple textures and/or pigments onto.
Is there a way I can constrict where a pigment/texture appears?

For example, I've got a cylinder, and I'd like a pattern to appear on one cap,
with another texture appearing within the first one. Is there a way to control
the boundaries of where the textures go?


Post a reply to this message

From: Chris B
Subject: Re: Several textures/pigments on one surface
Date: 13 Oct 2009 03:43:07
Message: <4ad42f8b$1@news.povray.org>
"Jovian Ghost" <nomail@nomail> wrote in message 
news:web.4ad3ea18e8a97d86683b0b960@news.povray.org...
> I've got a surface that I'd like to add multiple textures and/or pigments 
> onto.
> Is there a way I can constrict where a pigment/texture appears?
>
> For example, I've got a cylinder, and I'd like a pattern to appear on one 
> cap,
> with another texture appearing within the first one. Is there a way to 
> control
> the boundaries of where the textures go?
>

Yes. There are quite a few approaches you could take to do this type of 
thing.

To get a clean pattern on the end without it bleeding through into the rest 
of the object, you can start with a cylinder that is a tiny amount longer 
than needed and slice the extra off with a CSG operation. You can then apply 
a texture to the cutting object which will end up on the cut surface without 
affecting any other surfaces.

You can then use either layered textures or a texture_map to control which 
bits of texture go where on the cutting object. You can layer textures by 
simply specifying a succession of textures for an object, where upper layers 
have some transparent patches, so that the lower layers are visible in those 
places. Texture maps allow you to define a pattern where you can transition 
smoothly or sharply between different textures. For example, you could use 
the onion pattern in a texture map to create concentric rings of different 
textures, specifying a marble texture in the middle, transitioning to a 
crackle texture around the outside.

Regards,
Chris B.


Post a reply to this message

From: Mike Williams
Subject: Re: Several textures/pigments on one surface
Date: 13 Oct 2009 04:55:05
Message: <l0iLTvNm9D1KFwsw@econym.demon.co.uk>
Wasn't it Jovian Ghost who wrote:
>I've got a surface that I'd like to add multiple textures and/or pigments onto.
>Is there a way I can constrict where a pigment/texture appears?
>
>For example, I've got a cylinder, and I'd like a pattern to appear on one cap,
>with another texture appearing within the first one. Is there a way to control
>the boundaries of where the textures go?

For something as simple as a cylinder where you want a specific texture 
on the caps, I'd create the caps as separate objects. So I'd use one 
open cylinder and two discs instead of a single closed cylinder object.

For more complicated situations, I might use a pigment map. The 
difficult bit with pigment maps is specifying where the boundaries of 
the pigments are. You either need to be lucky with the existing POV 
patterns, and have a good understanding of how they work, or need to be 
able to write suitable pattern functions.

#declare p1 = pigment {rgb x}
#declare p2 = pigment {rgb y}

cylinder {-y,y,1
   pigment {
     cylindrical
     pigment_map {
       [0.5 p1]
       [0.5 p2]
     }
     scale 1.99999
   }
}

or

cylinder {-y,y,1
   pigment {
     function {x*x + z*z}
     pigment_map {
       [0.5 p1]
       [0.5 p2]
     }
     scale 1.41421356
   }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Alain
Subject: Re: Several textures/pigments on one surface
Date: 13 Oct 2009 23:09:50
Message: <4ad540fe$1@news.povray.org>

> I've got a surface that I'd like to add multiple textures and/or pigments onto.
> Is there a way I can constrict where a pigment/texture appears?
> 
> For example, I've got a cylinder, and I'd like a pattern to appear on one cap,
> with another texture appearing within the first one. Is there a way to control
> the boundaries of where the textures go?
> 
> 

In addition to what others have proposed...

If there is a sharp angle between areas that are to receive a particular 
texture and the rest of the object, it may be possible to use the slope 
pattern with a texture_map that have abrupt transitions:

texture{
slope{Direction}
texture_map{[0.1 texture End_texture][0.1 texture Body_texture]}
}

A slope from 0.0 to 0.1 will get the "End_texture", all the rest will 
get "Body_texture.

This would work best with angular objects.

Another way can be to use an object pattern that use two full textures 
instead of the usual pigments. You can then rotate, scale or translate 
that pattern to exactly where you want it.

If your object is a complexe CSG object, then you can apply different 
pigment/texture/material to some individual part, also giving you a 
sharp transition.



Alain


Post a reply to this message

From: Mike Williams
Subject: Re: Several textures/pigments on one surface
Date: 14 Oct 2009 00:20:58
Message: <Ez2zSWI3CV1KFwod@econym.demon.co.uk>
Wasn't it Jovian Ghost who wrote:
>I've got a surface that I'd like to add multiple textures and/or pigments onto.
>Is there a way I can constrict where a pigment/texture appears?

Also, for some types of surface (bicubic_patch, mesh, mesh2, lathe, sor, 
sphere, box, parametric, torus) you can use uv mapping.

The cylinder object isn't in that list, but you can create an equivalent 
surface using a sor or parametric.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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