POV-Ray : Newsgroups : povray.binaries.images : Light Challenge : Re: Light Challenge Server Time
31 Jul 2024 08:24:26 EDT (-0400)
  Re: Light Challenge  
From: H  Karsten
Date: 16 Jun 2010 00:50:05
Message: <web.4c185708ad2ae755dec81f370@news.povray.org>
/*
Hi How Camp
The problem of lightning has its origin in the techniques of CGI-Lightning!

Means: Years ago there was no way to simulate light that correct, as it is in
nature. And it's still not possible - but you can come very close to it with in
these days.

Studio-light often tries to simulate daylight by using special techniques
insight of the studio.

The result was to have _very_ special techniques in CGI-lightning: Simulating
light with a program, that can not offer you _real_ working light-simulation
makes it twice-complicate just to get a good looking studio-situation. Using a
studio-situation to make a good looking light-situation then is the next step to
make.

First is to understand the classic limitations and then making the decision,
using the classic way, ore the classic way with further techniques, or using
progressive techniques.

First way means: Hard setup for the artists, but fast render-time.
Second way means: _Much_ easier setup, slower render-time (radiosity)
Third way means: Easy setup as well, very slow rendering, but very accurate
lighting-simulation. (Path-tracing, by using MC-Pov)
Best start is to take a look of the problems in the classic way of light
simulation (the classic way of ray-tracing).
Lets take a look of whats NOT possible:

- Light comes _ONLY_ from out of the light-source! In real environment it comes
from _everywhere_ that is visible to your eye, or to the camera, because the
light-rays that makes an object visible could light up other objects as well if
not going into your eye!

- When having _NO_ light in the shadows (because these areas are somehow covert
from the light-sources) that means: Totally blackness! to avoid this, these
areas can be lighten up, using the "ambient" keyword. What happens then is a so
called "self-illumination" within that areas. Actually there NOT illuminating
the scene, there JUST illuminating "to the camera".

These "tool" is actually the MOST artificial looking problem in lighning!

Your scene contains objects, heaving the "ambient" setting set to "0.1" try out,
to set it to "0" and using other light-sources (very small values in power,
using light fading and make it "shadowless". With this technique, you can try to
setup reflecting light, coming from important, and big surfaces, illuminating
other objects.

This technique means very much work, but a better result as when setting the
ambient higher then zero.

In a photo-studio, reflectors are often used.
When no light is simulated, coming from objects, you have to use the same
technique of shadowless and fading light-sources to illuminate special areas.

A basic rule is: Only the main light has a shadow. More then one main shadow is
something, a professional photographer would never except. (For a normal setup)

You see this is a very hard job to make.

When using ambient, higher then zero, try out to bring negative lights into
special eras, like insight mouth and nose. As well, use no-shadow, and fading
here!

A much easier thing might be to set all your ambients to zero, than try out
different radiosity settings from the "rad_def.inc" file. For this test, use
only one light-source in the beginning.

This is, what is being tried in every photo-studio to simulate, when using lambs
in a setup: The sun! This is your main-light. Other lights coming from other
object (we _don't_ have two suns, or more up in the sky ;)

When the result is good, try to make the environment a little cloudy, by using
an area-light instead of a point- or spotlight. In most cases, this looks more
friendly.

You can use objects as light-sources, when using radiosity, or when using
MC-Pov. THIS time, when using the ambient keyword, and using radiosity, or
MC-Pov the object will REALY self-illuminate AND lightning other objects as well
as a normal light-source.

This is good for soft shadows.

Another big problem are the surfaces, because the highlights on an object is
separated from the shape of the light, and the reflection of the finish. Means:
It is possible, making a very blurry highlight, but still a clean, reflective
surface. In normal cases, this is not possible. A soft highlight means a rugh
surface and that means a blurry reflection!

In this example, I try to bring the most popular tricks.

Best regards,

Holger :)
*/

//#######################################################################################

#declare Scenetype=0;   // 0=PovRay no Radiosyty    (area_light)
                        // 1=PovRay with Radiosity  (no blurry reflection,
because of allredy existing normals)
                        // 2=MC-POV                 (Blurry reflection)

//##########################   LightSoftness effects the size of the ligtsource
 ####################
#declare LightSoftness=6;
//##########################   The reflector makes the environment more friendly
 #######
#declare Reflector=off;
//#######################################################################################
//  Only works in MC-Pov mode. These are settings for all objects eccept the
cone
#declare LightSoftness_onSurfaces=25;//smaller = more blurry
#declare LightIntensity_onSurfaces=.25;
//  For the ground
#declare LightSoftness_onSurfaces_on_floor=10;
#declare LightIntensity_onSurfaces_on_floor=.1;
//#######################################################################################

/*
When using Scenetype=1 no Highlights will be shown, because of no
blurry reflection in the scene.
Blurry reflection with PovRay is only availiable, when
no other normals are used (or I don't know how to...)

Only the cone has a hilight (normal reflection..)

(Lightsources will not be shown to the camera, or reflections, only
objects does)

*/

//##########################     have fun
###########################################


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

#if (Scenetype=2) #version unofficial megapov 1.21 #else #version 3.6;#end
 global_settings {
  assumed_gamma 1.0
  max_trace_level 10
  #if (Scenetype=1) radiosity {Rad_Settings(Radiosity_IndoorLQ,on,off)}#end//HQ
was to slow for my taste
  #if (Scenetype=2)
  max_trace_level 8
  montecarlo
   {
    mc_rand_seed
    mc_max_diffuse_bounce 3
    mc_pixel_refresh_ratio 1
   }
  #end
 }

 #default{pigment{color rgb 1}finish{ambient 0 diffuse 1
  #if (Scenetype=2)
   montecarlo{mc_diffuse{1 1 1}}
  #end
 }}

 #if (Scenetype=0)
  light_source {
   0*x
   color rgb 30
    area_light
    <LightSoftness,0,0><0,0,LightSoftness>
    4,4
    adaptive 0
    jitter
    circular
    orient
    rotate <-20,15,0>
    translate <5, 10, -10>
    fade_distance 2
    fade_power 2.2
  }
 #end

 #if (Scenetype=0) #else
  box{<LightSoftness,-.1,-.1><.1,.1,LightSoftness>
   #if (Scenetype=2)
    montecarlo{mc_portal{1 1 1 1}}
   #end
   pigment{color rgb 1}
   finish{ambient 10
  }
   rotate <-20,15,0>
   translate <5, 10, -10>
  }
 #end

 camera {
  location  <0, 5, -5>
  look_at   <0, 0,  0>
 }

 #if (Reflector)
  plane{
   x,-15
   pigment{color rgb 6}
   rotate y*10
  }
 #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
   }
    #if (Scenetype=2)finish{reflection LightIntensity_onSurfaces_on_floor
montecarlo{mc_reflect{1 1 1 LightSoftness_onSurfaces_on_floor}}}#end
   normal{
    granite 0.6
    scale 1.75
   }
  }
 }

 box {
  -1, 1
  scale <1,0.999,1>
   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 {
     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
      }
     #if (Scenetype=2)reflection LightIntensity_onSurfaces
montecarlo{mc_reflect{1 1 1 LightSoftness_onSurfaces}}#end
     conserve_energy
    }
    normal {
     granite 0.15
    scale 2
    }
   }
  rotate 25*y
  translate <-3.25,0,2>
 }

 sphere {
  0,1
  texture {
    pigment {
    bozo
     color_map {
      [0.0 rgb <1,1,0>]
      [1.0 rgb <0,0,2>]
     }
    scale 0.2
    }
    finish {
     phong 0.25
     phong_size 70
     specular 0.65
     roughness 0.005
     brilliance 0.4
     #if (Scenetype=2)reflection LightIntensity_onSurfaces
montecarlo{mc_reflect{1 1 1 LightSoftness_onSurfaces}}#end
    }
  }
  translate <0,0,3>
 }

 torus {
  1.0,
  0.25
   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 {
   phong 0.5
   phong_size 25
   specular 0.15
   conserve_energy
   diffuse 0.8
   brilliance 1.0
   #if (Scenetype=2)reflection LightIntensity_onSurfaces montecarlo{mc_reflect{1
1 1 LightSoftness_onSurfaces}}#end
   }
  }
  translate <1.75,-0.75,-1.75>
 }

 cone {
  -y,2,
  2*y,0
   material {
    texture {
     pigment {
      color Col_Glass_Orange
     }
    finish {F_Glass3 ambient 0
    }
    }
    interior {I_Glass}
   }
  translate <4,0,3>
 }

 cylinder {
  <-2,-0.5,-2>, <0,-0.5,0>, 0.5
   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
    }
    #if (Scenetype=2)finish{reflection LightIntensity_onSurfaces
montecarlo{mc_reflect{1 1 1 LightSoftness_onSurfaces}}}#end
   }
  translate <-1,0,-1>/2
 }


Post a reply to this message


Attachments:
Download 'light-chalange_settings.jpg' (132 KB)

Preview of image 'light-chalange_settings.jpg'
light-chalange_settings.jpg


 

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