POV-Ray : Newsgroups : povray.bugreports : bump maps inverted in spherical warp Server Time
23 Oct 2021 03:26:28 EDT (-0400)
  bump maps inverted in spherical warp (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: bump maps inverted in spherical warp
Date: 5 Aug 2021 21:05:00
Message: <web.610c8a76fbcfb68e1f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> I think you've got it Bill. The behavior, though, looks inconsistent to
> me. Maybe if I think about it more, it's how it must be?

Well, there are so many ways to go about it.

> (a) - Not done any debugging to see if the 'pointless' warps / modifiers
> end up used.
>
> Aside 1: turbulence{} trips this parse error too.
>
> Aside 2: transforms can be pointless too and like turbulence and warp we
> 'sometimes' get PossibleError warnings for those though I'm not aware of
> any hard errors there.

Indeed.  However, I would imagine that one might code up something that just
loops through a bunch of things that these may or may not have any visible
effect on, and it's just a throwaway operation for those instances.

> Aside 3: With image based mapping, the usual approach would be to use
> the appropriate map type inside the bump_map{} block - here 'map_type 1'
> spherical - though the warp{spherical} modifier should work too.

Probably the best approach, I would imagine.   Tailor made for the purpose.

> Aside 3a: There is too 'uv_mapping' for spheres which can be used inside
> texture, pigment and normal blocks.

There is, though I still haven't figured out how to separate the the normal from
the uv mapped texture...  Someday...

> :-) Nothing if not lots of knobs,  buttons and switches!


No.  Kidding.
There are days when I am truly astounded that all of the bits of things the user
wants to do and demands of the parser and modifier hierarchy all more or less
work after processing billions of cycles of under-the-hood raytracing black
magic.


Post a reply to this message

From: clipka
Subject: Re: bump maps inverted in spherical warp
Date: 6 Aug 2021 07:35:59
Message: <610d1e9f$1@news.povray.org>
Am 06.08.2021 um 02:20 schrieb William F Pokorny:

> If I comment that last warp{}, and un-comment two warp{}s above - or use 
> instead the plain pigment inside the texture with the warp{}, I get no 
> complaint about any 'pointless' warps(a) - though some of them certainly 
> are.

The primary reason is that textures - in general - are nothing but mere 
containers to bundle pigments, finishes and normal perturbations into a 
coherent unit. As such, they provide no functionality of their own.

Specifically, they have no "hook" built into them to plug a warp into.


Exceptions to the rule are patterned and layered textures, which both 
add extra functionality of their own. And patterned textures do provide 
a "hook" for a warp to plug into.


Yes, in theory we could have non-patterned textures propagate any warps 
to their pigments, finishes and normals. We mustn't do that for 
patterned textures though. Also, what should happen if the pigment, 
finish or normal already has a warp? Should the texture warp be ignored, 
appended, prepended, or override the pigment/finish/normal warp? What 
should happen in this context to things that may or may not be converted 
into warps under the hood, such as turbulence?

It would also mean that we'd have to add room for extra data to the 
generic texture data structure, at least during parsing, because we 
can't propagate the warp before the scene has been fully assembled: The 
texture could be re-used someplace else and the pigment replaced with a 
different one, for instance, in which case that new one would also have 
to have the warp propagated to it.
And currently we're using the same data structures for both parsing and 
rendering, so any extra memory we reserve for the parsing step is also 
memory that will be unavailable during the render proper for other 
stuff, such as storing image data, radiosity samples, photon maps and 
the like. It would also be unused memory sitting right in the middle of 
other data we might need frequently, potentially displacing useful data 
from the CPU caches and thus maybe even dragging down performance.

TL;DR: I think there are too many worms in that can to open it up 
without need.


Post a reply to this message

From: Cousin Ricky
Subject: Re: bump maps inverted in spherical warp
Date: 6 Aug 2021 21:16:14
Message: <610ddede$1@news.povray.org>
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 just remembered I ran into this problem a few years ago.  Now that
clipka has convincingly explained why this falls squarely into "feature"
category, I should share the solution Thomas suggested to me, which
worked well.

  https://news.povray.org/54eb1a57@news.povray.org


Post a reply to this message

From: Kenneth
Subject: Re: bump maps inverted in spherical warp
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

From: Kenneth
Subject: Re: bump maps inverted in spherical warp
Date: 7 Aug 2021 19:45:00
Message: <web.610f19c7fbcfb68e4cef624e6e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> 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.
>
> ... and the texture_map supplies the 'hook' for the warp{...}, that Clipka
mentioned.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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