POV-Ray : Newsgroups : povray.binaries.images : The Shallows II (2/3) : Re: The Shallows II (2/3) Server Time
25 Apr 2024 19:20:05 EDT (-0400)
  Re: The Shallows II (2/3)  
From: Thomas de Groot
Date: 4 Dec 2022 11:35:17
Message: <638ccc45$1@news.povray.org>
Op 3-12-2022 om 22:48 schreef s.day:
> This is even better than the first image, not really anything to critique. I
> especially love the texture/worn paint on the boat, great work.
> 
> Looking forwards to the next image.
> 
> Sean
> 

Thank you indeed Sean!

the (exterior) mesh2 boat texture is constructed as follows:

//source of the image maps:
//https://www.arroway-textures.ch/products/boards-004/?texture-tags=&texture-filter=

//Map definitions
#declare p_map1=pigment {image_map{jpeg 
"OldRowingBoat_boards-004_d100.jpg" gamma srgb interpolate 2 transmit 
all 0 } }
#declare p_map2=normal {bump_map{jpeg 
"OldRowingBoat_boards-004_b030.jpg" gamma 1.0 interpolate 2 }}
#declare p_map3=pigment {image_map{jpeg 
"OldRowingBoat_boards-004_s050-g050.jpg" gamma 1.0 interpolate 2 }}

//Poseray macro:
#macro pigment_multiply(p1,p2)
//multiplies two pigments p1xp2
#local PR1 = function {pigment{p1}}
#local PR2 = function {pigment{p2}}
#local PR_FRed=function (x,y,z) {PR1(x,y,z).red*PR2(x,y,z).red}
#local PR_FGrn=function (x,y,z) {PR1(x,y,z).green*PR2(x,y,z).green}
#local PR_FBlu=function (x,y,z) {PR1(x,y,z).blue*PR2(x,y,z).blue}
average pigment_map{
     [function{PR_FRed(x,y,z)} color_map{[0 rgb 0][1 rgb <1,0,0>*3]}] 
//add each color and then divide by 3
     [function{PR_FGrn(x,y,z)} color_map{[0 rgb 0][1 rgb <0,1,0>*3]}]
     [function{PR_FBlu(x,y,z)} color_map{[0 rgb 0][1 rgb <0,0,1>*3]}]
   }
#end

//Material definition
#declare PR_DIFFUSE = pigment {p_map1}
#declare PR_DIFFUSE = pigment {pigment_multiply(PR_DIFFUSE, pigment 
{color srgb ((<0.67,0.67,0.50>-<1,1,1>)*1.0+<1,1,1>) })}

#declare F1 =
finish {
   specular  0.274
   roughness 0.048
   diffuse  0.8
   reflection {0} conserve_energy
}

#declare F2 =
finish {
   specular  0.0
   roughness 0.002
   diffuse  0.8
   reflection {0} conserve_energy
}

#declare N1 =
normal {p_map2
   bump_size 50
}

#declare T1 =
texture {
   pigment {uv_mapping PR_DIFFUSE}
   finish {F1}
   normal {uv_mapping N1}
}

#declare T2 =
texture {
   pigment {uv_mapping PR_DIFFUSE}
   finish {F2}
   normal {uv_mapping N1}
}

#declare T3 =
texture {
   pigment {uv_mapping
     granite
     pigment_map {
       [0.20 srgb <0.3, 1.0, 0.3>]
       [0.35 srgb <1.0, 0.3, 0.3>]
       [0.55 srgb <1.0, 0.3, 0.3>]
       [0.70 srgb <1.0, 1.0, 0.3>]
     }
     scale 1
   }
   finish {F1}
   normal {uv_mapping N1}
}

#declare BoatPaint =
material {
   texture {
     pigment_pattern {uv_mapping p_map3}
     texture_map {
       [0.20 T1]
       [0.30 T3]
       [0.55 T2]
       [0.90 T3]
     }
   }
}


-- 
Thomas


Post a reply to this message

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