POV-Ray : Newsgroups : povray.general : Need help with texture_map Server Time
19 Apr 2024 15:43:00 EDT (-0400)
  Need help with texture_map (Message 1 to 7 of 7)  
From: Josh English
Subject: Need help with texture_map
Date: 20 Mar 2023 22:42:38
Message: <6419199e$1@news.povray.org>
I solved this problem a couple of years ago with my "Portland Burns" 
image. The hard drive with all my code died and I can't seem to recreate it.

The idea is to create a texture map that allows for a transition between 
two other textures with a transition zone in-between. A quick sketch:

box {
   <0, 0, 0>, <1, 1, 0>
   texture {
       planar
       texture_map {
         [clock-0.01 Final_Texture ]
         [clock-0.01 Transition_Texture ]
         [clock Transition_Texture ]
         [clock Clear_Texture ]
}}}

But if I scale this texture or add turbulence on the outer texture, the 
inner textures are also scaled or transformed.

I swear I had pulled this off before but I can't suss it this time.

Any suggestions?

Josh English


Post a reply to this message

From: Thomas de Groot
Subject: Re: Need help with texture_map
Date: 21 Mar 2023 08:38:05
Message: <6419a52d$1@news.povray.org>
Op 21-3-2023 om 03:42 schreef Josh English:
> I solved this problem a couple of years ago with my "Portland Burns" 
> image. The hard drive with all my code died and I can't seem to recreate 
> it.
> 
> The idea is to create a texture map that allows for a transition between 
> two other textures with a transition zone in-between. A quick sketch:
> 
> box {
>    <0, 0, 0>, <1, 1, 0>
>    texture {
>        planar
>        texture_map {
>          [clock-0.01 Final_Texture ]
>          [clock-0.01 Transition_Texture ]
>          [clock Transition_Texture ]
>          [clock Clear_Texture ]
> }}}
> 
> But if I scale this texture or add turbulence on the outer texture, the 
> inner textures are also scaled or transformed.
> 
> I swear I had pulled this off before but I can't suss it this time.
> 
> Any suggestions?
> 
> Josh English

Interesting question.

What about warp{} ? I didn't test this but what if you do a first 
transformation within a warp statement /before/ the texture_map {} and a 
second warp statement /after/ the texture_map{}, reversing somehow your 
earlier warp transformation. Somehow, it seems not to make any sense at 
all but who knows...

Something else I was thinking was to make those reverse transformations 
(within a warp or not by the way) to the inside textures individually, 
and then apply the correct transformations to the outside texture? No 
idea if that would do what you want...

-- 
Thomas


Post a reply to this message

From: Chris R
Subject: Re: Need help with texture_map
Date: 21 Mar 2023 10:15:00
Message: <web.6419bb949474913ba2e6a155cc1b6e@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:
> I solved this problem a couple of years ago with my "Portland Burns"
> image. The hard drive with all my code died and I can't seem to recreate it.
>
> The idea is to create a texture map that allows for a transition between
> two other textures with a transition zone in-between. A quick sketch:
>
> box {
>    <0, 0, 0>, <1, 1, 0>
>    texture {
>        planar
>        texture_map {
>          [clock-0.01 Final_Texture ]
>          [clock-0.01 Transition_Texture ]
>          [clock Transition_Texture ]
>          [clock Clear_Texture ]
> }}}
>
> But if I scale this texture or add turbulence on the outer texture, the
> inner textures are also scaled or transformed.
>
> I swear I had pulled this off before but I can't suss it this time.
>
> Any suggestions?
>
> Josh English
I generally solve this problem by using a pigment_pattern{} in the outer texture
 rather than the pattern directly.

texture {
    pigment_pattern {
        planar
        // apply transformations here
    }
    texture_map {
       [clock-0.01 ...]
    }
}

That way your transformations apply to the planar mapping without distorting the
textures inside of the texture_map.  I believe you can also apply the
transformations within the body of the outer texture and it will still only
apply to the pigment_pattern without altering your inner textures.



-- Chris R.


Post a reply to this message

From: Josh English
Subject: Re: Need help with texture_map
Date: 21 Mar 2023 23:27:30
Message: <641a75a2$1@news.povray.org>
On 3/21/2023 7:13 AM, Chris R wrote:
> Josh English <Jos### [at] joshuarenglishcom> wrote:
>> I solved this problem a couple of years ago with my "Portland Burns"
>> image. The hard drive with all my code died and I can't seem to recreate it.
>>
>> The idea is to create a texture map that allows for a transition between
>> two other textures with a transition zone in-between. A quick sketch:
>>
>> box {
>>     <0, 0, 0>, <1, 1, 0>
>>     texture {
>>         planar
>>         texture_map {
>>           [clock-0.01 Final_Texture ]
>>           [clock-0.01 Transition_Texture ]
>>           [clock Transition_Texture ]
>>           [clock Clear_Texture ]
>> }}}
>>
>> But if I scale this texture or add turbulence on the outer texture, the
>> inner textures are also scaled or transformed.
>>
>> I swear I had pulled this off before but I can't suss it this time.
>>
>> Any suggestions?
>>
>> Josh English
> I generally solve this problem by using a pigment_pattern{} in the outer texture
>   rather than the pattern directly.
> 
> texture {
>      pigment_pattern {
>          planar
>          // apply transformations here
>      }
>      texture_map {
>         [clock-0.01 ...]
>      }
> }
> 
> That way your transformations apply to the planar mapping without distorting the
> textures inside of the texture_map.  I believe you can also apply the
> transformations within the body of the outer texture and it will still only
> apply to the pigment_pattern without altering your inner textures.
> 
> 
> 
> -- Chris R.
> 
> 

I think that's it. It works just like I remembered my Portland Flag 
image. For some reason using pigment_pattern in a top level of the 
texture definition seems, well, wrong.

Thank you.

-- Josh


Post a reply to this message

From: Josh English
Subject: Re: Need help with texture_map
Date: 21 Mar 2023 23:28:21
Message: <641a75d5$1@news.povray.org>
On 3/21/2023 5:38 AM, Thomas de Groot wrote:
> Op 21-3-2023 om 03:42 schreef Josh English:
>> I solved this problem a couple of years ago with my "Portland Burns" 
>> image. The hard drive with all my code died and I can't seem to 
>> recreate it.
>>
>> The idea is to create a texture map that allows for a transition 
>> between two other textures with a transition zone in-between. A quick 
>> sketch:
>>
>> box {
>>    <0, 0, 0>, <1, 1, 0>
>>    texture {
>>        planar
>>        texture_map {
>>          [clock-0.01 Final_Texture ]
>>          [clock-0.01 Transition_Texture ]
>>          [clock Transition_Texture ]
>>          [clock Clear_Texture ]
>> }}}
>>
>> But if I scale this texture or add turbulence on the outer texture, 
>> the inner textures are also scaled or transformed.
>>
>> I swear I had pulled this off before but I can't suss it this time.
>>
>> Any suggestions?
>>
>> Josh English
> 
> Interesting question.
> 
> What about warp{} ? I didn't test this but what if you do a first 
> transformation within a warp statement /before/ the texture_map {} and a 
> second warp statement /after/ the texture_map{}, reversing somehow your 
> earlier warp transformation. Somehow, it seems not to make any sense at 
> all but who knows...
> 
> Something else I was thinking was to make those reverse transformations 
> (within a warp or not by the way) to the inside textures individually, 
> and then apply the correct transformations to the outside texture? No 
> idea if that would do what you want...
> 
I had tried those and they simply didn't work. Chris R has the trick I 
had forgotten.

Thanks, though.

Now I can try to move on to the next part of the over-designed project : )

-- Josh


Post a reply to this message

From: Thomas de Groot
Subject: Re: Need help with texture_map
Date: 22 Mar 2023 03:16:41
Message: <641aab59$1@news.povray.org>
Op 21/03/2023 om 15:13 schreef Chris R:
> I generally solve this problem by using a pigment_pattern{} in the outer texture
>   rather than the pattern directly.
> 
Of course! :-)
I seem often to just forget about pigment_pattern{}.

[note to self: have to see shrink... or tattoo shop...  toss coin]

-- 
Thomas


Post a reply to this message

From: Chris R
Subject: Re: Need help with texture_map
Date: 22 Mar 2023 11:45:00
Message: <web.641b22099474913b879be96c5cc1b6e@news.povray.org>
Josh English <Jos### [at] joshuarenglishcom> wrote:
> On 3/21/2023 7:13 AM, Chris R wrote:
> > Josh English <Jos### [at] joshuarenglishcom> wrote:
> >> I solved this problem a couple of years ago with my "Portland Burns"
> >> image. The hard drive with all my code died and I can't seem to recreate it.
> >>
> >> The idea is to create a texture map that allows for a transition between
> >> two other textures with a transition zone in-between. A quick sketch:
> >>
> >> box {
> >>     <0, 0, 0>, <1, 1, 0>
> >>     texture {
> >>         planar
> >>         texture_map {
> >>           [clock-0.01 Final_Texture ]
> >>           [clock-0.01 Transition_Texture ]
> >>           [clock Transition_Texture ]
> >>           [clock Clear_Texture ]
> >> }}}
> >>
> >> But if I scale this texture or add turbulence on the outer texture, the
> >> inner textures are also scaled or transformed.
> >>
> >> I swear I had pulled this off before but I can't suss it this time.
> >>
> >> Any suggestions?
> >>
> >> Josh English
> > I generally solve this problem by using a pigment_pattern{} in the outer texture
> >   rather than the pattern directly.
> >
> > texture {
> >      pigment_pattern {
> >          planar
> >          // apply transformations here
> >      }
> >      texture_map {
> >         [clock-0.01 ...]
> >      }
> > }
> >
> > That way your transformations apply to the planar mapping without distorting the
> > textures inside of the texture_map.  I believe you can also apply the
> > transformations within the body of the outer texture and it will still only
> > apply to the pigment_pattern without altering your inner textures.
> >
> >
> >
> > -- Chris R.
> >
> >
>
> I think that's it. It works just like I remembered my Portland Flag
> image. For some reason using pigment_pattern in a top level of the
> texture definition seems, well, wrong.
>
> Thank you.
>
> -- Josh
Think about pigment_pattern as a pattern that uses a pigment to define the
boundaries for the *_map you want to use, rather than a pattern that applies to
pigments and it won't seem so wrong...


-- Chris R.


Post a reply to this message

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