POV-Ray : Newsgroups : povray.general : procedural texture as a bump map? : Re: procedural texture as a bump map? Server Time
30 Jul 2024 16:13:03 EDT (-0400)
  Re: procedural texture as a bump map?  
From: Dave VanHorn
Date: 7 Nov 2008 09:50:00
Message: <web.491454efb3807db2a08ed15e0@news.povray.org>
> It's just the pattern from the P_WoodGrain12a pigment,
> modified to be a normal, you can look it up in woods.inc,
> that's in the POV/include directory.


Ok, that worked great!  I had to distort the patterns a bit to get the grain the
way I wanted it, but it worked nicely.

I made a floor of boards,

#declare Floor = object { union { object { Board1  translate <-15, 0, 0>}
                                  object { Board2  translate <-12, 0, 0>}
                                  object { Board3  translate < -9, 0, 0>}
                                  object { Board4  translate < -6, 0, 0>}
                                  object { Board5  translate < -3, 0, 0>}
                                  object { Board6  translate <  0, 0, 0>}
                                  object { Board7  translate <  3, 0, 0>}
                                  object { Board8  translate <  6, 0, 0>}
                                  object { Board9  translate <  9, 0, 0>}
                                  object { Board10 translate < 12, 0, 0>}
                                  object { Board11 translate < 15, 0, 0>}
                                }
                          scale <0.5, 1, 1>
                        }

Each board has the same texture, but slid back and forth so that they don't look
like "clones".

#declare Board1 = object { Board
                           material { Floor_Texture
                                      translate <1, 0, 10>
                                    }
                         }


The actual board is pretty simple, I position them at 3 unit intervals, so they
are 2.9 wide, which gives a fair looking gap between.

#declare Board = object { box { <-0.5, -0.5, -0.5>  // one corner position <X1
Y1 Z1>
                                < 0.5,  0.5,  0.5>  // other corner position <X2
Y2 Z2>
                                scale <2.95, 1.0, 100.0> //2.9" wide, 100" long,
1" thick
                                translate <0, -0.5, 0> //Move the top back down
to 0,0,0
                              }
                        }


And here's how the texture ended up.

#declare Floor_Texture = material { texture { pigment { P_WoodGrain18A color_map
{M_Wood18A }}}
                                    texture { pigment { P_WoodGrain12A color_map
{M_Wood18B }}}
                                    texture { pigment { P_WoodGrain12B color_map
{M_Wood18B }}
                                              normal  { average normal_map {
[0.5  N_WoodGrain18a]

[0.5  N_WoodGrain12a]

[0.5  N_WoodGrain12b]
                                                                           }
                                                      }
                                              finish {reflection 0.05}
                                            }
                                    scale <0.5, 1.0, 2.0> // stretch and
compress for finer "grain"
                                  }


Post a reply to this message

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