/** * Happy 30 years, POV! * * Render with +ua * * pg-20211231 - An old old work rivisited. */ #version 3.7; #include "colors.inc" #include "math.inc" #include "shapes.inc" #include "shapes2.inc" #include "logo.inc" // Parameters ------------------------------ #declare rad_on=0; #declare transparent_bg=1; #local z_screen=2; // ----------------------------------------- // Global settings ------------------------- global_settings { adc_bailout 0.003922 ambient_light <1.0,1.0,1.0> assumed_gamma 1.9 hf_gray_16 off irid_wavelength <0.247059,0.176471,0.137255> max_intersections 64 max_trace_level 10 number_of_waves 10 noise_generator 2 charset ascii #if(rad_on) radiosity { pretrace_start 0.08 // start pretrace at this size pretrace_end 0.04 // end pretrace at this size count 35 // higher -> higher quality (1..1600) [35] nearest_count 5 // higher -> higher quality (1..10) [5] error_bound 1.8 // higher -> smoother, less accurate [1.8] recursion_limit 3 // how much interreflections are calculated (1..5+) [3] low_error_factor .5 // 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] brightness 1 // brightness of radiosity effects (0..1) [1] adc_bailout 0.01/2 //normal on // take surface normals into account [off] //media on // take media into account [off] //save_file "file_name" // save radiosity data //load_file "file_name" // load saved radiosity data //always_sample off // turn sampling in final trace off [on] //max_sample 1.0 // maximum brightness of samples } #end } // ----------------------------------------- // Camera ---------------------------------- camera { location <0.0, 0.3, -2.0> //direction 1.5*z //right x*image_width/image_height look_at <0, 1.4, z_screen> } // Lights ---------------------------------- light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color parallel point_at <0, 1, z_screen> translate <-20, 40, -20> } // Background ------------------------------ #if(transparent_bg) background {colour srgbt <0.0, 0.0, 0.0, 1.0>} #else sky_sphere { pigment { gradient y color_map { [0.0 rgb <0.6,0.7,1.0>] [0.7 rgb <0.0,0.1,0.8>] } } } #end // Textures ---------------------------------------------------- #declare t_stone=texture{ pigment{ granite color_map { [0.0 SkyBlue] [1.0 SlateBlue] } } finish { specular .5 } } #declare t_golden_stone=texture{ pigment{ rgb <1,.7,.3> } finish { specular .5 } } #declare t_sphere=texture{ pigment{ color Gray } finish{ reflection 1 } } #declare t_cloud=texture{ pigment{ rgb <1,.7,.2> } finish { specular .5 reflection 1 } } // Background -------------------------------------------------- #declare from_wall=<-2,-0.5,z_screen>; #declare to_wall=<2,2.5,z_screen+0.2>; #if(! transparent_bg) box{from_wall to_wall texture{t_stone} translate <0,0,-1> } #end // Stone parameters -------------------------------------------- #declare stone_base_size=0.02; // Metric #declare max_stone_grid_x=5; // Maximum stone x size to be multiplied for stone_base_size #declare max_stone_grid_y=4; // Maximum stone y size to be multiplied for stone_base_size #declare wall_grid_cols=int((to_wall.x-from_wall.x)/stone_base_size); #declare wall_grid_rows=int((to_wall.y-from_wall.y)/stone_base_size); #declare R1 = seed(5); // Random seed // Reference text ---------------------------------------------- #declare the_text=text { ttf "Ubuntu-Regular.ttf", "30", .1, // depth 0 // spacing rotate <0, 0, 0> translate <-.5, .6, .79> scale 1.2 } // Raise array generation -------------------------- #declare MinT=min_extent(the_text); #declare MaxT=max_extent(the_text); #declare Normal=<0,0,0>; #declare xMax=ceil((MaxT.x-MinT.x)/stone_base_size); #declare yMax=ceil((MaxT.y-MinT.y)/stone_base_size); #declare raise_array=array[xMax][yMax]; #local xT=0; //MinT.x #while(xT, z, Normal); #if(vlength(Normal) > 0) #declare raise_array[xT][yT]=1; #else #declare raise_array[xT][yT]=0; #end #local yT=yT+1; #end #local xT=xT+1; #end // Ignore boxes outside a circle #declare c_circle=<(MaxT.x+MinT.x)/2,(MaxT.y+MinT.y)/2,0>; #declare r_circle=max((MaxT.x-MinT.x),(MaxT.y-MinT.y))*.45; // A simple wall generator ------------------------------------- #declare curr_max_space=0; // Support macro #macro update_curr_max_space_in_wall(arr,row,curr_col,max_col) #declare curr_max_space=0; #local i=curr_col; #while(i=MinT.x & stone_x_from<=MaxT.x & stone_y_from>=MinT.y & stone_y_from<=MaxT.y) #local array_index_x_from=floor((stone_x_from-MinT.x)/stone_base_size); //test also ceil #local array_index_x_to=min(array_index_x_from+stone_x,xMax-1); #local array_index_y_from=floor((stone_y_from-MinT.y)/stone_base_size); #local array_index_y_to=min(array_index_y_from+stone_y,yMax-1); #local xT=array_index_x_from; #while(xT<=array_index_x_to) #local yT=array_index_y_from; #while(yT<=array_index_y_to) #if(raise_array[xT][yT]=1) #local stone_z=2; //5; #local t_texture=t_golden_stone; #local xT=array_index_x_to; #break #end #local yT=yT+1; #end #local xT=xT+1; #end #end //3.ter If inside a circle centered at the text center #local place_stone=0; #local curr_box_position=; #if(sqrt(pow((curr_box_position.x-c_circle.x)/2,2)+pow((curr_box_position.y-c_circle.y)/2,2))<=r_circle) #local place_stone=1; #end //4. Update array #local ax=curr_col; #while(ax,, stone_base_size/5, 0) scale translate curr_box_position texture{t_texture}} #end //6. Update counter #local curr_col=curr_col+stone_x; #end #end #local curr_row=curr_row+1; #end // ---------------------------------------- // A reflective sphere.... ---------------- sphere{<0,3,0.5> 2 texture{t_sphere}} // A familiar object ---------------------- //sphere{<.5,-3,-1.8> 1 texture{pigment{color Red}}} object { Povray_Logo texture {t_cloud} rotate <-40,0,0> translate <.5,-2.5,-1.7> double_illuminate }