POV-Ray : Newsgroups : povray.binaries.images : Light Challenge : Re: Light Challenge Server Time
31 Jul 2024 08:28:25 EDT (-0400)
  Re: Light Challenge  
From: Christian Froeschlin
Date: 16 Jun 2010 17:50:52
Message: <4c19473c$1@news.povray.org>
How Camp wrote:

> This makes sense -- and I appreciate you doing so.  My use of
> radiosity usually results in poor-to-average results, so I appreciate
> hearing ideas like this.

I'm not a very proficient user of it myself and I don't have the
patience and/or the machine to use it with high quality settings,
but povray comes with an include file rad_def.inc which contains
some useful presets. I sometimes use it to add some low quality
radiosity (with reduced brightness so the artefacts are not too
obvious) to a scene mostly using conventional light_sources.

Which reminds me I forgot to include the code:

#include "rad_def.inc"

// STRICT == 1 --> only change lighting using 3.6 functionality
// STRICT == 0 --> also change related settings such as focal_blur
//                 and using area_illumination from 3.7

#declare STRICT = 1;

#declare USE_AREA_LIGHT = 1;
#declare USE_AREA_ILLU  = 0;
#declare USE_PHOTONS    = 1;
#declare USE_FOCAL_BLUR = 0;
#declare USE_RADIOSITY  = 1;
#declare USE_MEDIA      = 0;

#if (STRICT=1)
   #version 3.6;
   #declare USE_FOCAL_BLUR = 0;
   #declare USE_AREA_ILLU  = 0;
#else
   #if (version < 3.7)
     #declare USE_AREA_ILLU = 0;
   #end
#end

global_settings
{
   assumed_gamma 1.0
   max_trace_level 10
   ambient_light 0.01
#if (USE_RADIOSITY=1)
   radiosity {Rad_Settings(Radiosity_Fast, off, off)}
#end
#if (USE_PHOTONS=1)
   photons {count 100000}
#end
}


#if (USE_RADIOSITY=1)
// Use sky sphere
sphere
{
   0,200 hollow
   pigment {color 100*<0.5,0.6,0.8>}
   finish {diffuse 0 ambient 0.05}
}

#end


light_source
{
   <6, 5, -2>
   //color rgb 1
   color rgb 6*<0.7,0.7,1>
   fade_power 2 fade_distance 2
#if (USE_AREA_LIGHT=1)
   area_light 1.5*x,1.5*y,9,9 circular orient
   #if (USE_AREA_ILLU=1)
     area_illumination
   #end
#end
}



light_source
{
   <-100, 15, -100> color rgb 0.1*<1.5,0.3,0>
}


#if (USE_MEDIA=1)
// actually looks quite crappy
box
{
   <-10,-1,-5>,<10,10,10>
   hollow
   pigment {color rgbt 1}
   interior
   {
     media
     {
       scattering {1,color rgb 0.01}
       density {granite color_map {[0 rgb 0] [1 rgb 1]}}
     }
   }
}
#end

// ----------------------------------------
// Basically, everything below here should
// remain the same
// ----------------------------------------

#include "colors.inc"
#include "glass.inc"

camera
{
   location  <0, 5, -5>
   look_at   <0, 0,  0>
#if (STRICT=0)
   #if (USE_FOCAL_BLUR=1)
     // focus on the cone
     focal_point <3,1,2>
     aperture 0.8
     blur_samples 25
   #end
#end
}

plane {
    y, -1
    texture {
       pigment {
          gradient x
          color_map {
             [0.0 rgb <0.6, 0.4, 0.4>]
             [0.5 rgb <0.2, 0.6, 0.8>]
             [1.0 rgb <0.6, 0.4, 0.4>]
          }
          scale 4
          rotate -45*y
       }
       normal {
          granite
          0.6
          scale 1.75
       }
    }
}

box {
    -1, 1
    scale <1,0.999,1>
    photons {collect off}
    texture{
       pigment {
          gradient y
          color_map {
             [0.0 rgb <0.9, 0.1, 0>/8]
             [1.0 rgb <0.9, 0.1, 0>]
          }
          scale 2
          translate -y
       }
       finish {
          ambient 0.1
          diffuse 0.6
          brilliance 1.0
          phong 0.5
          phong_size 40
          specular 0.5
          roughness 0.05
          metallic 1
          reflection {
             0.5
             1.0
             fresnel on
             falloff 1.0
             exponent 1.0
             metallic 0.9
          }
          conserve_energy
       }
       normal {
          granite 0.15
          scale 2
       }
    }
    rotate 25*y
    translate <-3.25,0,2>
}

sphere {
    0, 1
    photons {collect off}
    texture {
       pigment {
          bozo
          color_map {
             [0.0 rgb <1,1,0>]
             [1.0 rgb <0,0,2>]
          }
          scale 0.2
       }
       finish {
          ambient 0.1
          brilliance 0.4
          phong 0.25
          phong_size 70
          specular 0.65
          roughness 0.005
       }


    }
    translate <0,0,3>
}

torus {
    1.0,
    0.25
    photons {collect off}
    texture {
       pigment {
          gradient x
          color_map {
             [0.0 rgb <1,0,1>/1]
             [0.3 rgb <1,0,1>/4]
             [0.6 rgb <1,0,1>/2]
             [1.0 rgb <1,0,1>/1]
          }
          scale 0.25
          warp {
             turbulence 0.25*x
          }
       }
       finish {
          ambient 0.1
          diffuse 0.8
          brilliance 1.0
          phong 0.5
          phong_size 25
          specular 0.15
          conserve_energy
       }
    }
    translate <1.75,-0.75,-1.75>
}


cone {
    -y,2,
    2*y,0
    photons {target refraction on reflection off collect off}
    material {
       texture {
          pigment {
             color Col_Glass_Orange

          }
          finish {F_Glass3}
       }
       interior {I_Glass}
    }
    translate <4,0,3>
}

cylinder {
    <-2,-0.5,-2>, <0,-0.5,0>, 0.5
    photons {collect off}
    texture {
       pigment {
          dents
          color_map {
             [0.0 rgb <1,1,0>/2]
             [0.5 rgb <1,1,0>]
             [1.0 rgb <1,1,0>/2]
          }
          scale 1/4
       }
       normal {
             crackle 1.5
             scale 1/4
       }
    }
    translate <-1,0,-1>/2
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.