POV-Ray : Newsgroups : povray.bugreports : Bump mapping bug with cylindrical mapping Server Time
18 Apr 2024 19:53:16 EDT (-0400)
  Bump mapping bug with cylindrical mapping (Message 1 to 4 of 4)  
From: Eriban
Subject: Bump mapping bug with cylindrical mapping
Date: 24 May 2014 17:45:00
Message: <web.5381112b322b4989a5153eaa0@news.povray.org>
Hi,

I have bumped into a bug while using the cylindrical bump map feature. For
inward-facing surfaces the bumps are incorrect.

The scene below reproduces the problem. It defines two scenes:
* When clock = 0 the basic problem is shown. Here the vertical bands are
incorrect, which is very apparent due to the discontinuity at the top.
* When clock != 0 a work-around is attempted, which unfortunately fails. Now the
vertical bands are correct, but the inner horizontal bands are incorrect.

I will post the source normal images, as well as the resulting output images in
the images group.

Note, in this example it is of course possible to work-around the issue by
applying CSG. However, that is not so straightforward for the actual scene I
have in mind, as the normal isn't quite as simple. :-(

I found one very similar message in the forum:
http://news.povray.org/povray.general/thread/%3Cweb.4e3c2efc6f470711571dbe980@news.povray.org%3E/.
Here a torus bump map was used instead of cylinder bump map, but the issue is
the same. Unfortunately, there was no sign that this bug has been addressed
since then.

I am experiencing this problem in the following versions:
* The (unoffical) Mac version of POV-Ray 3.7.0
* The Mac version of POV-Ray 3.6.2

Cheers,
Erwin


#include "colors.inc"

camera {
 location <1, 1, -1> * 4
 angle 30
 right x
 up y * 3/4
 look_at < 0, 0, 0>
}

light_source {
 <-1, 5, -4>
 color White
}

#local Torus =
 torus {
  1, 0.3
 }
#local Cylinder =
 cylinder {
  <0, -0.4, 0>,
  <0,  0.4, 0>, 1
 }

#if (clock = 0)
 // Torus with same normal everywhere
 // -> Inner horizontal bands OK
 // -> Inner vertical bands wrong
 object {
  object { Torus }
  texture {
   pigment { color Blue }
   normal {
    bump_map {
     png "TestNormal0.png"
     map_type 2
    }
    translate y * -0.5
    bump_size 2
   }
  }
 }
#else
 // Torus with inverted normal on inside
 // -> Inner horizontal bands wrong
 // -> Inner vertical bands OK
 difference {
  object { Torus }
  object { Cylinder }
  texture {
   pigment { color Red }
   normal {
    bump_map {
     png "TestNormal0.png"
     map_type 2
    }
    translate y * -0.5
    bump_size 2
   }
  }
 }

 intersection {
  object { Torus }
  object { Cylinder }
  texture {
   pigment { color Yellow }
   normal {
    bump_map {
     // Inverse of TestNormal0.png, i.e. Black & White reversed
     png "TestNormal1.png"
     map_type 2
    }
    translate y * -0.5
    bump_size 2
   }
  }
 }
#end

/* EOF */


Post a reply to this message

From: Eriban
Subject: Re: Bump mapping bug with cylindrical mapping
Date: 24 May 2014 18:00:01
Message: <web.538115624de0d561a5153eaa0@news.povray.org>
Input and output images can be found here:
http://news.povray.org/povray.binaries.images/thread/%3Cweb.5381135f322b4989a5153eaa0%40news.povray.org%3E/


Post a reply to this message

From: clipka
Subject: Re: Bump mapping bug with cylindrical mapping
Date: 24 May 2014 19:04:52
Message: <53812594$1@news.povray.org>
Am 24.05.2014 23:39, schrieb Eriban:
> Hi,
>
> I have bumped into a bug while using the cylindrical bump map feature. For
> inward-facing surfaces the bumps are incorrect.

I guess this is another symptom of a long-standing bug (probably dating 
back to when normal perturbations were first introduced), which has been 
mentioned at least as early as 2008:

http://news.povray.org/povray.general/thread/%3Cweb.493114d0114da4434dea3830%40news.povray.org%3E/?mtop=291496


In short: Whether your POV-Ray bump maps will be inward, outward, or 
even kind of "sideways" (some weird effect where the light seems to be 
coming from a direction perpendicular to where it really is), is kind of 
a matter of chance, and may be different for different sides of any 
given object.

I do have plans to get rid of the problem some day, but I suggest to not 
hold your breath.


Post a reply to this message

From: Eriban
Subject: Re: Bump mapping bug with cylindrical mapping
Date: 25 May 2014 16:45:01
Message: <web.5382552b4de0d5612a35ae760@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 24.05.2014 23:39, schrieb Eriban:
> > I have bumped into a bug while using the cylindrical bump map feature. For
> > inward-facing surfaces the bumps are incorrect.
>
> I guess this is another symptom of a long-standing bug (probably dating
> back to when normal perturbations were first introduced), which has been
> mentioned at least as early as 2008:
>
http://news.povray.org/povray.general/thread/%3Cweb.493114d0114da4434dea3830%40news.povray.org%3E/?mtop=291496

Thanks for confirming  this is a bug, and one that has not been fixed yet.

> In short: Whether your POV-Ray bump maps will be inward, outward, or
> even kind of "sideways" (some weird effect where the light seems to be
> coming from a direction perpendicular to where it really is), is kind of
> a matter of chance, and may be different for different sides of any
> given object.

That's indeed what seems to be happening.

> I do have plans to get rid of the problem some day, but I suggest to not
> hold your breath.

Okay, I was planning to use this for engraving a text. I might still do that,
because the alternative of using CSG gives hard edges, which I don't expect will
look as good (I have not yet tried it). Anyway, with a bit of luck it will not
be that obvious. I was zooming in to get a few details right when I noticed.

Cheers,
Erwin


Post a reply to this message

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