POV-Ray : Newsgroups : povray.binaries.images : diffuse map + specular map : Re: diffuse map + specular map Server Time
2 May 2024 04:04:46 EDT (-0400)
  Re: diffuse map + specular map  
From: Trevor G Quayle
Date: 11 Jan 2007 11:40:00
Message: <web.45a667b0f617fe16c150d4c10@news.povray.org>
Looking good.  I have used arroways maps before myself.  You need to add the
bump map in though.   You can either do this via a normal map, or make a
heightfield.  When I used them, I prefered the heightfiled option as
normals beyond a certain scale start to look 'paited on' to me.  Here is
the basic code I used:

//START
#declare BM="pavement 04-b.jpg";//bump map
#declare DM="pavement 04-d.jpg";//diffuse map
#declare SM="pavement 04-s.jpg";//specular/reflective map
#declare Scl=<1200,10,1200>;    //tile size (the arroway site has this for
the samples)
#declare Spec=0.1;              //specular/reflective strength (again you
can use arroway's info)

#macro Tex1(IMap,Ref)//texture mapping as a macro to simply use
  pigment {image_map { jpeg IMap map_type 0 interpolate 2 once } rotate
x*90}
  finish  {
    ambient 0 diffuse 0.4//
    conserve_energy
    reflection{0 Ref fresnel on metallic 0}
  }
#end

#declare Dif=0.4;//diffuse value, you need to vary to see what looks best

#declare Tile=
height_field{jpeg BM
  material{
    texture{
      image_pattern { jpeg SM map_type 0 interpolate 2 once }
      texture_map{
        [0 Tex1(DM,0)]
        [1 Tex1(DM,Spec)]
      }
    }
    interior{ior 1.56}//using fresnel reflection, vary ior accordingly
  }
}

#declare Siz=6;//creating a 6x6 tiling of the tile
union{
  #declare i=1;#while (i<Siz)
    #declare j=1;#while (j<Siz)
      object{Tile translate <-i,0,-j>}
    #declare j=j+1;#end
  #declare i=i+1;#end
  scale Scl
}



-tgq


Post a reply to this message

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