// render using: povray +p +w1120 +h630 Work.pov
#version 3.7;

#default {finish {ambient 0 emission 0 diffuse 0.6}}

#declare PQ = 1;

#if (PQ > 0)
  #declare UsePhotons = yes;
  #declare PhotonRun = yes; // change to "no" to reuse a map
#end

#switch (PQ)
  #case (0)
    #declare UsePhotons = no;
  #break
  #case (1)
    #declare S_val = 0.1;
    #declare T_val = 5;
        #declare C_val = 15000;
  #break
  #case (2)
    #declare S_val = 0.025;
     #declare T_val = 10;
        #declare C_val = 30000;
  #break
  #case (3)
    #declare S_val = 0.00625;
    #declare T_val = 50;
        #declare C_val = 60000;
  #break
#end

global_settings {
    max_trace_level 64
    adc_bailout 0.00001
    noise_generator 3
    assumed_gamma 1.0
    #if(UsePhotons)
        photons {
            spacing S_val
            autostop 1
            max_trace_level T_val
            count C_val
            #if (PhotonRun)
                save_file "Work.ph"
            #else
                load_file "Work.ph"
            #end
            }
    #end
    }

camera {
    perspective
    location <0,0,-10>
    rotate x*35
    rotate y*10
    look_at <0,1,0>
    right  x*4/3
    direction 1*z
    }

#declare Key_Light =
light_source {
    #declare LightColor = srgb 1;
    0, LightColor
    translate <0,0,-15>
    #if (UsePhotons)
        photons { reflection on refraction on }
    #end
    }

// -- The Stone Light ( in a light_group )
#declare Stone_Light =
light_source {
    #declare LightColor = srgb 1;
    0, LightColor
    translate <0,2,5>
    looks_like {sphere {0,0.125 pigment { srgb <1,1,0>}} }
    #if (UsePhotons)
        photons { reflection on refraction on }
    #end
    }

#declare Stone =   
sphere { 0,1
    material{
    texture{
        pigment{
            srgbf <0.4980, 0.2902, 0.4235,1>
            }
        normal { facets coords 1 size 0.25}                               
        finish{
            specular 1
                  roughness 0.01
            diffuse 0.6
            reflection{
                srgb <0.4980, 0.2902, 0.4235>*0.1, srgb <0.4980, 0.2902, 0.4235>*0.125 fresnel on
                }
            }
        }
    interior {
        ior 1.75
        fade_distance 2
        fade_power 1001
        fade_color <0.4980, 0.2902, 0.4235>
        #if (UsePhotons)
            caustics 1.0
            dispersion 1.05
            dispersion_samples 10
        #end
        }
    }
    #if (UsePhotons)
        photons { target reflection on refraction on collect off }
    #end
    }

#declare Band =
torus { 3,0.25
    material{
        texture{
            pigment{
                srgb <0.8100,0.7100,0.2300>
                }
            finish{
                specular 0.8
                roughness 0.1
                diffuse 0.6
                metallic
                brilliance 5
                reflection{srgb <0.8100,0.7100,0.2300>*0.75, srgb <0.8100,0.7100,0.2300>}
                }
            }
        }
    }

#declare Ring =
union {
    //light_group {
        object{
            Stone
            #if (UsePhotons)
                photons { target reflection on refraction on collect off }
            #end
            }
        //light_source { Stone_Light }
        //global_lights off
        //}
    object{
        Band
        translate x*3.95
        }
    translate <-3.95/2,2,0>
    }

object { Key_Light rotate x*45 rotate y*30 }
background { srgb 1 }
plane { y,0 pigment { srgb 1 } }
object { Ring } 
