// Persistence of Vision Ray Tracer Scene Description File // File: Object_pattern_var_test.pov // Vers: 3.8 // Desc: Different type variations of object_pattern uses // Date: October 2019 // Auth: Thomas de Groot // +w640 +h640 +am2 +a0.3 +bm2 +bs8 +wt8 #version 3.8; global_settings { assumed_gamma 1.0 radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.004 // end pretrace at this size count 100, 1000 // higher -> higher quality (1..1600) [35] nearest_count 10, 5 // higher -> higher quality (1..10) [5] error_bound 1 // higher -> smoother, less accurate [1.8] recursion_limit 1 // how much interreflections are calculated (1..5+) [3] low_error_factor .3 // reduce error_bound during last pretrace step gray_threshold 0.0 // increase for weakening colors (0..1) [0] minimum_reuse 0.015 // reuse of old radiosity samples [0.015] maximum_reuse 0.1 // new parameter 3.7 [0.2] brightness 1 // brightness of radiosity effects (0..1) [1] adc_bailout 0.01/2 normal on // take surface normals into account [off] media off // take media into account [off] always_sample off // turn sampling in final trace off [on] //max_sample 1.0 // maximum brightness of samples } } #include "colors.inc" //====================================================================== //some usual scene elements: camera { location <0, 0, -15> right x*image_width/image_height look_at <0, 0, 0> angle 70 } light_source {<0, 8, -4>*100 White*1} background {srgb <0.5, 0.5, 0.5>} //====================================================================== //The objects used for the patterns: // Wind Rose 1: #local Point1 = cone {<0, 0, 0>, 0.25, <0, 0, 1>, 0} #local Rose1 = union { #for (I, 0, 270, 90) object {Point1 rotate <0, I, 0>} #end scale 1 } // Wind Rose 2: #local Point2 = cone {<0, 0, 0>, 0.25, <0, 0, 0.75>, 0} #local Rose2 = union { #for (I, 0, 270, 90) object {Point2 rotate <0, I, 0>} #end scale 1 rotate 45*y } // Wind Rose 3; combination of Rose 1 & Rose2: #local Rose3 = union { object {Rose1} object {Rose2} } //====================================================================== // List of different pigments and textures: #local P_Star1 = pigment { cylindrical pigment_map { [0.3 rgb <0.0, 1.0, 1.0>] [1.0 rgb <1.0, 1.0, 0.0>] } scale 1 } #local P_Star2 = pigment { radial pigment_map { [0.4 rgb <0.0, 0.5, 1.0>] [0.6 rgb <1.0, 0.0, 0.0>] } frequency 50 scale 1 } //------------------------------------------ #local P_Rose1 = pigment { object {Rose1 // create a solid pattern based on an object shape pigment {rgbt 1} // outside object pigment {P_Star1} // inside object } } #local P_Rose2 = pigment { object {Rose2 // create a solid pattern based on an object shape pigment {rgbt 1} // outside object pigment {P_Star2} // inside object } } //------------------------------------------ #local T_Rose1 = texture { pigment { object {Rose1 // create a solid pattern based on an object shape //rgbt 1 // outside object //rgb <1, 1, 0> // inside object //or: pigment {rgbt 1} // outside object pigment {P_Star1} // inside object } } normal {ripples 2.0 scale 0.025} finish {diffuse 0.8 specular 0.25 roughness 0.001} } #local T_Rose2 = texture { pigment { object {Rose2 //rgbt 1 // outside object //rgb <0, 1, 0> // inside object //or: pigment {rgbt 1} // outside object pigment {P_Star2} // inside object } } normal {radial 1.0 frequency 50 } finish {diffuse 0.8 specular 0.25 roughness 0.001} } #local T_Rose3 = texture { pigment { object {Rose3 pigment {rgbt 1} // outside object pigment {P_Star1} // inside object } } normal {ripples 2.0 scale 0.025} finish {diffuse 0.8 specular 0.25 roughness 0.001} } //------------------------------------------Cannot be layered but can be used individually #local T_Rose1_alt = texture { object {Rose1 // create a solid pattern based on an object shape texture {pigment {rgbt 1}} // outside object texture {pigment {P_Star1}} // inside object } } #local T_Rose2_alt = texture { object {Rose2 // create a solid pattern based on an object shape texture {pigment {rgbt 1}} // outside object texture {pigment {P_Star2}} // inside object } } //------------------------------------------If using pigment_pattern #local P_Pattern1 = pigment { object {Rose1 // create a solid pattern based on an object shape rgbt <1, 1, 1, 1> // outside object rgb <1, 1, 0> // inside object } } #local P_Pattern2 = pigment { object {Rose2 // create a solid pattern based on an object shape rgbt <1, 1, 1, 1> // outside object rgb <0, 1, 0> // inside object } } #local T_Pattern1 = texture { pigment { pigment_pattern { onion scale 0.025 } pigment_map { [0.5 P_Pattern2] [0.5 P_Pattern1] } } } //------------------------------- #local T_Pattern2 = texture { pigment { pigment_pattern { object {Rose2 rgbt <1,1,1,1> // outside object rgbt <1,1,1,0> // inside object } } pigment_map { //[0.0 rgbt 1] [1.0 P_Rose2] } } normal {radial 1.0 frequency 50 } finish {diffuse 0.8 specular 0.25 roughness 0.001} } texture { pigment { pigment_pattern { object {Rose1 rgbt <1,1,1,1> // outside object rgbt <1,1,1,0> // inside object } } pigment_map { //[0.0 rgbt 1] [1.0 P_Rose1] } } normal {ripples 2.0 scale 0.025} finish {diffuse 0.8 specular 0.25 roughness 0.001} } //------------------------------------------ // Background texture: #local T_earth = texture { pigment { onion pigment_map { [0.5 srgb <0.635, 0.438, 0.302>] [0.5 srgb <0.635, 0.438, 0.302>*0.8] } scale 0.25 } normal {granite 1.0 scale 0.001} finish {diffuse 0.8 specular 0.25 roughness 0.001} } //====================================================================== // the patterns in use: #local Cylinder = cylinder {<0.0, -0.5, 0.0>, <0.0, 0.0, 0.0>, 1} //------------------------------------------Upper left #local T_Rose_pattern0 = texture {T_earth} texture {T_Rose3} object {Cylinder texture {T_Rose_pattern0} scale <4.5, 1.0, 4.5> rotate -90*x translate <-5.0, 5.0, 0.0> } //------------------------------------------result identical to pattern2 /*#local T_Rose_pattern1 = texture {T_earth} texture {pigment {P_Rose2} normal {ripples 2.0 scale 0.025} finish {diffuse 0.8 specular 0.25 roughness 0.001}} texture {pigment {P_Rose1} normal {ripples 2.0 scale 0.025} finish {diffuse 0.8 specular 0.25 roughness 0.001}} object {Cylinder texture {T_Rose_pattern1} scale <4.5, 1.0, 4.5> rotate -90*x translate <-5.0, 5.0, 0.0> }*/ //------------------------------------------result identical to pattern1; Upper right #local T_Rose_pattern2 = texture {T_earth} texture {T_Rose2} texture {T_Rose1} object {Cylinder texture {T_Rose_pattern2} scale <4.5, 1.0, 4.5> rotate -90*x translate <5.0, 5.0, 0.0> } //------------------------------------------Lower left #local T_Rose_pattern3 = texture {T_earth} texture {T_Pattern1} object {Cylinder texture {T_Rose_pattern3} scale <4.5, 1.0, 4.5> rotate -90*x translate <-5.0, -5.0, 0.0> } //------------------------------------------Lower right #local T_Rose_pattern4 = texture {T_earth} texture {T_Pattern2} object {Cylinder texture {T_Rose_pattern4} scale <4.5, 1.0, 4.5> rotate -90*x translate <5.0, -5.0, 0.0> } //======================================================================