#include "functions.inc" // Debug / render settings #declare C_GRID = 0; #declare C_CLIGHT = 0; #declare C_RAD = 1; // Scene settings #declare C_FLOOR = 1; #declare C_WHITECHESS = 1; #declare C_BLACKCHESS = 1; #declare C_SPOTLIGHT = 1; // radiosity (global illumination) settings global_settings { #if (C_RAD) radiosity { pretrace_start 0.04 // start pretrace at this size pretrace_end 0.02 // end pretrace at this size count 100 // higher -> higher quality (1..1600) [35] nearest_count 7 // higher -> higher quality (1..10) [5] error_bound 1.8 // higher -> smoother, less accurate [1.8] recursion_limit 1 // 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 } #end } #declare C_LOC = <-10, 5.0, 0.0>; // perspective (default) camera camera { location C_LOC look_at <0.0, 1.0, 0.0> // right 2*x angle 40 } #if (C_CLIGHT) light_source { C_LOC, 1 } #end #if (C_SPOTLIGHT) light_source { <3.5, 10, 0>, 1 spotlight point_at <3.5, 0, 0> radius 10 falloff 30 area_light <0.5, 0, 0>, <0, 0, 0.5>, 5, 5 adaptive 2 circular fade_power 2 } #else light_source { <3.5, 10, 0>, 1 } #end #if (C_GRID) cylinder { 0*x, 1*x, 0.01 pigment { color rgb <1, 0, 0> } } cylinder { 0*y, 1*y, 0.01 pigment { color rgb <0, 1, 0> } } cylinder { 0*z, 1*z, 0.01 pigment { color rgb <0, 0, 1> } } #end #include "chess_set.inc" #declare T_White = texture { pigment { color rgb 1.0 } finish { diffuse 1.0 ambient 0.0 } } #declare S = seed(0); #declare T_Black = texture { pigment { rgb 0.2 } // normal { bumps 0.04 scale 0.001 } finish { diffuse 1.0 ambient 0.0 reflection 0.6 } } #if (C_BLACKCHESS) #local i = 0; #while (i < 8) object { O_Pawn translate <6, 0, -3.5 + i> texture { T_Black } } #local i = i + 1; #end object { O_Rook translate <7, 0, 3.5> texture { T_Black } } object { O_Rook translate <7, 0, -3.5> texture { T_Black } } object { O_Knight rotate y*180 translate <7, 0, 2.5> texture { T_Black } } object { O_Knight rotate y*180 translate <7, 0, -2.5> texture { T_Black } } object { O_Bishop translate <7, 0, 1.5> texture { T_Black } } object { O_Bishop translate <7, 0, -1.5> texture { T_Black } } object { O_Queen rotate y*180 translate <7, 0, 0.5> texture { T_Black } } object { O_King rotate y*180 translate <7, 0, -0.5> texture { T_Black } } #end #if (C_WHITECHESS) #local i = 0; #while (i < 8) object { O_Pawn translate <1, 0, -3.5 + i> texture { T_White } } #local i = i + 1; #end object { O_Rook translate <0, 0, 3.5> texture { T_White } } object { O_Rook translate <0, 0, -3.5> texture { T_White } } object { O_Knight translate <0, 0, 2.5> texture { T_White } } object { O_Knight translate <0, 0, -2.5> texture { T_White } } object { O_Bishop translate <0, 0, 1.5> texture { T_White } } object { O_Bishop translate <0, 0, -1.5> texture { T_White } } object { O_Queen translate <0, 0, 0.5> texture { T_White } } object { O_King translate <0, 0, -0.5> texture { T_White } } #end #local xmin = 0.0; #local xmax = 7.1; #local xstep = 1.0; #local zmin = -3.5; #local zmax = 3.6; #local zstep = 1.0; #local col = 1; #local swapcol = 1; #if (C_FLOOR) #local zinc = zmin; #while (zinc < zmax) #local xinc = xmin; #while (xinc < xmax) superellipsoid { <0.2, 0.2> scale <0.49, 0.1, 0.49> translate #if (col) #local col = 0; texture { T_White } #else #local col = 1; texture { T_Black } #end } #local xinc = xinc + xstep; #end #local zinc = zinc + zstep; #if (swapcol) // Swap colors for new row? #if (col) #local col = 0; #else #local col = 1; #end #end #end #end