POV-Ray : Newsgroups : povray.text.scene-files : metal textures Server Time
23 Dec 2024 06:40:46 EST (-0500)
  metal textures (Message 1 to 1 of 1)  
From: JRG
Subject: metal textures
Date: 14 Apr 2001 08:33:20
Message: <3ad84390@news.povray.org>
// Persistence of Vision Ray Tracer Scene Description File
// File: torii.pov
// Vers: MegaPov 0.7
// Desc:
// Date:
// Auth: Jonathan Rafael Ghiglia
//

#version unofficial MegaPov 0.7;



global_settings
{

max_trace_level 10
}
// ----------------------------------------

#declare Location = <-2, 3, -4>;
#declare Look_at = <0, 0, 0>;

camera
{
  location  Location
  look_at   Look_at
}

#declare area =off;

light_source
{ <4, 5, -5>
  rgb <1, 1, 1>*3
  fade_power 2
  fade_distance 5  #if (area) area_light 1*x,1*y,7,7 jitter adaptive 1
orient #end
 }

// ----------------------------------------
plane { y, 0
 pigment {  color rgb 1    }
 finish { ambient 0 diffuse 0.5 specular 0.2 roughness 0.015 reflection
0.2 }
 }


#macro r_ring (rag,num,mayor,minor,max_inc,t_ring,Seed)

#declare ring = torus {major, minor}
#declare step = 360/num;
#declare i=1;
#declare ang=0;
#while (i<=num)

object { ring
        texture {t_ring translate 5*rand(Seed)}
        #declare inc=max_inc*rand(Seed);
        rotate z*inc
        rotate 360*rand(Seed)*y
        translate <rag,major*sin(radians(inc))+minor,0>
        rotate ang*y}
#declare ang = ang + step;
#declare i=i+1;
#end
#end



#declare major = 0.3;
#declare minor = 0.03;
//----------gold, brass or what?-------
#declare t_gold = texture { wrinkles scale 0.1 warp {reset_children}
texture_map {
                          [0 pigment { rgb <1,.6,.2>}
                           finish {ambient 0 diffuse 0.3 reflection_max 0.6
reflection_min 0.3 reflect_metallic metallic
                                        specular 1 roughness 0.01}
                                        normal {dents 0.35 scale 0.05}]
                          [1 pigment {rgb <1,.65,.3>}
                           finish {ambient 0 diffuse 0.35 reflection_max 0.5
reflection_min 0.2 reflect_metallic metallic
                                        specular .7 roughness 0.04}
                                        normal {dents 0.5 scale 0.01}]} }

//----------simple metal-------
#declare t_metal = texture { wrinkles scale 0.1 warp {reset_children}
texture_map {
                          [0 pigment { rgb <1,.93,.9>}
                           finish {ambient 0 diffuse 0.2 reflection_max 0.7
reflection_min 0.4 reflect_metallic metallic
                                        specular 1 roughness 0.007 }
                                        normal {dents 0.35 scale 0.05}]
                          [1 pigment {rgb <.915,.85,.85>}
                           finish {ambient 0 diffuse 0.3 reflection_max 0.6
reflection_min 0.3 reflect_metallic metallic
                                        specular .7 roughness 0.02 }
                                        normal {dents 0.5 scale 0.01}]} }


//------------simple rusty metal----
#declare t_rusty = texture {bozo  warp {turbulence 0.8 } scale 0.2 warp
{reset_children} texture_map {
                        [0 t_metal][0.6 t_metal]
                                        [0.7 pigment {granite color_map {[0
rgb <.8,.4,.2>*.8][1 rgb <.8,.5,.1>*.8]} scale 0.1}
                                        finish {ambient 0 diffuse 0.5
specular 0.3 roughness 0.01 metallic}
                                         normal {granite 0.5 scale 0.1}]
                                         [1 pigment {granite color_map {[0
rgb <.8,.4,.2>*.8][1 rgb <.8,.5,.1>*.8]} scale 0.1}
                                                        finish {ambient 0
diffuse 0.5 specular 0.3 roughness 0.01 metallic}
                                                        normal {granite 0.5
scale 0.1}]
 }}




//-------iridescent metal---------
#declare A=seed(123);
#declare m_r=0.3;   // 0.2 or 0.1 maybe is better

#declare t_irid = texture { wrinkles scale 0.1 warp {reset_children}
texture_map {
                          [0 pigment { wrinkles color_map {#declare n=100;
#declare i=0;#while (i<=1) [i rgb
<1+m_r*rand(A)-m_r*rand(A),.93+m_r*rand(A)-m_r*rand(A),.9+m_r*rand(A)-m_r*ra
nd(A)>] #declare i=i+1/n;#end }scale 0.05 }
                           finish {ambient 0 diffuse 0.2 reflection_max 0.7
reflection_min 0.4 reflect_metallic metallic
                                        specular 1 roughness 0.007}
                                        normal {dents 0.35 scale 0.05}]
                          [1 pigment { wrinkles color_map {#declare n=100;
#declare i=0;#while (i<=1) [i rgb
<.915+m_r*rand(A)-m_r*rand(A),.85+m_r*rand(A)-m_r*rand(A),.85+m_r*rand(A)-m_
r*rand(A)>] #declare i=i+1/n;#end }scale 0.05 }
                           finish {ambient 0 diffuse 0.3 reflection_max 0.6
reflection_min 0.3 reflect_metallic metallic
                                        specular .7 roughness 0.02}
                                        normal {dents 0.5 scale 0.01}]} }

#declare t_ring = t_irid


#declare Seed = seed(0);
#declare num = 15;
#declare max_inc=50;

#declare rag = 2;
#while (rag<=10)
#declare num = 2*pi*rag*(15/(4*pi));

union {r_ring (rag,num,major,minor,max_inc,t_ring,Seed) }
#declare rag= rag+1;
#end


sphere {0,1
scale 1
translate 1*y
texture {t_ring} }


box {-1,1
hollow
scale 12
 pigment {color rgb <1, 1, 1>}
 finish { ambient 0 diffuse 0.5 specular 0.2 roughness 0.015 reflection
0.2 }
 }

//end of file


Post a reply to this message

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