/** * pg-20210417 - A try to change the bounds. * pg-20210320 - An old old work rivisited. */ #include "colors.inc" #include "math.inc" #include "shapes.inc" #include "shapes2.inc" /* global_settings { assumed_gamma 1.0 } */ // Parameters --------------------- #declare rad_on=0; #declare transparent_bg=1; // Render with +ua #declare with_spotlights=0; #declare with_text_shadow=0; #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 { location <0.0, 0.3, -2.0> //direction 1.5*z //right x*image_width/image_height look_at <0, 1.4, z_screen> } #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 rgb<0.67, 0.50, 0.32>] //[0.9 rgb<0.17, 0.44, 0.71>] [1.0 rgb<0.94, 0.88, 0.79>] } turbulence 0.75 ramp_wave //scale 0.1 // Too big for high resolutions scale 0.01 } /* finish { ambient rgb <0.17, 0.44, 0.71> } */ } /* #declare t_golden_stone=texture{ pigment { rgb <1, 0.625, 0.275>/2 } finish { brilliance 3 diffuse 0.85 ambient rgb <.22, 0.175, 0.133> reflection <0.25,0.3,0.35> metallic 1 specular 0.20 roughness 1/20 } normal { agate 0.75 scale 0.25 turbulence 0.2 } scale .01 } */ #declare t_golden_stone=texture{ pigment{ granite color_map { /* [0.0 rgb<0.67, 0.50, 0.32>*.8] [0.9 rgb<0.92, 0.49, 0.23>*.8] [1.0 rgb<0.94, 0.88, 0.79>*.8] */ //[0.0 rgb<1.00, 0.45, 0.71>] [0.0 rgb<1.00, 1.00, 1.00>] [0.9 rgb<1.00, 1.00, 1.00>] [1.0 rgb<1.00, 0.00, 1.00>] } turbulence 0.75 ramp_wave //scale 0.1 // Too big for high resolutions scale 0.01 } finish { ambient rgb <.22, 0.175, 0.133> } /* finish { brilliance 3 diffuse 0.85 //ambient rgb <.22, 0.175, 0.133> //reflection <0.25,0.3,0.35> metallic 1 specular 0.20 roughness 1/20 } */ normal { agate 0.75 scale 0.025 turbulence 0.2 } scale .01 } // 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 "AnkeCall.ttf", "85", ttf "John Handy LET Plain1.0.ttf", "85", .1, // depth 0 // spacing rotate <0, 0, 0> translate <-.5, .6, .79> scale 1.2 } //object{the_text texture {pigment{rgb x}}} #declare cubino=box{ <0,0,0> texture {pigment{rgb x}} } #declare show_pebbles=0; // 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; #if(show_pebbles) //#local correction=0.5+rand(R2)*2; object{cubino translate Intersection translate <0,0,-1>} #end #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 // -------------------------------- // The text that causes the shadows #if(with_text_shadow) text { ttf "John Handy LET Plain1.0.ttf", "85", 0.1, // depth 0 // spacing texture {pigment{rgb 0}} translate <-0.5, 0.8, -6> } #end //sphere{<0, 1, .5> .5 texture{pigment{rgb x}}} // Lights ---------------------------------- #if(with_spotlights) light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color spotlight // this kind of light source translate <0, 1, -40> // position of light point_at <0, 1, z_screen> // direction of spotlight radius 1 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 1.5 // intensity falloff radius (outer, in degrees) } light_source { 0*x // light's position (translated below) color rgb <0.8,0.6,0.6> // light's color spotlight // this kind of light source translate <-0.2, 1.2, -40> // position of light point_at <0, 1, z_screen> // direction of spotlight radius 1 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 1.5 // intensity falloff radius (outer, in degrees) } light_source { 0*x // light's position (translated below) color rgb <0.6,0.6,0.8> // light's color spotlight // this kind of light source translate <0.2, 0.8, -40> // position of light point_at <0, 1, z_screen> // direction of spotlight radius 1 // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 1.5 // intensity falloff radius (outer, in degrees) } #else 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> } #end