/*

NOTES:
Standard scale: 1 unit=1 inch
Remember any included files (grass image map for the plane, and possibly others)
Set max_trace lower if renders are too slow
Photons do not greatly help my included Water texture in most situations, but
turning them on for it causes the scene to render slowly
*/

//File Setup
global_settings {ambient_light rgb .2 max_trace_level 30 photons{count 20000}}
#include "textures.inc"
#include "colors.inc"
#include "stones.inc"
#include "metals.inc"
#include "finish.inc"
#include "glass.inc"
#include "golds.inc"
#include "woods.inc"
//Camera Setup
#declare make_3d_scene=0; //0 - normal view, 1 - panorama
#declare camera_translate= <-1,12,-25>;
#declare camera_rotate= <22,0,0>;
#declare debug_translate=0;
#if (make_3d_scene)
#if (debug_translate)
#error "DEBUG_TRANSLATE should equal 0"
#end
#declare frameArray = array[6] {z,x,-z,-x,y,-y}
camera {spherical location 0 translate camera_translate}
#else
camera { location 0 translate debug_translate rotate camera_rotate right x*image_width/image_height
up y translate camera_translate}
#end

//Scene

//Declares

//Textures

#declare Water = material{texture{pigment{Sapphire_Agate transmit .99}finish{ reflection{.15}}} interior{ior 1.01}}
#declare Glass = material{texture{pigment{Sapphire_Agate transmit .96}finish{diffuse 0 ambient 0 reflection{.12}
phong 1.5 phong_size 250} } interior{ior 1.6}}
//#declare Glass = material{texture{pigment{Sapphire_Agate}}} //for fast renders

#declare Aluminum = texture{pigment{Gray95}finish{ambient .1 diffuse .7 specular 1
roughness .001 metallic reflection {.1 metallic}}}

//Declare Objects

#declare WaterGlass = merge{
difference{
cone {0, 1.5, 5*y, 2}
cone {y*.4, 1.3, 5.1*y, 1.8} }
torus{1.9,.1 translate y*5}
material{Glass} photons{target reflection on refraction on}}

#declare WineGlass = merge{ //MUST use anti-aliasing to de-fringe certain CSG interactions in this object
merge{
difference{
difference{
merge{
sphere{y*4,2}
difference{
sphere{0,2 scale <1,1.45,1> translate y*4}
box{<-2.1,4,-2.1>,<2.1,6.2,2.1> inverse} } }
merge{
sphere{y*4,2}
difference{
sphere{0,2 scale <1,1.45,1> translate y*4}
box{<-2.1,4,-2.1>,<2.1,6.2,2.1> inverse} }
scale .95 translate y*.2 } }
box{<-2,6.05,-2>,<2,6.5,2>} }
difference{
torus{1.34,.07 translate y*6.05 }
box{<-2,6.0499,-2>,<2,5.5,2>} } translate y*2}
difference{
blob{
threshold .65
cylinder {y*.5,y*4,.4,1}
sphere {y*3.8,2,.4}
sphere {y*4.3,2,.2}
sphere {y*-.5,6,.8 scale <1,.3,1>}
}
sphere{y*6,1.99}
box{<-7,0,-7>,<7,-5,7>}
sphere{0,1.6 translate y*-.5 scale <1,.2,1>} }
material{Glass} photons{target reflection on refraction on}}

//Background Objects
light_source {<-4,10,-15> color rgb .45 area_light <5, 0, 0>, <0, 5, 0>, 5, 5 adaptive 1
jitter parallel point_at <0, 2, 0>}
light_source {<-4,10,-15> color rgb .15 area_light <3, 0, 0>, <0, 3, 0>, 3, 3 adaptive 1
jitter spotlight radius 6 falloff 28 tightness 25 parallel point_at <0, 2, 0>}
light_source {<-12, 15, -15> color rgb <.1,0,0>
area_light <2, 0, 0>, <0, 2, 0>, 2, 2 adaptive 1 jitter //spotlight radius 12 falloff 14 tightness 10
parallel point_at <0, 2, 0>}
light_source {<-8, 15, -15> color rgb <0,.1,0>
area_light <2, 0, 0>, <0, 2, 0>, 2, 2 adaptive 1 jitter //spotlight radius 12 falloff 14 tightness 10
parallel point_at <0, 2, 0>}
light_source {<-4, 15, -15> color rgb <0,0,.1>
area_light <2, 0, 0>, <0, 2, 0>, 2, 2 adaptive 1 jitter //spotlight radius 12 falloff 14 tightness 10
parallel point_at <0, 2, 0>}
light_source {<8, 12, -15> color rgb <.1,0,0>
area_light <2, 0, 0>, <0, 2, 0>, 2, 2 adaptive 1 jitter //spotlight radius 12 falloff 14 tightness 10
parallel point_at <0, 2, 0>}
light_source {<10, 12, -15> color rgb <0,.1,0>
area_light <2, 0, 0>, <0, 2, 0>, 2, 2 adaptive 1 jitter //spotlight radius 12 falloff 14 tightness 10
parallel point_at <0, 2, 0>}
light_source {<16, 12, -15> color rgb <0,0,.1>
area_light <2, 0, 0>, <0, 2, 0>, 2, 2 adaptive 1 jitter //spotlight radius 12 falloff 14 tightness 10
parallel point_at <0, 2, 0>}
//light_source {<0,80,0> color rgb .1 shadowless}
//light_source {<-20,20,20> color rgb .06 shadowless}
//light_source {<-20,20,-20> color rgb .06 shadowless}
//light_source {<20,20,-20> color rgb .06 shadowless}
//light_source {<20,20,20> color rgb .06 shadowless}
//light_source {<-1,12,-25> color rgb .08 shadowless}

box {<-100,-50,-100>,<200,150,200> pigment{color rgb <.87, .8, .7>} finish{diffuse .5} rotate y*85}
//sky_sphere {//pigment {Apocalypse turbulence 1.5}} //Apocalypse--self-explanatory
// pigment {gradient y color_map {[0 color 0][1 color <0,.2,.8>]} scale 2 translate -y} //normal "sky" texture
// pigment {bozo turbulence 2 color_map{[.1 rgbt <.2,.2,.2,0>] [.5 rgbt <.2,.2,.2,1>]} scale 2 translate -y}}
//plane { <0,1,0>, -.001 pigment {checker color White, color rgb .8 scale 12} photons{collect off}}
//texture{pigment{image_map{ "Grass_final"}rotate <90,37,0> scale 60} normal{bumps 1 scale 9 turbulence .2}
//finish{ambient .35 diffuse .5 specular .2 roughness .5 reflection {0}}}} //Realistic grass--don't forget the included image!
//fog{distance 100000 color rgbf<.7,.7,.8,1> fog_type 2 fog_offset 0 fog_alt 8000} //"Distance" fogs--rgb values of <.5,.6,.8>
//fog{distance 2200 color rgb<.5,.6,.8> fog_type 2 fog_offset 0 fog_alt 1} //work better with the checkered floor

//Scene Objects

object {WineGlass translate <8,1.99,0>}
union{object {WineGlass rotate <25,25,96>} translate <-5,3.8,-12>}
object {WaterGlass translate <0,1.99,.5>}
object {WaterGlass translate <-4.1,1.99,1>}
object {WaterGlass translate <-14,3.99,0> scale .5}
object {WaterGlass translate <-4.2,3.99,-6.8> scale .5}
object {WaterGlass translate <-.7,4.398,.4> scale .5}
object {WaterGlass translate <-2,1.499,5> scale 1.5}
object {WaterGlass translate <10,1.99,-4>}
//union{object {WaterGlass scale .5} translate <-10,2,9>}
 
box {<-50,0,-25>,<50,1.999,25> texture{DMFWood6 scale 4 rotate <8,92,0> finish{ambient 1 diffuse .5}} }