#version 3.5; #include "colors.inc" #include "functions.inc" global_settings { assumed_gamma 1.0 max_trace_level 20 } #declare usearealight = no; #declare usehighqualityarealight = yes; #declare usemedia = yes; #declare usefog = yes; #declare light_pos = <0, 2.17, 0>; #declare light_col = <1.5,1,1>; #macro paddedWall (X,Y) merge { #declare J=1; #while (J<=Y) #declare I =1; #while(I<=X) sphere {,1} sphere {,.1} sphere {,.1} #declare I=I+1; #end #declare J=J+1; #end pigment {color rgb <.3,.3,.3>} } #end #declare Wall = object {paddedWall (12,10) scale .5 } #declare bulb = sphere { <0, 0, 0> // center of sphere 0.08 // radius of sphere pigment { rgb light_col } finish {ambient 1 diffuse 0} } // ---------------------------------------- Camera & Lights camera { ultra_wide_angle location <-0.5, 0.2, -2> //+ y*2 //location y*2.8 look_at light_pos - y*1//*2 angle 120 } light_source { light_pos // light's position (translated below) color rgb light_col // light's color looks_like { bulb } #if (usearealight) area_light x*.08,y*.08, #if (usehighqualityarealight) 17,17 adaptive 2 #else 5,5 adaptive 1 #end circular orient #end } // ---------------------------------------- Floor plane { y,.05 /*pigment { checker pigment {White} pigment {Black} translate x*-.5 scale .8 }*/ texture { pigment { bozo color_map { [0 rgb <.2,.3,.2>] [.33 rgb <.12,.12,.12>] [.67 rgb <.15,.17,.15>] [1 rgb <.25,.25,.25>] } warp { turbulence .4 octaves 3 lambda 3 omega .7 } scale .3 } normal { dents 1 scale .3 } /*finish { reflection 1 }*/ } } // ---------------------------------------- Ceiling box { <-3, 3, -5> // one corner position < 3, 4, 5> // other corner position pigment {rgb <.8,.9,.8>} texture { pigment {color rgb <0.9, 0.9, 0.9>} finish{ ambient 0 } scale 3 } } // ---------------------------------------- Back Wall object {Wall translate <-2.5,-2.25,3>} // ---------------------------------------- Left Wall object {Wall rotate y*90 translate <-2.5,-2.25, 3.25>} // ---------------------------------------- Right Wall object {Wall rotate y*90 translate < 2.5,-2.25, 3.25>} // ---------------------------------------- Front Wall (behind camera) object {Wall translate <-2.5,-2.25, -3>} // ---------------------------------------- Cable /*cylinder { <0,3,0>, <0,2.25,0>, .01 pigment {Black} }*/ sphere_sweep { cubic_spline 6, <.01,3.4,-.03>, .01, <0,3,0>, .01, <-.01,2.75,.04>, .01 <.06,2.5,-.005>, .01 <0,2.25,0>, .01 <0,2.2,.03>, .01 no_shadow } #declare cordshadow = disc { // fake blurred shadow from cord 0,y,1 pigment { spherical color_map { [0 rgbt <0,0,0,1>] [1 rgbt <0,0,0,.35>] } cubic_wave warp { turbulence .2 octaves 4 omega .4 lambda 3 } scale .5 } hollow no_shadow } /* // transparent objects in fog cause shadows. It's a bug. So i turn off their shadows and use the actual objects real close to the ceiling. object { cordshadow scale 3 translate 2.998*y } object { cordshadow scale .7 translate 2.999*y }*/ // ---------------------------------------- Light emission #if (usemedia) intersection { sphere { 0,1 } #declare scaleamnt = 2; plane { y,(3-light_pos.y)/scaleamnt-.002 // avoids sphere intersection with ceiling, which appears to be buggy causing a shadow because of the absorption, regardless of the no_shadow. } pigment {rgbt 1} interior { media { // simulate scattering media by using emission and black fog #declare meddensity = .5; emission meddensity * light_col method 3 samples 100,100 density { spherical cubic_wave } density { #declare basespherefunc = function (x,y,z,a) {f_noise3d(x*a,y*a,z*a)}; function {basespherefunc(x,y,z,4/sqrt(x*x+y*y+z*z))} cubic_wave } } } hollow no_shadow scale scaleamnt translate light_pos } #end #if (usefog) fog { distance 2 color rgb 0 } #end