POV-Ray : Newsgroups : povray.newusers : Is it possible to layer a texture over a CSG ? Server Time
30 Jul 2024 18:22:48 EDT (-0400)
  Is it possible to layer a texture over a CSG ? (Message 1 to 6 of 6)  
From: Bernard Hatt
Subject: Is it possible to layer a texture over a CSG ?
Date: 4 Dec 2003 12:44:45
Message: <3FCF742D.7B253C61@arkady.demon.co.uk>
It seems that you can layer a (partly transparent) texture over a single
item, but not a union. Is there some way to do this ?

eg.

#declare my_object1=
sphere{0, 1     texture {T_Wood7}}

#declare my_object2=
union
{
        sphere{<0.5,0,0>, 1 texture {T_Wood7 rotate<0,90,0>}}
        sphere{<-0.5,0,0>, 1 texture {T_Wood7}}
}

object
{
//      my_object1      // this works
        my_object2      // this doesn't
        texture {pigment{bozo scale 0.25 color_map {[0.5 rgbf 1][0.5 rgb 1]}}}
}

Thanks,

Bernard


Post a reply to this message

From: Christopher James Huff
Subject: Re: Is it possible to layer a texture over a CSG ?
Date: 4 Dec 2003 13:37:47
Message: <cjameshuff-FF0BE9.13371604122003@netplex.aussie.org>
In article <3FCF742D.7B253C61@arkady.demon.co.uk>,
 Bernard Hatt <bmh### [at] arkadydemoncouk> wrote:

> It seems that you can layer a (partly transparent) texture over a single
> item, but not a union. Is there some way to do this ?

Don't texture the CSG.
When you apply a texture to a CSG like this, the texture is only applied 
to shapes in the CSG that don't have a texture. This is usually a good 
thing, allowing you to efficiently texture the CSG, but it is a bit 
annoying sometimes...

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Mike Williams
Subject: Re: Is it possible to layer a texture over a CSG ?
Date: 4 Dec 2003 13:54:24
Message: <L$NRAOAEJ4z$Ew+D@econym.demon.co.uk>
Wasn't it Bernard Hatt who wrote:
>
>It seems that you can layer a (partly transparent) texture over a single
>item, but not a union. Is there some way to do this ?
>

Note that this works:-

#declare my_object2=
union
{
        sphere{<0.5,0,0>, 1 }
        sphere{<-0.5,0,0>, 1}
         texture {T_Wood7}
}

object
{
        my_object2
        texture {pigment{bozo scale 0.25 color_map {[0.5 rgbf 1][0.5 rgb 1]}}}
}



What happens in your code is that the second texture doesn't get applied to
each of the spheres, it gets applied to the whole union, so it's like saying

union
{
        sphere{<0.5,0,0>, 1 texture {T_Wood7 rotate<0,90,0>}}
        sphere{<-0.5,0,0>, 1 texture {T_Wood7}}
        texture {pigment{bozo scale 0.25 color_map {[0.5 rgbf 1][0.5 rgb 1]}}}
}

in which the inner textures overwrite the outer one, rather than layering with
it. In my above example, both textures are applied at the same level so they
do layer together. 

I'd guess that it's not going to be possible to do what it looks like you want
to do. If you want different inner layers on the components of your union, I
think you're going to have to write the shared outer layer onto each
individual component.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Bernard Hatt
Subject: Re: Is it possible to layer a texture over a CSG ?
Date: 4 Dec 2003 17:29:40
Message: <3FCFB6F7.91B7E9CA@arkady.demon.co.uk>
Mike Williams wrote:
> 
> Wasn't it Bernard Hatt who wrote:
> >
> >It seems that you can layer a (partly transparent) texture over a single
> >item, but not a union. Is there some way to do this ?
> >
> [...]
> I'd guess that it's not going to be possible to do what it looks like you want
> to do. If you want different inner layers on the components of your union, I
> think you're going to have to write the shared outer layer onto each
> individual component.
> 
> --
> Mike Williams
> Gentleman of Leisure

Thanks for the replies,

The problem is that I have an object constructed from a number of wooden
elements which are rotated/translated into position. If I apply the bozo
layer onto each element then the pattern doesn't match where the edges
of the elements meet...

As a workaround, I'll scale the bozo pattern smaller, to make it less obvious
where the joins are.

Regards,

Bernard


Post a reply to this message

From: Mike Williams
Subject: Re: Is it possible to layer a texture over a CSG ?
Date: 4 Dec 2003 22:52:51
Message: <848sRCAA9$z$EwJU@econym.demon.co.uk>
Wasn't it Bernard Hatt who wrote:
>Mike Williams wrote:
>> 
>> Wasn't it Bernard Hatt who wrote:
>> >
>> >It seems that you can layer a (partly transparent) texture over a single
>> >item, but not a union. Is there some way to do this ?
>> >
>> [...]
>> I'd guess that it's not going to be possible to do what it looks like you want
>> to do. If you want different inner layers on the components of your union, I
>> think you're going to have to write the shared outer layer onto each
>> individual component.
>> 
>> --
>> Mike Williams
>> Gentleman of Leisure
>
>Thanks for the replies,
>
>The problem is that I have an object constructed from a number of wooden
>elements which are rotated/translated into position. If I apply the bozo
>layer onto each element then the pattern doesn't match where the edges
>of the elements meet...

That's not a problem. You can put one texture layer before the
rotation/translation and one texture layer after it. For example:

#declare WOOD = texture {
 T_Wood7 rotate x*90
}

#declare BOZO = texture {
 pigment{bozo 
  scale 0.25 
  color_map {[0.5 rgbf 1][0.5 rgb 1]}}
}

union {
 box{0,<0.5,1,0.5> texture {WOOD} 
  texture {BOZO}
 }
 box{0,<0.5,1,0.5> texture {WOOD}
  rotate -z*90
  texture {BOZO}
 }
 box{0,<0.5,1,0.5> texture {WOOD}
  translate <1,-0.5,0>
  texture {BOZO}
 }
 box{0,<0.5,1,0.5> texture {WOOD}
  rotate -z*90
  translate <0.5,1,0>
  texture {BOZO}
 }
}

The WOOD grain is discontinuous, because it rotates and translates with
each component, but the BOZO layer is continuous because it is applied
after the transformations.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Bernard Hatt
Subject: Re: Is it possible to layer a texture over a CSG ?
Date: 5 Dec 2003 03:36:37
Message: <3FD0453E.D6A37657@arkady.demon.co.uk>
Mike Williams wrote:
> 
> Wasn't it Bernard Hatt who wrote:

> >
> >Thanks for the replies,
> >
> >The problem is that I have an object constructed from a number of wooden
> >elements which are rotated/translated into position. If I apply the bozo
> >layer onto each element then the pattern doesn't match where the edges
> >of the elements meet...
> 
> That's not a problem. You can put one texture layer before the
> rotation/translation and one texture layer after it. For example:

> [ ... ]

> The WOOD grain is discontinuous, because it rotates and translates with
> each component, but the BOZO layer is continuous because it is applied
> after the transformations.
> 
> --
> Mike Williams
> Gentleman of Leisure

Aha! , yes it's obvious now :-)

Thanks,

Bernard


Post a reply to this message

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