POV-Ray : Newsgroups : povray.binaries.images : Chinese Dish with pigment_pattern : Chinese Dish with pigment_pattern Server Time
5 Nov 2024 10:20:47 EST (-0500)
  Chinese Dish with pigment_pattern  
From: Janet
Date: 29 Oct 2006 12:35:00
Message: <web.4544e61631a11665156dd69f0@news.povray.org>
This is a dish modelled in Blender. The pattern on it uses a pigment_pattern
to add a gold texture to parts of the pattern. Its a very handy trick. This
is the code for the pattern on the top of the dish.
//This is the color image
#declare p_map1=pigment {uv_mapping image_map{jpeg
"ChineseSquareDishTex1.jpg" interpolate 2} }
//This is a gray scale image to define the textures
#declare p_mapPM=pigment {uv_mapping image_map{jpeg
"ChineseSquareDishTexPimentMap.jpg" interpolate 2} }
#declare GoldBase = <1.00, 0.875, 0.575>;  // mine again  rgb<1.00, 0.775,
0.375>
#declare CVect3 = GoldBase  - <0.00, 0.10, 0.20>;
#declare P_Gold3  = rgb CVect3;
#declare A_GoldC =  P_Gold3 * 0.08 + 0.1;
#declare R_GoldC = P_Gold3 * 0.40 + 0.25;
#declare D_GoldC = 1-(((R_GoldC.red+R_GoldC.green+R_GoldC.blue)/3)
                       + ((A_GoldC.red+A_GoldC.green+A_GoldC.blue)/3));
#declare M = 1;
#declare F_MetalC = finish { brilliance 4 diffuse D_GoldC ambient A_GoldC
reflection R_GoldC
    metallic M specular 0.60 roughness 1/80 }
#declare FIN = finish{ phong 1 phong_size 30 diffuse 0.6*1 ambient rgb
<0,0,0> reflection{.05}};
texture { pigment_pattern {p_mapPM }
    texture_map{
     [0
       pigment { p_map1 }
       finish{ FIN }
     ]
     [.9
       pigment { p_map1 }
       finish{ FIN }
     ]
     [.99
       pigment { rgb GoldBase }
       finish  { F_MetalC }
     ]
     [1
       pigment { rgb GoldBase }
       finish  { F_MetalC }
     ]
    }
  }

I can post the grayscale image used if anyone wants to see it.

Janet


Post a reply to this message


Attachments:
Download 'chinesesquaredish.jpg' (186 KB)

Preview of image 'chinesesquaredish.jpg'
chinesesquaredish.jpg


 

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