POV-Ray : Newsgroups : povray.newusers : Spark/Electricity : Re: Spark/Electricity Server Time
7 Jul 2024 06:48:14 EDT (-0400)
  Re: Spark/Electricity  
From: Alain
Date: 10 Apr 2010 00:40:27
Message: <4bc0013b$1@news.povray.org>


> I replaced the glow statement with the sphere below:
>
>
> //-------------------
> sphere{<0,0,0>, 1 pigment{ color rgbt 1 }
>      interior{
>      #local M_samples = 15;
>      #local M_variance = 1/500;
>          media
>          {
>              intervals 1
>              samples M_samples
>              confidence 1 - M_variance
>              variance m_variance
>              emission color rgb 1
>              method 3
>              aa_threshold 0.1
>              aa_level 4
>              //jitter 0.5
>              density{
>                  spherical
>                  poly_wave 1.5
>                  color_map{
>                  [0.00 color rgb 0 ]
>                  [0.80 color rgb ElectricColor(ValueM)*Brightness*2 ]
>                  [0.90 color rgb<1,1,1>*Brightness*75  ]
>                  [1.00 color rgb<1,1,1>*Brightness*200 ]
>                          }
>              }
>          }
>      }
>
> hollow
> #if(Thickness>0) scale Thickness  #else scale 0.50 #end
> translate PointM
> }
>
> //-------------------
>
> Note that this is a very quick and dirty hack job that suffers from several
> problems:
> *The media quality (as controlled by the samples parameter) is simply a
> placeholder number - you should be able to set the sample count via the macro.
> *The density statement needs work to achieve matching image output -
> particularly with the Brightness values.  The way media behaves when scaled
> means that the Brightness value must be taken into account when the in scene
> diameter (controlled by the Thickness parameter in the original macro) is very
> large or very small.
> *Depending on the number of objects and the view, you may have artifacts if the
> max_trace_level is hit.
> *The above version does not cast any light.
>
> Almost all of those problems can be addressed, but it'll probably take me a few
> days.  Also, I believe Rune still posts on here occasionally, and I'm sure he'd
> be interested in extending the functionality by making it compatible with
> current versions.
>
>      HTH,
>    -Reactor
>
>

For the density, you can divide Brightness by Thickness. That way, the 
density will change invertly to the dimention and keep the same apparent 
brightness.

To prevent the max_trace_level isue, bind the whole thing in a merge. 
This will remove the internal surfaces. In this case, it will also 
render faster, as you are ignoring many superfluous surfaces.

The glow did not cast light. If you want the spark to cast light, you 
have two options:
1 - Add several relatively faint light_source at the center of the 
various medias. All of those light_source also need fade_distance 
Thickness+0.01 fade_power 2. An intensity of 
ElectricColor(ValueM)*Brightness is a reasonable starting point but may 
be to strong as you can have over 100 lights.
2 - Use radiosity with "media on" to enable the media to cast light.

Both options will increase the rendering time.

The following media settings are no longer needed (obsolete): 
confidence, variance
The followings are all at default values and can be skipped:
intervals 1, method 3, aa_threshold 0.1, aa_level 4


Alain


Post a reply to this message

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