POV-Ray : Newsgroups : povray.binaries.images : SSLT candle experiment : Re: SSLT candle experiment Server Time
29 May 2024 06:38:54 EDT (-0400)
  Re: SSLT candle experiment  
From: clipka
Date: 17 Feb 2011 04:32:56
Message: <4d5ceb48$1@news.povray.org>
Am 17.02.2011 08:53, schrieb Bruno Cabasson:

> Following this post and the 'SSLT and scaling' thread, here an attempt for
> scaling the candle and see what happens for SSLT parameters. It appears to me
> that subsurface parameters must be adjusted wrt scaling so as to have consistent
> behaviour.

Scaling is /not/ necessary if you want the things to appear as being 
made out of the same material but different sizes.

The differences you see are probably due to the many other tweakables 
you have per candle.

> It also seems that the wick projects a shadow at its base despite the no_shadow
> keyword.

No. I'm pretty puzzled about what's going on there, but it's definitely 
not the wick, as can be plainly seen when you comment that out.

I prefer to think that the rim is brighter because it gets illuminated 
not only by the light from above, but also from light being reflected 
back at the candle's sides (remember fresnel reflectance), whereas at 
the center the light just diffuses towards the bottom and gets absorbed 
along the way, so maybe it's realistic after all (given the material 
parameters we have, which are potentially bogus).


> Finally, I am wondering about the smallest candle and the sharp shadows in the
> bottom right.

That is, of course, the shadow from the smallest and medium candle, cast 
by the light of the largest candle.


BTW, for more dramatic (and actually more realistic) atmosphere, reduce 
FLAME_FADE_DIST, and increase FLAME_POWER instead.

As a rule of thumb, fade_distance of an area light source should be 
about the same order of magnitude as the area light's dimensions.

Another issue with your scene is the non-circular circular area light. 
I'm not sure whether this works at all, but in combination with orient 
it may give you pretty surprising results, as the area light source may 
essentially be rotated about /any/ axis to achieve the necessary 
orientation.


>
> I continue playing.
>
> Bruno
>
> //--------------------------
>
> #version 3.7;
>
> #include "colors.inc"
>
> #declare m = 1;
> #declare cm = m/100;
> #declare mm = m/1000;
> #declare FLAME_COLOR = (2*Orange+Yellow)/3;
> #declare FLAME_POWER = 4;
> #declare FLAME_FADE_DIST = 15*cm;
> //#declare QUALITY = 1; // Use DECLARE=QUALITY=1 in command line
>
> #declare RAD_COUNT = 50*QUALITY;
> #declare SSLT_SAMPLES =<20, 5>*QUALITY*2;
>
> #default { finish{ambient 0 emission 0}}
>
> global_settings
> {
>      assumed_gamma 1
>      mm_per_unit 1/mm
>      subsurface { samples SSLT_SAMPLES.x, SSLT_SAMPLES.y}
>
>      radiosity
>      {
>          pretrace_start 32/image_width
>          pretrace_end 2/image_width
>          count RAD_COUNT
>          error_bound 0.5
>          nearest_count 15
>          recursion_limit 2
>          low_error_factor 1
>          media on
>      }
> }
>
> // ----------------------------------------
>
> camera {
>    location<0.0, 1.0, -4.0>*8*cm
>    direction 1.5*z
>    right     x*image_width/image_height
>    look_at<0.5, 0.75,  0.0>*8*cm
> }
>
> declare LS_Lamp = light_source {<-5, 5, -5>*m color rgb 0.2}
>
> #macro makeLSCandle(_power)
>      #local _ret = light_source
>      {
>        0
>        color rgb FLAME_POWER*FLAME_COLOR*_power
>        area_light 1*cm*x, 2*cm*y, 4*QUALITY, 4*QUALITY adaptive 1 circular orient
>        //area_illumination on
>        fade_power 2
>        fade_distance FLAME_FADE_DIST
>        //looks_like {sphere {0, 2*mm pigment {Red}}}
>      }
>      _ret
> #end
>
> // ----------------------------------------
>
>
> #declare O_Floor = plane
> {
>      y, -0.1*mm
>      pigment {rgb 1}
> }
>
> // a candle...
> #macro make10cmCandleBody (_scale)
>      blob
>      {
>        threshold 0.5
>        cylinder {<0.0, 0.0,  0.0>,
>                   <0.0, 2.0,  0.0>,  1.0,   1.0 } // candle "body"
>        sphere   {<0.0, 2.5,  0.0>,  0.8,  -2.0 } // (used to shape the candle
> top)
>        sphere   {<0.0,-0.52, 0.0>,  0.8,  -2.0 } // (used to shape the candle
> bottom)
>        sphere   {<0.0, 2.0, -0.5>,  0.1,  -0.2 } // the "notch" where wax runs
> over
>        cylinder {<0.0, 1.88,-0.52>,
>                   <0.0, 1.5, -0.52>, 0.05,  0.2 } // a streak of wax running over
>        sphere   {<0.0, 1.5, -0.55>, 0.07,  0.2 } // a drop of of wax running
> over
>        texture
>        {
>          //pigment {wrinlkles scale 0.1 color_map {[ 0.3 Blue] [0.3 Red]}}
>          pigment {rgb 1}
>          finish
>          {
>            specular 0.1 roughness 2*cm
>            ambient 0
>            // "artificial" wax parameters
>            subsurface {<  1.6732, 1.2806, 0.6947>*pow(_scale,1/3),<  0.0005,
> 0.0018, 0.0131>*pow(_scale,1/3)}
>          }
>        }
>        scale 1/2
>        scale 10*cm
>        scale _scale
>        interior { ior 1.45 }
>        rotate -y*45
>      }
> #end
>
> // ... and the wick
> #declare O_Wick = cylinder
> {
>      0, 1*cm*y, 1*mm
>      pigment {rgb 0.05}
> }
>
> #macro makeFlame(_power)
>      ovus
>      {
>          3.5*mm, 3*mm
>          pigment {rgbt 1}
>          //finish {emission 1}
>          hollow
>          interior
>          {
>              media
>              {
>                  samples 20
>                  scattering {1, (1/_power)*3/(1*cm)}
>                  absorption 6/(1*cm)
>                  density {spherical scale 2 warp {turbulence 0.7 octaves 8} scale
> 1/2 scale 0.3*cm scale 2*y translate -1*mm*y }
>                  density {spherical scale 0.3*cm scale 2*y translate -1*mm*y }
>                  density {spherical scale 0.3*cm scale 2*y translate -1*mm*y }
>              }
>          }
>          scale 3
>          no_shadow
>      }
> #end
>
> #macro make10cmCandle(_scale, _power)
>      union
>      {
>          light_source {makeLSCandle(_power) translate 11*cm*y  scale _scale}
>          object {make10cmCandleBody(_scale)}
>          object {O_Wick translate 9.75*cm*y scale _scale no_shadow}
>          object {makeFlame(_power) translate 11.5*cm*y scale _scale }
>      }
> #end
>
> #declare O_Dome = sphere
> {
>      0, 5*m
>      hollow
>      pigment {checker scale 0.1*m}
> }
>
> //light_source {LS_Lamp}
> object {O_Floor}
> object {make10cmCandle(1, 1) rotate 90*y}
> object {make10cmCandle(1/2, sqrt(1/2)) translate 7*cm*x - 5*cm*z}
> object {make10cmCandle(1/4, sqrt(1/4)) translate 10*cm*x - 10*cm*z}
> object {O_Dome}


Post a reply to this message

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