/* Persistence of Vision Ray Tracer Scene Description File Demo scene showing usage of CIE.inc and LightsysIV for space scenes. Creates a starfield with colors of known kelvin temperatures, the moon with ASTER lunar samples, and a realistic extraterrestrial sun color. Jaime Vives Piqueres, Apr-2003. */ #version 3.5; global_settings{ assumed_gamma 1.0 max_trace_level 16 } #default{texture{finish{ambient 0}}} #include "functions.inc" // Standard pre-defined colors // #include "colors.inc" // *** CIE & LIGHTSYS *** #include "CIE.inc" CIE_ChromaticAdaption(off) // recommended for photograpic effects //#declare Space_ColSys=NTSC_ColSys; //#declare Space_ColSys=SMPTE_ColSys; #declare Space_ColSys=sRGB_ColSys; CIE_ColorSystem(Space_ColSys) #include "lightsys.inc" #include "espd_sun.inc" // predefined illuminants #include "rspd_lunar.inc" // predefined material samples #include "rspd_jvp.inc" // Assorted homemade spectral samples by Jaime Vives Piqueres #include "rspd_aster.inc" // Reproduced from the ASTER Spectral Library //#include "shapesq.inc" // *** UNIVERSE DATA *** #declare universe=2000; // universe shell dimension #declare vision=180; // 12; // angle of starfield section #declare use_stars=1; #declare star_type=0; // 0=round, 1=spiky #declare star_size=14; #declare r_s=seed(13); // stars random seed #declare num_stars=10000; #declare use_moon=1; #declare r_sun=seed(18); // sun position random seed #declare Modelling=off; // *** STARFIELD *** #if (use_stars) // using starfield macro to generate some background stars #include "demo_starfield.inc" object{ Starfield(universe,vision,num_stars,star_type,star_size,r_s) } #end // *** MOON *** #if (use_moon) // moon texture #declare t_moon= texture{ pigment{ onion warp { turbulence 0.1 /*lambda 33 */ } color_map{ [0 rgb ReflectiveSpectrum(RS_Grass1)] [0.8 rgb ReflectiveSpectrum(RS_RiverStone1)] [.95 rgb ReflectiveSpectrum(RS_Grass2)] [1 rgb ReflectiveSpectrum(RS_GreenAchmea3)] //[1.0 rgb ReflectiveSpectrum(RS_Grass1)] } } } // Cloud texture #declare t_clouds= texture{ pigment{ granite scale <70,50,70> turbulence .3 lambda 4 color_map{ [.4 rgb ReflectiveSpectrum(RS_Fine_Snow) transmit 1] [.9 rgb ReflectiveSpectrum(RS_Fine_Snow) transmit .5 ] [1.0 rgb ReflectiveSpectrum(RS_Fine_Snow) transmit 0] } } } // Planet #declare Planet= union{ isosurface{ function{(x*x+y*y+z*z-1)+f_granite(x*2,y*2,z*2)*f_agate(x,y,z)*.05} max_gradient 3.8 contained_by{sphere{0,1}} texture{t_moon scale .02} } // flat circular FINITE (no CSG) shape, center hole cutout is optional disc { <0, 0, 0> // center position y, // normal vector 1.0, // outer radius .7 // optional hole radius pigment{spherical colour_map{ [.01 rgb 0 transmit 1] [.04 rgb ReferenceRGB(<.4,.3,.2>) transmit 0] [.09 rgb ReferenceRGB(<.2,.21,.3>) transmit 1] [.12 rgb ReferenceRGB(<.22,.2,.21>) transmit 0] [.17 rgb ReferenceRGB(<.3,.21,.2>) transmit 1] [.23 rgb ReferenceRGB(<.1,.2,.3>) transmit 0] [.29 rgb 0 transmit 1] } } scale 2 hollow //double_illuminate rotate <-5,0,0> } #if(!Modelling) sphere{0,1 // water pigment{rgb ReferenceRGB(<.03,.15,.3>) transmit .3 } finish{specular .2 metallic reflection{0,.1 metallic}} interior{fade_distance .003 fade_color rgb ReferenceRGB(<0,.05,.2>)} scale .996 } sphere{0,1 // clouds texture{t_clouds scale .02} interior{ior 1.01 // general media statement // put in interior or in scene file for atmospheric media media { // (---general values---) intervals 10 // number of intervals used for sampling [10] samples 1,1 // minimum and maximum number of samples taken per interval [1,1] confidence 0.9 // statistic parameter higher->better quality [0.9] variance 1.0/128 // statistic parameter lower->better quality [1.0/128] ratio 0.9 // distribution between lit and unlit areas [0.9] // (---media types---) absorption rgb<.1,.05,0>*.001 // absorbing media, block light of specified color //emission rgb<0,1,0> // emitting media, emit light of specified color scattering { // scattering media 2, // scattering type 1=isotropic; 2=Mie haze; 3=Mie murky // 4=Rayleigh; 5=Henyey-Greenstein rgb<0,.1,.2> // color //eccentricity 0.25 // eccentricity for type 5 [0.0] //extinction 1.0 // for balancing amount of absorption [1.0] } // (---method---) //method 1 // old Povray 3.1 method //method 2 // new method with even distribution method 3 // adaptive sampling //aa_threshold 0.1 // accuracy threshold for method 3 [0.1] //aa_level 4 // maximum recursion depth for method 3 [4] //jitter 0.5 // randomness for method 2&3 // (---density---) density { spherical // any pattern //color_map {...} // color_map //density_map {[0 rgb 1][.1 rgb 0]} // or alternatively density_map } // translate etc. } } scale 1.05 hollow double_illuminate }#end } // placement object{Planet scale 30 translate <0,0,100>} light_source{ 0 Light_Color(EmissiveSpectrum(ES_Sun),2000000000) Light_Fading() translate 10e4*x rotate <0,0,25> //rotate 360*rand(r_sun)*x //rotate 360*rand(r_sun)*y } #end // Planet // Agnesi quartic {< 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0.04, 0, 0, 0, 0, 0.04> // material {} is a wrapper for interior and texture // you can declare it like texture and interior too // Note that it has nothing to do with material_map texture { checker texture { pigment {spiral1 2 translate .5 turbulence 1 // double spiral that winds around the y-axis pigment_map{ [.2 colour rgb ReferenceRGB(<0,0,0>) transmit .5] [1 granite scale .1 colour_map { [.5 rgb ReferenceRGB(<0,0,0>) transmit .5] [.7 rgb ReferenceRGB(<0,.2,.5>) transmit .5] [1 rgb ReferenceRGB(<1,1,1>) transmit .5] }] } } finish { specular 1 roughness 0.02 reflection 1// {0,0.25} } } // texture texture { pigment { granite scale .3 colour_map { [.9 rgb ReferenceRGB(<0,0,0>) transmit 1] [1 rgb ReferenceRGB(<1,1,1>) transmit .5] } } finish { specular 1 roughness 0.02 reflection 1 //{0, .25} } } scale .4 } //} // texture scale 100 translate 100*z hollow double_illuminate } camera{ location <0,200,-300>*.8 direction z*3 look_at <0,-30,100> }