//============================================================================== // Persistence of Vision Ray Tracer Scene Description File //------------------------------------------------------------------------------ // File : Qrd_2d_19_Diffuser.pov // Version : 3.7 // Description : A 2D quadratic residue diffuser based on the prime number 19 // Date : 11/22/2020 // Author : Robert W. McGregor, www.mcgregorfineart.com // Comments : +w1920 +h1080 +fn16 +a0.25 +am2 +r2 // : [add animation] +kfi1 +kff180 //============================================================================== #include "colors.inc" #include "rand.inc" #include "shapes.inc" #declare Soft_Shadows = 1; #declare Use_IBL = 1; global_settings { assumed_gamma 1 noise_generator 3 radiosity { brightness 1 recursion_limit 3 pretrace_start 0.08 pretrace_end 0.00125 normal on always_sample off } } //------------------------------------------------------------------------------ // Camera //------------------------------------------------------------------------------ #declare Cam_Loc = <0, 0, -22>; #declare Cam_At = <0, 0, 0>; camera { location Cam_Loc look_at Cam_At right x*image_width/image_height angle 30 //rotate y*Interpolate(clock, 0, 1, 90, -90, 1) // for camera animation } //------------------------------------------------------------------------------ // Lights //------------------------------------------------------------------------------ #declare Sunlight = White * 0.9 + Gold * 0.1; // Key Light light_source { <-111, 100, -123>, color Sunlight*7 #if (Soft_Shadows) area_light <15, 0, 0>, <0, 0, 15>, 10, 10 adaptive 0 jitter #end rotate -y*90 } // Some extra brightness & shadow darkness control light_source { Cam_Loc, color Sunlight*1.5 shadowless } // environment lighting #if (Use_IBL) sphere { 0, 100000 hollow inverse pigment { image_map { exr "probe_kitchen2" interpolate 2 map_type 1 }} rotate -y*90 finish { emission 1.5 diffuse 0 } no_image } #end //------------------------------------------------------------------------------ // Diffuser //------------------------------------------------------------------------------ #declare BlockScale = array[19][19] { // block depths, in inches {3.31, 2.50, 0.81, 6.25, 2.94, 6.69, 1.69, 3.75, 5.00, 5.44, 5.00, 3.75, 1.69, 6.69, 2.94, 6.25, 0.81, 2.50, 3.31}, {2.50, 1.69, 0.01, 5.44, 2.06, 5.81, 0.81, 2.94, 4.19, 4.56, 4.19, 2.94, 0.81, 5.81, 2.06, 5.44, 0.01, 1.69, 2.50}, {0.81, 0.01, 6.25, 3.75, 0.44, 4.19, 7.06, 1.25, 2.50, 2.94, 2.50, 1.25, 7.06, 4.19, 0.44, 3.75, 6.25, 0.01, 0.81}, {6.25, 5.44, 3.75, 1.25, 5.81, 1.69, 4.56, 6.69, 0.01, 0.44, 0.01, 6.69, 4.56, 1.69, 5.81, 1.25, 3.75, 5.44, 6.25}, {2.94, 2.06, 0.44, 5.81, 2.50, 6.25, 1.25, 3.31, 4.56, 5.00, 4.56, 3.31, 1.25, 6.25, 2.50, 5.81, 0.44, 2.06, 2.94}, {6.69, 5.81, 4.19, 1.69, 6.25, 2.06, 5.00, 7.06, 0.44, 0.81, 0.44, 7.06, 5.00, 2.06, 6.25, 1.69, 4.19, 5.81, 6.69}, {1.69, 0.81, 7.06, 4.56, 1.25, 5.00, 0.01, 2.06, 3.31, 3.75, 3.31, 2.06, 0.01, 5.00, 1.25, 4.56, 7.06, 0.81, 1.69}, {3.75, 2.94, 1.25, 6.69, 3.31, 7.06, 2.06, 4.19, 5.44, 5.81, 5.44, 4.19, 2.06, 7.06, 3.31, 6.69, 1.25, 2.94, 3.75}, {5.00, 4.19, 2.50, 0.01, 4.56, 0.44, 3.31, 5.44, 6.69, 7.06, 6.69, 5.44, 3.31, 0.44, 4.56, 0.01, 2.50, 4.19, 5.00}, {5.44, 4.56, 2.94, 0.44, 5.00, 0.81, 3.75, 5.81, 7.06, 7.50, 7.06, 5.81, 3.75, 0.81, 5.00, 0.44, 2.94, 4.56, 5.44}, {5.00, 4.19, 2.50, 0.01, 4.56, 0.44, 3.31, 5.44, 6.69, 7.06, 6.69, 5.44, 3.31, 0.44, 4.56, 0.01, 2.50, 4.19, 5.00}, {3.75, 2.94, 1.25, 6.69, 3.31, 7.06, 2.06, 4.19, 5.44, 5.81, 5.44, 4.19, 2.06, 7.06, 3.31, 6.69, 1.25, 2.94, 3.75}, {1.69, 0.81, 7.06, 4.56, 1.25, 5.00, 0.01, 2.06, 3.31, 3.75, 3.31, 2.06, 0.01, 5.00, 1.25, 4.56, 7.06, 0.81, 1.69}, {6.69, 5.81, 4.19, 1.69, 6.25, 2.06, 5.00, 7.06, 0.44, 0.81, 0.44, 7.06, 5.00, 2.06, 6.25, 1.69, 4.19, 5.81, 6.69}, {2.94, 2.06, 0.44, 5.81, 2.50, 6.25, 1.25, 3.31, 4.56, 5.00, 4.56, 3.31, 1.25, 6.25, 2.50, 5.81, 0.44, 2.06, 2.94}, {6.25, 5.44, 3.75, 1.25, 5.81, 1.69, 4.56, 6.69, 0.01, 0.44, 0.01, 6.69, 4.56, 1.69, 5.81, 1.25, 3.75, 5.44, 6.25}, {0.81, 0.01, 6.25, 3.75, 0.44, 4.19, 7.06, 1.25, 2.50, 2.94, 2.50, 1.25, 7.06, 4.19, 0.44, 3.75, 6.25, 0.01, 0.81}, {2.50, 1.69, 0.01, 5.44, 2.06, 5.81, 0.81, 2.94, 4.19, 4.56, 4.19, 2.94, 0.81, 5.81, 2.06, 5.44, 0.01, 1.69, 2.50}, {3.31, 2.50, 0.81, 6.25, 2.94, 6.69, 1.69, 3.75, 5.00, 5.44, 5.00, 3.75, 1.69, 6.69, 2.94, 6.25, 0.81, 2.50, 3.31} } #declare Block = superellipsoid { <0.03, 0.03> scale 0.5 } // Insert your favorite tiling wood textures here #declare P_Wood = pigment { image_map { png "wood/Walnut_Tile_1000x1000" map_type 0 } scale 11 } #declare P_Wood2 = pigment { image_map { png "wood/Knotty_1024x1024px" map_type 0 } scale 11/2 rotate <90, 0, 90> } #declare R = seed(3); #macro BuildDiffuser() #local DistX = 0; #local DistY = 0; #local c = 0; #local r = 0; #local rows = 19; #local cols = 19; union { #while (r < rows) #while (c < cols) #local DistX = DistX + 1; object { Block scale z*BlockScale[r][c] translate material { texture { pigment { average pigment_map { [ 3 srgb<120, 95, 50>/255*RRand(0.5, 1, R) ] [ 2 P_Wood ] [ 1 P_Wood2 rotate RRand(-10, 10, R)] } } finish { reflection {0, 0.066 fresnel on } conserve_energy emission 0.05 } } interior { ior 1.6 } } } #local c = c + 1; #end #local r = r + 1; #local DistX = 0; #local DistY = DistY + 1; #local c = 0; #end } #end #declare Diffuser1 = BuildDiffuser(); #declare Diffuser2 = BuildDiffuser(); #declare Diffusers = Center_Object( union { object { Diffuser1 } object { Diffuser2 translate x*19 } }, x+y) //------------------------------------------------------------------------------ // Main Scene //------------------------------------------------------------------------------ #declare C_StudioTaupe = srgb<165, 151, 138>/255*0.7; // from the Behr paint color in my studio plane { z, 0 pigment { C_StudioTaupe } finish { diffuse 0.7 } } object { Diffusers scale 0.2 }