POV-Ray : Newsgroups : povray.text.scene-files : Crushed Velvet Texture Server Time
1 Nov 2024 15:27:52 EDT (-0400)
  Crushed Velvet Texture (Message 1 to 1 of 1)  
From: Bob Hughes
Subject: Crushed Velvet Texture
Date: 7 Feb 2000 03:27:40
Message: <389e81fc@news.povray.org>
// Persistence of Vision Ray Tracer Include File
// File: cvelvet.inc
// Vers: 3.1
// Desc: An attempt at making a crushed velvet texture
// Date: 98.47
// Auth: Bob Hughes
// Mail: inv### [at] aolcom?Subject=Pov-Scene:

#ifdef (Velvets_Temp)
// do nothing
#else
#declare Velvets_Temp=version
#version 3.1;

/* Velvet definition name is CVelvet so use texture {CVelvet} */

/* Put any or all of these into your pov file

// Color Brightness [ > 0 to 2 ? ]
#declare Vb = 1;
// Velvet Thickness [ 0 to 3 ? ]
#declare Vt = 1.5;
// Velvet Size [ 0 to 6 ? ]
#declare Vs = 1;
// Color Choice [ 1= black, 2= red, 3= green, 4= blue ]
#declare Vc = 2;

*/

// BEGIN VELVET CHOICES

// Color Brightness [ > 0 to 2 ? ]
#ifndef (Vb) #declare Vb = 1; #end
// Velvet Thickness [ 0 to 3 ? ]
#ifndef (Vt) #declare Vt = 1.5; #end
// Velvet Size [ 0 to 6 ? ]
#ifndef (Vs) #declare Vs = 1; #end
// Color Choice [ 1= black, 2= red, 3= green, 4= blue ]
#ifndef (Vc) #declare Vc = 2; #end

// END VELVET CHOICES

// Color Choice
#switch (Vc)
#case (1)
// Black
#declare Cv1 = <.05,.05,.05>;
#declare Cv2 = <.1,.1,.1>;
#declare Cv3 = <.075,.075,.075>;
#declare Cv4 = <.1,.1,.1>;
#declare Cv5 = <.05,.05,.05>;
#declare Cv6 = <.1,.1,.1>;
#declare Cfv1 = rgbf<.05,.05,.05,.4>;
#declare Cfv2 = rgbf<.1,.1,.1,.5>;
#declare Cfv1a = rgbf<.05,.05,.05,.1>;
#declare Cfv1b = rgbf<.1,.1,.1,.05>;
#declare Cfv2a = rgbf<.05,.05,.05,.1>;
#declare Cfv2b = rgbf<.1,.1,.1,.05>;
#break
#case (2)
// Red
#declare Cv1 = <.7,.1,.1>;
#declare Cv2 = <.75,.15,.2>;
#declare Cv3 = <.65,.15,.15>;
#declare Cv4 = <.65,.15,.25>;
#declare Cv5 = <.6,.1,.1>;
#declare Cv6 = <.65,.15,.15>;
#declare Cfv1 = rgbf<.5,.1,.1,.4>;
#declare Cfv2 = rgbf<.55,.1,.15,.5>;
#declare Cfv1a = rgbf<.6,.1,.1,.1>;
#declare Cfv1b = rgbf<.65,.15,.15,.05>;
#declare Cfv2a = rgbf<.6,.1,.1,.1>;
#declare Cfv2b = rgbf<.75,.15,.25,.05>;
#break
#case (3)
// Green
#declare Cv1 = <.1,.5,.2>;
#declare Cv2 = <.1,.65,.25>;
#declare Cv3 = <.1,.5,.3>;
#declare Cv4 = <.2,.6,.2>;
#declare Cv5 = <.1,.7,.1>;
#declare Cv6 = <.15,.65,.25>;
#declare Cfv1 = rgbf<.2,.5,.2,.4>;
#declare Cfv2 = rgbf<.3,.55,.25,.5>;
#declare Cfv1a = rgbf<.2,.6,.3,.1>;
#declare Cfv1b = rgbf<.2,.7,.3,.05>;
#declare Cfv2a = rgbf<.1,.6,.15,.1>;
#declare Cfv2b = rgbf<.15,.65,.2,.05>;
#break
#case (4)
// Blue
#declare Cv1 = <.1,.3,.7>;
#declare Cv2 = <.2,.4,.65>;
#declare Cv3 = <.12,.24,.58>;
#declare Cv4 = <.3,.5,.6>;
#declare Cv5 = <.2,.4,.7>;
#declare Cv6 = <.25,.35,.65>;
#declare Cfv1 = rgbf<.22,.34,.77,.4>;
#declare Cfv2 = rgbf<.35,.45,.75,.5>;
#declare Cfv1a = rgbf<.12,.24,.6,.1>;
#declare Cfv1b = rgbf<.2,.3,.7,.05>;
#declare Cfv2a = rgbf<.12,.24,.6,.1>;
#declare Cfv2b = rgbf<.2,.3,.7,.05>;
#break
#end

// BEGIN VELVET TEXTURE DEFINITION

#declare T1 =
texture {
 pigment { wrinkles frequency .666 color_map {
  [0,1 color rgb Cv1*Vb color rgb Cv2*Vb]
  } sine_wave }
   normal { crackle 10 normal_map {
    [.1 wrinkles 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
    [.3 crackle 8 scallop_wave scale <3,.5,1>*10 rotate <15,30,5>]
    [.9 leopard 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
    } triangle_wave scale <3,.5,1>*5 rotate <15,30,5> }
   finish {ambient .05 diffuse .3
    reflection <.05,.075,.1> crand .013
    brilliance -.25*Vt
   }
}

#declare T2 =
texture {
 pigment { crackle frequency 2 color_map {
  [0,1 color rgb Cv3*Vb color rgb Cv4*Vb]
  } scallop_wave }
   normal { agate 7.5 agate_turb .6 normal_map {
    [.1 wrinkles 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
    [.3 crackle 8 scallop_wave scale <3,.5,1>*10 rotate <15,30,5>]
    [.9 leopard 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
    } scallop_wave scale <3,.5,1>*10 rotate <15,30,5> }
   finish {ambient .05 diffuse .35
    reflection <.05,.075,.1> crand .013
    brilliance -.3*Vt
    }
}

#declare T3 =
texture {
 pigment { granite frequency .5 color_map {
  [0,1 color rgb Cv5*Vb color rgb Cv6*Vb]
  } triangle_wave }
   normal { bozo 5  turbulence .9 normal_map {
    [.1 wrinkles 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
    [.3 crackle 8 scallop_wave scale <3,.5,1>*10 rotate <15,30,5>]
    [.9 leopard 8 triangle_wave scale <3,.5,1>*10 rotate <15,30,5>]
    } sine_wave scale <3,.5,1>*15 rotate <15,30,5> }
   finish {ambient .05 diffuse .4
    reflection <.05,.075,.1> crand .013
    brilliance -.35*Vt
    }
}

#declare Tf =
texture {
 pigment { wrinkles frequency 2 color_map {
  [0,1 color Cfv1*Vb color Cfv2*Vb]
  }  }
   finish {ambient .125 diffuse 1.25
    reflection <.05,.075,.1> crand .013
    brilliance -.75*Vt metallic .6
    }
}
texture {
 pigment { wrinkles frequency 2 color_map {
  [0,1 color Cfv1*Vb color Cfv2*Vb]
  }  }
   finish {ambient .5 diffuse .05
    reflection <.05,.075,.1>*.25 crand .013
    brilliance .125*Vt metallic .3
    }
}

#declare P1 =
pigment { granite color_map {
    [0,1 color Cfv1a*Vb color Cfv1b*Vb]
} }

#declare P2 =
pigment { granite color_map {
    [0,1 color Cfv2a*Vb color Cfv2b*Vb]
} }

#declare Tp1 =
texture {
 pigment { gradient x turbulence .09 frequency .333
  pigment_map {
   [0 P1]
   [1 P2]
  } scallop_wave }
   finish {ambient .125 diffuse .5
    reflection <.05,.075,.1> crand .016
    brilliance .125*Vt
    }
}

#declare Tp2 =
texture {
 pigment { gradient y turbulence .09 frequency .333
  pigment_map {
   [0 P1]
   [1 P2]
  } scallop_wave }
   finish {ambient .125 diffuse .5
    reflection <.05,.075,.1> crand .016
    brilliance .125*Vt
    }
}

#declare Tp3 =
texture {
 pigment { gradient z turbulence .09 frequency .333
  pigment_map {
   [0 P1]
   [1 P2]
  } scallop_wave }
   finish {ambient .125 diffuse .5
    reflection <.05,.075,.1> crand .016
    brilliance .125*Vt
    }
}

//  FINAL VELVET TEXTURE
#declare CVelvet =
 texture { average
  texture_map {
   [1 T1]
   [.75 T2]
   [.875 T3]
   [.75 Tf]
   [.9 Tp1]
   [.9 Tp2]
   [.9 Tp3]
  }
 scale .05*Vs
}

// END VELVET TEXTURE DEFINITION

// test objects

// box {-1,1 texture {CVelvet}
// rotate <clock*180,clock*180,0> translate -1.4*x}

// sphere {0,1.25 texture {CVelvet}
// rotate <clock*180,clock*180,0> translate 1.7*x}

// height_field {tga "test.tga" smooth translate <-.5,0,-.5> scale <5,.5,5>
// texture {CVelvet} rotate <clock*90,clock*90,0> translate 0*x}

#version Velvets_Temp
#end

//  omniVerse http://users.aol.com/persistenceofv/all.htm


Post a reply to this message

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