POV-Ray : Newsgroups : povray.binaries.images : SSLT candle experiment : Re: SSLT candle experiment Server Time
2 Nov 2024 08:22:27 EDT (-0400)
  Re: SSLT candle experiment  
From: Bruno Cabasson
Date: 17 Feb 2011 02:55:01
Message: <web.4d5cd3f944aed71b4aa45fdf0@news.povray.org>
"Bruno Cabasson" <bru### [at] alcatelaleniaspacefr> wrote:
> Playing with SSLT, I took the candle from the subsurface.pov example, and tried
> to have a satisfactory result. Used radiosity.
>
> Bruno

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. One can turn comment out the candles to see them individually, and
use DECLARE=QUALITY=1 for quick rendering.

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

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

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


Attachments:
Download 'candle14.png' (134 KB)

Preview of image 'candle14.png'
candle14.png


 

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