POV-Ray : Newsgroups : povray.binaries.images : Q: blurring bump map image in pov ? Server Time
18 Nov 2024 00:23:10 EST (-0500)
  Q: blurring bump map image in pov ? (Message 1 to 5 of 5)  
From: Jaap
Subject: Q: blurring bump map image in pov ?
Date: 29 Jul 2004 16:50:00
Message: <web.410961ca90e6d030a8399d8d0@news.povray.org>
hi,

i'm trying to make an old book texture
with gold lettering pressed into the leather.
it's all working very nice, i use a black and
white pixel map to switch between the book
texture and a gold texture.
i use a blurred copy of the same image as
a normal for the book texture to make the leather
look like it's pressed in around the gold lettering.

blurring the bump map image does not really give a
good result, what i do now is blur, then copy the
black lettering back on top of it, then blur again,
etc.. (5..10 x) followed by a final blurr with a
small radius.

is there some way to do this inside pov ? (i.e. using
the same black and white image as used for switching
between the 2 textures)
is it possible to get direct acces to the pixel data?
(so i can write my own blurring functions)

thanks in advance,
jaap.


Post a reply to this message


Attachments:
Download 'blured_bump_map.png' (12 KB)

Preview of image 'blured_bump_map.png'
blured_bump_map.png


 

From: Jaap
Subject: Re: Q: blurring bump map image in pov ?
Date: 29 Jul 2004 16:55:00
Message: <web.410963801d66f241a8399d8d0@news.povray.org>
"Jaap" <jws### [at] yahoocom> wrote:
> hi,

got the image in one go, but not the code....:

#declare material_book_red =
material  {
  texture {
    image_pattern { png "bump_neg.png" once } // negative so outside image
defaults to book texture
    rotate x*90
    scale <-1,1,1>
    translate <0.5,0,1>
    scale 10
    texture_map {
      // book texture:
      [0 pigment { book_red }
         normal {
           average
             normal_map {
             [1, bump_map { png "bump_impressed.png" bump_size 20 } ] //once
             [1, crackle 0.6 scale 0.03 ]
           }
         }
         finish { book_finish }
      ]
      // gold lettering:
      [1 pigment { book_gold } //P_Gold4
         normal {
           bump_map { png "bump_letters.png" bump_size 15 } //once
         }
         //finish { F_MetalE } //F_MetalA
         finish { gold_finish }
      ]
    }
  }
}

jaap.


Post a reply to this message

From: Shay
Subject: Re: Q: blurring bump map image in pov ?
Date: 29 Jul 2004 17:31:16
Message: <41096ca4$1@news.povray.org>
Jaap wrote:
> 
> is there some way to do this inside pov ? (i.e. using
> the same black and white image as used for switching
> between the 2 textures)
> is it possible to get direct acces to the pixel data?
> (so i can write my own blurring functions)
> 

Can be done directly, if very slowly in inside POV.
To get direct access to the pixel data of your map, you can use (untested):

#local Pix = function {
   pattern {
     image_pattern { png "bump.png" }
   }
}

image is mapped in function from x=0 y=0 to x=1 y=1, so you would get 
pixel <50,100> with
#local Value = Pix ( 50.5/mapwidth , 100.5/mapheight, 0 );

Simpler is to blur the function using another function. A simple blurred 
function using the above defined 'Pix' function would look like this:
#local Blurred = function {(Pix(x+.1,y,z) + Pix(x-.1,y,z))/2}

Apply whatever blurring function you like, then add layers, then blur 
again, use a sin function, whatever until you get what you want.

When done, render with:
pigment { function { Blurred(x,y,z) } }
or:
normal { function { Blurred(x,y,z) } }

If you've got the patience for that kind of render time, then I would 
suggest at least trying the object pattern (with a text object) as a 
function instead of using your map. Slower, but the results would likely 
be better.

  -Shay


Post a reply to this message

From: Jaap
Subject: Re: Q: blurring bump map image in pov ?
Date: 29 Jul 2004 17:40:01
Message: <web.41096e7c1d66f241a8399d8d0@news.povray.org>
Shay <sah### [at] simcopartscom> wrote:

> If you've got the patience for that kind of render time, then I would
> suggest at least trying the object pattern (with a text object) as a
> function instead of using your map. Slower, but the results would likely
> be better.

thanks
i'll try that, it would also give me some more flexebility.
(i now need different bump maps for each book on a bookshelfe...)


Post a reply to this message

From: Josh
Subject: Re: blurring bump map image in pov ?
Date: 30 Jul 2004 06:13:38
Message: <410a1f52$1@news.povray.org>
Thanks for bringing this subject up!  I'd overlooked this form of bump map
until now!!!!!!!!!!!!!!!!  Way Cool


Post a reply to this message

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