POV-Ray : Newsgroups : povray.general : Physically accurate wax simulation Server Time
31 Jul 2024 10:28:47 EDT (-0400)
  Physically accurate wax simulation (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: Burki
Subject: Re: Physically accurate wax simulation
Date: 2 Sep 2007 13:20:00
Message: <web.46daefb46612cd25fc8d7180@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> Charles nous apporta ses lumieres en ce 2007/09/01 19:39:
> > Hello everyone,
> >
> > For a research project, I need to make a physically accurate simulation of
> > candlewax.


Hi!

I made a demo scene with wax this spring (see below).

The material is slightly altered from the one first provided by Andy Cocker
in his posting:
http://news.povray.org/povray.text.scene-files/thread/%3C3fcddaec$1@news.povray.org%3E/?ttop=238503&toff=100
The media density is very high (seven).

Perhaps try this, should render in a few seconds.


Yours,
Bu.


Only code follows:

//////////////////////////////////////////////////////////////////////
// Persistence of Vision Ray Tracer Scene Description File
// File: ?.pov
// Vers: 3.6
// Desc: Checkered Floor Example
// Date: mm/dd/yy
// Auth: ?
//

#version 3.6;

#include "colors.inc"

global_settings {
  assumed_gamma 1.0
  max_trace_level 5
}

// ----------------------------------------

camera {
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
}

// ----------------------------------------

plane {               // checkered floor
  y, -1
  texture
  {
    pigment {
      checker
      color rgb 1
      color blue 1
      scale 0.5
    }
    finish{
      diffuse 0.8
      ambient 0.1
    }
  }
}
//
http://news.povray.org/povray.text.scene-files/thread/%3C3fcddaec$1@news.povray.org%3E/?ttop=238503&toff=100

#declare Obj_Col = <1, 0.6, 0.2>;
#declare Obj_Absorption = 1 - Obj_Col;
#declare Media_Density = 7;    //was 6.5; // must be adapted to size
#declare SSS_Tex =
     texture {
          pigment {
               rgb Obj_Col
               filter 1.2 // was 1.0
          }
          finish {
               brilliance 4 // wasn't included from Andy Cocker
               specular 0.5
               roughness 0.2
               ambient 0.2
               reflection {
                    0.0,
                    0.5
                    fresnel
               }
               conserve_energy
          }
     }
#declare SSS_Int =
     interior {
          ior  1.3 // close to water
          // Media with absorption and scattering
          media {
               absorption Obj_Absorption*2
               scattering {
                              4, // Rayleigh
                              Media_Density //see above
               }
               method 3 // adaptive sampling, is default anyway
          }
     }

#declare SSS_Material =
material {
     texture {
          SSS_Tex
     }
     interior {
          SSS_Int
     }
}



//
cylinder{
     <0, -1, 0>
     <0, 0.3, 0>
     0.3
     hollow
     material {SSS_Material}
}

//end of file


Post a reply to this message

From: Alain
Subject: Re: Physically accurate wax simulation
Date: 2 Sep 2007 15:32:53
Message: <46db0fe5$1@news.povray.org>
Burki nous apporta ses lumieres en ce 2007/09/02 13:15:
> Alain <ele### [at] netscapenet> wrote:
>> Charles nous apporta ses lumieres en ce 2007/09/01 19:39:
>>> Hello everyone,
>>>
>>> For a research project, I need to make a physically accurate simulation of
>>> candlewax.
> 
> 
> Hi!
> 
> I made a demo scene with wax this spring (see below).
> 
> The material is slightly altered from the one first provided by Andy Cocker
> in his posting:
>
http://news.povray.org/povray.text.scene-files/thread/%3C3fcddaec$1@news.povray.org%3E/?ttop=238503&toff=100
> The media density is very high (seven).
> 
> Perhaps try this, should render in a few seconds.
> 
> 
> Yours,
> Bu.
> 
> 
> Only code follows:
> 
> //////////////////////////////////////////////////////////////////////
> // Persistence of Vision Ray Tracer Scene Description File
> // File: ?.pov
> // Vers: 3.6
> // Desc: Checkered Floor Example
> // Date: mm/dd/yy
> // Auth: ?
> //
> 
> #version 3.6;
> 
> #include "colors.inc"
> 
> global_settings {
>   assumed_gamma 1.0
>   max_trace_level 5
> }
> 
> // ----------------------------------------
> 
> camera {
>   location  <0.0, 0.5, -4.0>
>   direction 1.5*z
>   right     x*image_width/image_height
>   look_at   <0.0, 0.0,  0.0>
> }
> 
> sky_sphere {
>   pigment {
>     gradient y
>     color_map {
>       [0.0 rgb <0.6,0.7,1.0>]
>       [0.7 rgb <0.0,0.1,0.8>]
>     }
>   }
> }
> 
> light_source {
>   <0, 0, 0>            // light's position (translated below)
>   color rgb <1, 1, 1>  // light's color
>   translate <-30, 30, -30>
> }
> 
> // ----------------------------------------
> 
> plane {               // checkered floor
>   y, -1
>   texture
>   {
>     pigment {
>       checker
>       color rgb 1
>       color blue 1
>       scale 0.5
>     }
>     finish{
>       diffuse 0.8
>       ambient 0.1
>     }
>   }
> }
> //
>
http://news.povray.org/povray.text.scene-files/thread/%3C3fcddaec$1@news.povray.org%3E/?ttop=238503&toff=100
> 
> #declare Obj_Col = <1, 0.6, 0.2>;
> #declare Obj_Absorption = 1 - Obj_Col;
> #declare Media_Density = 7;    //was 6.5; // must be adapted to size
> #declare SSS_Tex =
>      texture {
>           pigment {
>                rgb Obj_Col
>                filter 1.2 // was 1.0
>           }
>           finish {
>                brilliance 4 // wasn't included from Andy Cocker
>                specular 0.5
>                roughness 0.2
>                ambient 0.2
>                reflection {
>                     0.0,
>                     0.5
>                     fresnel
>                }
>                conserve_energy
>           }normal{ granite 0.2 scale 0.001}
>      }
> #declare SSS_Int =
>      interior {
>           ior  1.3 // close to water
>           // Media with absorption and scattering
>           media {
>                absorption Obj_Absorption*2
>                scattering {
>                               4, // Rayleigh
>                               Media_Density //see above
>                }
>                method 3 // adaptive sampling, is default anyway
>           }
>      }
> 
> #declare SSS_Material =
> material {
>      texture {
>           SSS_Tex
>      }
>      interior {
>           SSS_Int
>      }
> }
> 
> 
> 
> //
> cylinder{
>      <0, -1, 0>
>      <0, 0.3, 0>
>      0.3
>      hollow
>      material {SSS_Material}
> }
sphere{0,0.1 pigment{rgb 0}}
> 
> //end of file
> 
> 
Added:
normal{ granite 0.2 scale 0.001} to the texture of the cylinder.

Added:
sphere{0,0.1 pigment{rgb 0}}

Some improvement.
-- 
Alain
-------------------------------------------------
OK, so what's the speed of dark?


Post a reply to this message

From: Charles
Subject: Re: Physically accurate wax simulation
Date: 2 Sep 2007 17:20:00
Message: <web.46db289c6612cd23489ab670@news.povray.org>
Dear Everyone,

Burki: even though your candle looks very nice, it still doesn't render
embedded objects with "participating" wax. I think (read: fear) that what I
need is a full volume render, which
1) takes ages to render;
2) I don't know if povray is capable of.

What seems to be the problem is that POVRay treats a material as a single
entity instead of rendering it as thousands if not millions of particles
(think of smoke). The obvious solution here is a #while-loop to dynamically
generate as many of these micro-particles as gives a good render result.
This post is a last cry for something more decent. Some sort of mapping?

Thanks,
Charles

PS. Alain, I'm not sure this is what your code attempts to do. I couldn't
get it parsed (latest POVRay version).


Post a reply to this message

From: Alain
Subject: Re: Physically accurate wax simulation
Date: 2 Sep 2007 23:12:37
Message: <46db7ba5$1@news.povray.org>
Charles nous apporta ses lumieres en ce 2007/09/02 17:18:
> Dear Everyone,
> 
> Burki: even though your candle looks very nice, it still doesn't render
> embedded objects with "participating" wax. I think (read: fear) that what I
> need is a full volume render, which
> 1) takes ages to render;
> 2) I don't know if povray is capable of.
> 
> What seems to be the problem is that POVRay treats a material as a single
> entity instead of rendering it as thousands if not millions of particles
> (think of smoke). The obvious solution here is a #while-loop to dynamically
> generate as many of these micro-particles as gives a good render result.
> This post is a last cry for something more decent. Some sort of mapping?
> 
> Thanks,
> Charles
> 
> PS. Alain, I'm not sure this is what your code attempts to do. I couldn't
> get it parsed (latest POVRay version).
> 
> 
> 
> 
Where is the error? And what does it say?
Try this one:

#include "colors.inc"

global_settings {
   assumed_gamma 1.0
   max_trace_level 5
   photons{spacing 0.1}
}

// ----------------------------------------

camera {
   location  <0.0, 0.5, -4.0>
   direction 1.5*z
   right     x*image_width/image_height
   look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
   pigment {
     gradient y
     color_map {
       [0.0 rgb <0.6,0.7,1.0>]
       [0.7 rgb <0.0,0.1,0.8>]
     }
   }
}

light_source {
   <0, 0, 0>            // light's position (translated below)
   color rgb <1, 1, 1>  // light's color
   translate <-30, 30, -30>
}

// ----------------------------------------

plane {               // checkered floor
   y, -1
   texture
   {
     pigment {
       checker
       color rgb 1
       color blue 1
       scale 0.5
     }
     finish{
       diffuse 0.8
       ambient 0.1
     }
   }
}

#declare Obj_Col = <1, 0.6, 0.2>;
#declare Obj_Absorption = 1 - Obj_Col;
#declare Media_Density = 7;    //was 6.5; // must be adapted to size
#declare SSS_Tex =
      texture {
           pigment {
                rgb Obj_Col
                filter 1.2 // was 1.0
           }
           finish {
                brilliance 4 // wasn't included from Andy Cocker
                specular 0.5
                roughness 0.2
                ambient 0.2
                reflection {
                     0.0,
                     0.5
                     fresnel
                }
                conserve_energy
           }
	normal{ granite 0.2 scale 0.00041}
      }
#declare SSS_Int =
      interior {
           ior  1.3 // close to water
           // Media with absorption and scattering
           media {
                absorption Obj_Absorption*2
                scattering {
                               4, // Rayleigh
                               Media_Density //see above
                }
           }
      }

#declare SSS_Material =
material {
      texture {
           SSS_Tex
      }
      interior {
           SSS_Int
      }
}



//
cylinder{
      <0, -1, 0>
      <0, 0.3, 0>
      0.3
      hollow
      material {SSS_Material}
      //photons{target refraction on}
}
sphere{<-0.1, -0.3, -0.1>,0.1 pigment{rgb 0}}
// an imbeded black sphere.
//end of file


-- 
Alain
-------------------------------------------------
Just because someone doesn't love you the way you want them to, doesn't mean 
they don't love you with all they have.


Post a reply to this message

From: Charles
Subject: Re: Physically accurate wax simulation
Date: 3 Sep 2007 07:25:01
Message: <web.46dbeeb46612cd21550d7f0@news.povray.org>
Dear Alain,

I was referring to the snipped you posted earlier:

#declare Scale = 0.001;// use a large (>100) or a small (<0.01) value
#declare R = seed(1);// any value will do
#declare Samples = 10;// use a larger value only if absolutely needed, as
you
cross 2 surfaces, each ray will split in 10 two times!

normal{average{normal_map{
    #while(Samples)
 [1 normal bumps translate<rand(R),rand(R),rand(R)>*Scale scale Scale]
// you use a broad pattern with large displacemen
//OR tyni pattern with small displacement.
 #declare Samples = Samples - 1;
    #end
    }

This gives me a syntax error.

Another way to state the issue, by the way, is that a single material cannot
cast a shadow upon itself. I think I'm going to try simulating a few
thousand microscopic spheres and see what results that gives me.

Kind regards,
Charles


Post a reply to this message

From: Alain
Subject: Re: Physically accurate wax simulation
Date: 3 Sep 2007 14:10:09
Message: <46dc4e01@news.povray.org>
Charles nous apporta ses lumieres en ce 2007/09/03 07:23:
> Dear Alain,
> 
> I was referring to the snipped you posted earlier:
> 
> #declare Scale = 0.001;// use a large (>100) or a small (<0.01) value
> #declare R = seed(1);// any value will do
> #declare Samples = 10;// use a larger value only if absolutely needed, as
> you
> cross 2 surfaces, each ray will split in 10 two times!
> 
> normal{average{normal_map{
>     #while(Samples)
>  [1 normal bumps translate<rand(R),rand(R),rand(R)>*Scale scale Scale]
> // you use a broad pattern with large displacemen
> //OR tyni pattern with small displacement.
>  #declare Samples = Samples - 1;
>     #end
>     }
> 
> This gives me a syntax error.
> 
> Another way to state the issue, by the way, is that a single material cannot
> cast a shadow upon itself. I think I'm going to try simulating a few
> thousand microscopic spheres and see what results that gives me.
> 
> Kind regards,
> Charles
> 
> 
The problem is that a comment line was split in 2. The error comes from that 
second part whitch is NOT proper SDL syntax ;-)

-- 
Alain
-------------------------------------------------
Lutheran: If shit happens, don't talk about it.


Post a reply to this message

From: Charles
Subject: Re: Physically accurate wax simulation
Date: 9 Sep 2007 09:15:00
Message: <web.46e3f13d6612cd23489ab670@news.povray.org>
Hello,

I've made some progress:

http://www.turingbirds.com/personal/random/wax_trial_2_render.png
http://www.turingbirds.com/personal/random/wax_trial_2.pov

However, despite the end of the cylinder being inside the box, it is not
getting "blurry", just darker. It looks like povray is treating the
scattering media as a single entity, rather than a near-infinite number of
particles which it's supposed to represent. Kasuga_Kyousuke on povray irc
advised me that radiosity will not fix this scene, because of the same
reason: looking at the media as a single entity. Does anyone know of a way
to make this work?

Thanks,
Charles

PS. Intended result: candle wax with black bead embedded
(http://www.turingbirds.com/personal/random/wax.png)
PS2. adding absorption does not work; it only makes everything evenly darker


Post a reply to this message

From: Alain
Subject: Re: Physically accurate wax simulation
Date: 9 Sep 2007 10:26:03
Message: <46e4027b@news.povray.org>
Charles nous apporta ses lumieres en ce 2007/09/09 09:12:
> Hello,
> 
> I've made some progress:
> 
> http://www.turingbirds.com/personal/random/wax_trial_2_render.png
> http://www.turingbirds.com/personal/random/wax_trial_2.pov
> 
> However, despite the end of the cylinder being inside the box, it is not
> getting "blurry", just darker. It looks like povray is treating the
> scattering media as a single entity, rather than a near-infinite number of
> particles which it's supposed to represent. Kasuga_Kyousuke on povray irc
> advised me that radiosity will not fix this scene, because of the same
> reason: looking at the media as a single entity. Does anyone know of a way
> to make this work?
> 
> Thanks,
> Charles
> 
> PS. Intended result: candle wax with black bead embedded
> (http://www.turingbirds.com/personal/random/wax.png)
> PS2. adding absorption does not work; it only makes everything evenly darker
> 
> 
The media will not change the effective direction of a ray shot from the camera. 
To do that, the generaly accepted way is to use normals, or actual surface 
bending using an isosurface.
You can add something like a "micro-normal" like:

normal{granite scale 0.001}

you may even scale smaller like 0.00001 or even less.
Works best when using anti-aliasing.
You can also use bluring using the average pettern:
#local R = seed(0);
normal{average{average_map{#local S = 20;//adjust S to change the
//quality of the bluring
#while(S) [1 normal granite scale 0.01 translate<rand(R),rand(R),rand(R)>*0.01]
#local S=S-1;
#end
}}}

-- 
Alain
-------------------------------------------------
Do you want to know who you are? Don't ask. Act! Action will delineate and
define you.
Thomas Jefferson


Post a reply to this message

From: Alain
Subject: Re: Physically accurate wax simulation
Date: 9 Sep 2007 10:41:09
Message: <46e40605$1@news.povray.org>
Charles nous apporta ses lumieres en ce 2007/09/09 09:12:
> Hello,
> 
> I've made some progress:
> 
> http://www.turingbirds.com/personal/random/wax_trial_2_render.png
> http://www.turingbirds.com/personal/random/wax_trial_2.pov
> 
> However, despite the end of the cylinder being inside the box, it is not
> getting "blurry", just darker. It looks like povray is treating the
> scattering media as a single entity, rather than a near-infinite number of
> particles which it's supposed to represent. Kasuga_Kyousuke on povray irc
> advised me that radiosity will not fix this scene, because of the same
> reason: looking at the media as a single entity. Does anyone know of a way
> to make this work?
> 
> Thanks,
> Charles
> 
> PS. Intended result: candle wax with black bead embedded
> (http://www.turingbirds.com/personal/random/wax.png)
> PS2. adding absorption does not work; it only makes everything evenly darker
> 
> 
You use:
     media {
       intervals 10
        samples 1,1
        scattering  {5, 2 eccentricity 0.0}
     }
With the default sampling method used (methode 3, adaptive), it's prety slow.
If you remove "intervals 10" and replace samples 1,1 by samples 20, you will 
gain on quality AND speed.
Method 3 require at least 3 samples and works best with only 1 intervals. You 
may supply a second samples value but it will be ignored.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you prefer bald romatic partners, 
because they're easier to model.
John VanSickle


Post a reply to this message

From: Charles
Subject: Re: Physically accurate wax simulation
Date: 12 Sep 2007 04:40:00
Message: <web.46e7a4ff6612cd23489ab670@news.povray.org>
Hi everyone,

Thanks for your help, but it turns out that POVRay just cannot do this.
Radiosity is too much of a simplification. I downloaded the Kerkythea
renderer which supports path tracing, and got it to work in about 5
minutes.

Kind regards,
Charles


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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