POV-Ray : Newsgroups : povray.general : Turbulence in a pigment_map Server Time
24 Nov 2024 03:49:17 EST (-0500)
  Turbulence in a pigment_map (Message 1 to 10 of 10)  
From: Uncle Josh
Subject: Turbulence in a pigment_map
Date: 7 Sep 2020 18:35:01
Message: <web.5f56b4fd9b5feb8a313019390@news.povray.org>
I'm trying to animate a burning effect on object. I tried both pigment map and
texture maps, but the turbulence applied to the outer texture is being applied
to the inner textures, which I don't want.

I thought this was possible, but my active working memory is a couple decades
old.

Sample:

#declare P_cells = pigment { cells scale 0.1 }
#declare P_fire = pigment { gradient x
                            pigment_map { [0.75 rgb 0 ] [0.8 red 1 ] } }
#declare P_clear = pigment { color rgbt 1 }

#declare T_cells = texture { pigment {P_cells} }
#declare T_fire = texture { pigment { P_fire } }
#declare T_clear = texture { pigment { P_clear } }

#declare Burning_Texture =
   texture {
       gradient x
       texture_map {
         [0.0 T_cells ] [0.7 T_cells ]
         [0.75 T_fire ] [0.8 T_clear ]
         }
       turbulence 0.2 // should only apply to the mapping
   } // end of texture

I've tried this with material maps and pigment maps. I've tried putting the
turbulence in a warp block, nothing works.

I thought this was possible to do. Am I wrong?

Thanks,



Uncle Josh
Pontificating on the web since 1995


Post a reply to this message

From: Alain Martel
Subject: Re: Turbulence in a pigment_map
Date: 7 Sep 2020 18:53:10
Message: <5f56b9d6$1@news.povray.org>
Le 2020-09-07 à 18:32, Uncle Josh a écrit :
> I'm trying to animate a burning effect on object. I tried both pigment map and
> texture maps, but the turbulence applied to the outer texture is being applied
> to the inner textures, which I don't want.
> 
> I thought this was possible, but my active working memory is a couple decades
> old.
> 
> Sample:
> 
> #declare P_cells = pigment { cells scale 0.1 }
> #declare P_fire = pigment { gradient x
>                              pigment_map { [0.75 rgb 0 ] [0.8 red 1 ] } }
> #declare P_clear = pigment { color rgbt 1 }
> 
> #declare T_cells = texture { pigment {P_cells} }
> #declare T_fire = texture { pigment { P_fire } }
> #declare T_clear = texture { pigment { P_clear } }
> 
> #declare Burning_Texture =
>     texture {
>         gradient x
>         texture_map {
>           [0.0 T_cells ] [0.7 T_cells ]
>           [0.75 T_fire ] [0.8 T_clear ]
>           }
>         turbulence 0.2 // should only apply to the mapping
>     } // end of texture
> 
> I've tried this with material maps and pigment maps. I've tried putting the
> turbulence in a warp block, nothing works.
> 
> I thought this was possible to do. Am I wrong?
> 
> Thanks,
> 
> 
> 
> Uncle Josh
> Pontificating on the web since 1995
> 
> 
> 

Did you try this variation ?
#declare Burning_Texture =
    texture {
        gradient x
        texture_map {
          [0.0 T_cells turbulence -0.2] [0.7 T_cells turbulence -0.2]
          [0.75 T_fire turbulence -0.2] [0.8 T_clear turbulence -0.2]
          }
        turbulence 0.2 // should only apply to the mapping
    } // end of texture

You may need to use warp{turbulence -0.2} and warp{turbulence 0.2} for 
this to work properly.


Post a reply to this message

From: Uncle Josh
Subject: Re: Turbulence in a pigment_map
Date: 7 Sep 2020 19:20:00
Message: <web.5f56bfa92e3bd598313019390@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:
> Le 2020-09-07 à 18:32, Uncle Josh a écrit :
> > I'm trying to animate a burning effect on object. I tried both pigment map and
> > texture maps, but the turbulence applied to the outer texture is being applied
> > to the inner textures, which I don't want.
> >
> > I thought this was possible, but my active working memory is a couple decades
> > old.
> >
>
> Did you try this variation ?
> #declare Burning_Texture =
>     texture {
>         gradient x
>         texture_map {
>           [0.0 T_cells turbulence -0.2] [0.7 T_cells turbulence -0.2]
>           [0.75 T_fire turbulence -0.2] [0.8 T_clear turbulence -0.2]
>           }
>         turbulence 0.2 // should only apply to the mapping
>     } // end of texture
>
> You may need to use warp{turbulence -0.2} and warp{turbulence 0.2} for
> this to work properly.

I did, but it generates an parse error. If I put the turbulence -0.2 in the
declaration for the T_cells texture or pattern, it does nothing, or it does two
bits of turbulence that don't even each other out.

Uncle Josh
Pontificating on the web since 1995


Post a reply to this message

From: Bald Eagle
Subject: Re: Turbulence in a pigment_map
Date: 7 Sep 2020 19:40:00
Message: <web.5f56c49a2e3bd5981f9dae300@news.povray.org>
"Uncle Josh" <nomail@nomail> wrote:
> I'm trying to animate a burning effect on object. I tried both pigment map and
> texture maps, but the turbulence applied to the outer texture is being applied
> to the inner textures, which I don't want.


> I've tried this with material maps and pigment maps. I've tried putting the
> turbulence in a warp block, nothing works.
>
> I thought this was possible to do. Am I wrong?

Well, the turbulence only applies to the underlying pattern(s).  So what you
need to do is turbulate the pattern(s) that you want to layer on top.

#declare T_fire = texture { pigment { P_fire turbulence 0.2} }

The mapping applies to the gradient pattern, and if you want to turbulate the
mapping, then what you do is turbulate _that_ pattern, which the map applies to.

#declare Burning_Texture =
   texture {
       gradient x turbulence 0.2 ....

I'm not entirely understanding what you want to do, so I hope this helps
somewhat...


-Bill


Post a reply to this message

From: Uncle Josh
Subject: Re: Turbulence in a pigment_map
Date: 7 Sep 2020 20:35:00
Message: <web.5f56d1212e3bd598313019390@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Uncle Josh" <nomail@nomail> wrote:
> > I'm trying to animate a burning effect on object. I tried both pigment map and
> > texture maps, but the turbulence applied to the outer texture is being applied
> > to the inner textures, which I don't want.
>
>
> > I've tried this with material maps and pigment maps. I've tried putting the
> > turbulence in a warp block, nothing works.
> >
> > I thought this was possible to do. Am I wrong?
>
> Well, the turbulence only applies to the underlying pattern(s).  So what you
> need to do is turbulate the pattern(s) that you want to layer on top.
>
> #declare T_fire = texture { pigment { P_fire turbulence 0.2} }
>
> The mapping applies to the gradient pattern, and if you want to turbulate the
> mapping, then what you do is turbulate _that_ pattern, which the map applies to.
>
> #declare Burning_Texture =
>    texture {
>        gradient x turbulence 0.2 ....
>
> I'm not entirely understanding what you want to do, so I hope this helps
> somewhat...
>
>
> -Bill

Ultimately the underlying T_cells texture is also subject to turbulence, even
when no turbulence is defined.

I need to find a way to not subject the T_cells texture to turbulence.


Uncle Josh
Pontificating on the web since 1995


Post a reply to this message

From: Bald Eagle
Subject: Re: Turbulence in a pigment_map
Date: 7 Sep 2020 21:20:01
Message: <web.5f56db242e3bd5981f9dae300@news.povray.org>
#version 3.8;
global_settings {assumed_gamma 1.0}

camera {
 location <0.5, 0.5, -3>
 right x*image_width/image_height
 up y
 look_at <0.5, 0.5, 0>
}

light_source {<0, 1, -10> rgb 1}

sky_sphere {pigment {rgb 1}}

#declare P_cells = pigment { cells scale 0.1 }
#declare P_fire = pigment { gradient x turbulence 1.05
                            pigment_map {
                            [0.00 rgbt 1 ]
                            [0.75 rgbt 1 ]
                            [0.75 rgbt <1, 0, 0, 0.25> ]
                            [0.75 rgbt <1, 0.5, 0, 0.25> ]
                            [0.75 rgbt <1, 1, 0, 0.25> ]
                            [1.00 rgbt <1, 0, 0, 0.9> ] }
                            }

#declare T_cells = texture { pigment {P_cells} }
#declare T_fire = texture { pigment { P_fire } }

plane {z, 0 texture {T_cells} texture {T_fire}}


Post a reply to this message

From: Uncle Josh
Subject: Re: Turbulence in a pigment_map
Date: 8 Sep 2020 00:50:01
Message: <web.5f570cf32e3bd598313019390@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> #version 3.8;
> ...
>
> plane {z, 0 texture {T_cells} texture {T_fire}}

Not quite was I was going for, but after numerous searches I found Friedrich A.


After some tweaking:

#declare P_cells = pigment { cells scale 1/10 }
#declare dark_char = pigment { rgb 0 }
#declare ember = pigment { red 1 }
#declare P_clear = pigment { color rgbt 1 }

#declare Burning = texture {
pigment {
   pigment_pattern {
     planar
     rotate -90*z
     color_map { [0.1 White] [0.15 Black ] }
     scale 1
     turbulence .2
   }
   pigment_map {
     [ 0, P_cells ]
     [ 0.85, dark_char ]
     [ 0.90, ember ]
     [ 1, P_clear ]
   }
 }
} // Burning

The pigment_pattern is the solution I'm looking for.

Uncle Josh
Pontificating on the web since 1995


Post a reply to this message

From: Kenneth
Subject: Re: Turbulence in a pigment_map
Date: 13 Sep 2020 16:55:06
Message: <web.5f5e86282e3bd598d98418910@news.povray.org>
> >
> > Did you try this variation ?
> > #declare Burning_Texture =
> >     texture {
> >         gradient x
> >         texture_map {
> >           [0.0 T_cells turbulence -0.2] [0.7 T_cells turbulence -0.2]
> >           [0.75 T_fire turbulence -0.2] [0.8 T_clear turbulence -0.2]
> >           }
> >         turbulence 0.2 // should only apply to the mapping
> >     } // end of texture
> >
> > You may need to use warp{turbulence -0.2} and warp{turbulence 0.2} for
> > this to work properly.
>
> I did, but it generates an parse error. If I put the turbulence -0.2 in the
> declaration for the T_cells texture or pattern, it does nothing, or it does two
> bits of turbulence that don't even each other out.
>

I've likewise tried many times in the past to 'reverse' or 'un-do' turbulence
(in various ways), but it never worked. If it's even possible, a workable scheme
would be quite useful.


Post a reply to this message

From: Uncle Josh
Subject: Re: Turbulence in a pigment_map
Date: 13 Sep 2020 18:40:00
Message: <web.5f5e9ee42e3bd5989bc1eb920@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> I've likewise tried many times in the past to 'reverse' or 'un-do' turbulence
> (in various ways), but it never worked. If it's even possible, a workable scheme
> would be quite useful.

The pigment_pattern works, at least, because it isn't applying a texture within
a texture. The pigment_pattern creates a grayscale pattern (it will convert
normally colored patterns to grays) that the texture map. It's not trying to
undo turbulence, the turbulence isn't applied to the underlying pattern to begin
with.

Uncle Josh
Pontificating on the web since 1995


Post a reply to this message

From: William F Pokorny
Subject: Re: Turbulence in a pigment_map
Date: 14 Sep 2020 12:29:03
Message: <5f5f9a4f$1@news.povray.org>
On 9/13/20 6:36 PM, Uncle Josh wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>>
>> I've likewise tried many times in the past to 'reverse' or 'un-do' turbulence
>> (in various ways), but it never worked. If it's even possible, a workable scheme
>> would be quite useful.
> 
> The pigment_pattern works, at least, because it isn't applying a texture within
> a texture. The pigment_pattern creates a grayscale pattern (it will convert
> normally colored patterns to grays) that the texture map. It's not trying to
> undo turbulence, the turbulence isn't applied to the underlying pattern to begin
> with.
> 
> Uncle Josh
> 

An alternative method to move the turbulence into its own evaluation 
space would be something like:

#declare Fn = function { pattern { gradient x turbulence 0.2 } }
#declare Burning_Texture =
    texture {
        function { Fn(x,y,z) }     // Defining function above.
      //  It would be convenient if we could code:
      //function { pattern { gradient x warp { turbulence 0.2 } } }
      //  but it's not supported. Perfectly OK inline is:
      //function { 1.0 } // or any in-vm coding. Useful for map debug

Kenneth, On the reverse or undo turbulence. Isolating the turbulence 
(possibly other warp types too) or planning for native/partly unwound 
versions initially, I expect usually better - even if we could work out 
a generic unwind of some sort.

Related: I've been playing around with modifying the behavior of 
turbulence in povr and so created the following test case. You can, 
effectively,later undo(update) traditional turbulence(1), but not warp{ 
turbulence }(2).

#declare P00  = pigment { checker scale 1/6}
#declare P00t = pigment { P00  turbulence <.2,0,.2> }
#declare P01t = pigment { P00t turbulence <0,0,0> }
#declare P10t = pigment { P00  warp { turbulence <.2,0,.2> } }
#declare P11t = pigment { P10t warp { turbulence <0,0,0> } }
#declare P20t = pigment { P00t warp { turbulence <.2,0,0.2> } }
#declare P21t = pigment { P20t warp { turbulence <.2,0,0.2> } }
#declare P30t = pigment { checker
warp { turbulence <.2,0,.2> } scale 1/6 }

#declare P31t = pigment { checker
scale 1/6 warp { turbulence <.2,0,.2> } }

#declare P40t = pigment { checker turbulence <.2,0,.2> scale 1/6 }
#declare P41t = pigment { checker scale 1/6 turbulence <.2,0,.2> }
#declare P50t = pigment { P40t turbulence <0,0,0> }
#declare P51t = pigment { P41t turbulence <0,0,0> }

plane { +y, 0 pigment { P11t } }

// P00  - checker pattern scaled.
//
// P00t - apply turbulence using P00 as base.
//
// P01t - Reset old style turbulence by setting the turbulence vector
// to 0.
//
// P10t - Similar to P00t, but turbulence applied after scale due warp{}
//
// P11t - You cannot null warp {turbulence}. The warp list gets copied
// as can be seen by rendering P20t, P21t.
//
// P20t - The warp list gets copied to new 'patterns' and extended here
//
// P21t - Copy warp list and extend again.
//
// P30t/P31t - Checking that warp{} order relative to scale matters.
//
// P40t/P41t - Checking that traditional warp order relative to scale
// irrelevant.
//
// P50t/P51t - Checking that traditional warps can be zeroed / updated
// no matter the original specification order.
//

Bill P.

(1) - Turbulence vector, octaves, omega and lambda.
(2) - Might a method to clear a pigment/texture/material's warp list be 
useful?


Post a reply to this message

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