POV-Ray : Newsgroups : povray.bugreports : bump maps inverted in spherical warp : Re: bump maps inverted in spherical warp Server Time
26 Apr 2024 01:45:28 EDT (-0400)
  Re: bump maps inverted in spherical warp  
From: Kenneth
Date: 7 Aug 2021 16:00:00
Message: <web.610ee3f7fbcfb68e4cef624e6e066e29@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2021-08-05 2:40 AM (-4), Kenneth wrote:
> >
> > Apparently, a warp{...} cannot be added to a previously-#declared texture. I
> > sometimes run into similar problems; some things can be added, some can't.
>
> ...I should share the solution Thomas suggested to me, which
> worked well.
>
>   https://news.povray.org/54eb1a57@news.povray.org

That's an interesting trick!

Here's Thomas's example:

texture {
   granite
   texture_map {
     [0 MyTexture1] // pre-#declared texture
     [1 MyTexture2] // pre-#declared texture
   }
   warp {turbulence 1}
}

Modified a little, it works for the OP's problem:

#declare tmoon =
texture{
      gradient x // [a simple DUMMY pattern, because some kind of pattern is
                 // needed for a texture_map]
      texture_map{
       [.5 pbfr] // the pre-#declared texture-- and only one entry
            }
      warp{turbulence .2}
 }

My guess is that the 'dummy' pattern is not imposed on the pbfr texture
because there is only one entry in the texture_map's index... so the dummy
pattern doesn't matter.

Here's a small test scene of my own:
-------
#version 3.7; // or 3.8
global_settings{assumed_gamma 1.0}

camera {
  perspective
  location  <.5, .5, -1>
  look_at   <.5, .5,  0>
  right     x*image_width/image_height
  angle 67
}

background{rgb .1}

// my own pre-#declared texture
#declare pbfr =
texture{
 pigment{hexagon rotate 90*x scale .1}
 finish{ambient 1 emission 0 diffuse 0}
 }

// adding a warp(...) to the #declared texture...
#declare tmoon =
texture{
      gradient x // [DUMMY pattern]
      texture_map{
          [.5 pbfr]
                }
      warp{turbulence .2}
 }

box{0,<1,1,.1>
texture{tmoon}
}
--------

BTW, warp{spherical} also works-- but with that I see tiny speckles that look
like coincident surface problems(??). It's not due to the earlier hexagon
pattern; I substituted 'bumps' there and still see some speckles. Maybe due to
the texture_map trick itself, somehow? Or the final box's position?


Post a reply to this message

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