POV-Ray : Newsgroups : povray.general : Re: Big whopping sparks Server Time
15 Oct 2026 03:59:31 EDT (-0400)
  Re: Big whopping sparks (Message 1 to 19 of 19)  
From: Rafal 'Raf256' Maj
Subject: Re: Big whopping sparks
Date: 15 May 2004 23:33:09
Message: <Xns94EB384D96A5Braf256com@203.29.75.35>
dva### [at] cedarnet news:40a6e00d@news.povray.org

> What sort of options are available for making big whopping sparks that
> light up the scene?

FOr questions please use povray.general (or .newusers).

As for sparks, You can use 
1) small bat very bright emission media
2) small spheres/etc with high ambient finish
3) real light sources

options 1) and 2) need radiosity and therefore are usualy slow, on the 
other hand using 3) is slow when YOu have too meany sparks.

Btw funny I was qoing to write a small FAQ/tutorial about it I hope You 
will find it usefull :)

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Dave VanHorn
Subject: Re: Big whopping sparks
Date: 16 May 2004 00:01:21
Message: <40a6e791$1@news.povray.org>
"Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote in message
news:Xns94EB384D96A5Braf256com@203.29.75.35...
> dva### [at] cedarnet news:40a6e00d@news.povray.org
>
> > What sort of options are available for making big whopping sparks that
> > light up the scene?
>
> FOr questions please use povray.general (or .newusers).

ALrighty then.. :)

> As for sparks, You can use
> 1) small bat very bright emission media
> 2) small spheres/etc with high ambient finish
> 3) real light sources

> options 1) and 2) need radiosity and therefore are usualy slow, on the
> other hand using 3) is slow when YOu have too meany sparks.

Well, 38 smallish sparks, and one big whopping one.

> Btw funny I was qoing to write a small FAQ/tutorial about it I hope You
> will find it usefull :)

Cool.


Post a reply to this message

From: Alain
Subject: Re: Big whopping sparks
Date: 16 May 2004 08:43:15
Message: <40a761e3$1@news.povray.org>
Dave VanHorn nous apporta ses lumieres ainsi en ce 2004/05/16 00:02... :

>"Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote in message
>news:Xns94EB384D96A5Braf256com@203.29.75.35...
>  
>
>>dva### [at] cedarnet news:40a6e00d@news.povray.org
>>
>>    
>>
>>>What sort of options are available for making big whopping sparks that
>>>light up the scene?
>>>      
>>>
>>FOr questions please use povray.general (or .newusers).
>>    
>>
>
>ALrighty then.. :)
>
>  
>
>>As for sparks, You can use
>>1) small but very bright emission media
>>2) small spheres/etc with high ambient finish
>>3) real light sources
>>    
>>
>
>  
>
>>options 1) and 2) need radiosity and therefore are usualy slow, on the
>>other hand using 3) is slow when YOu have too meany sparks.
>>    
>>
>
>Well, 38 smallish sparks, and one big whopping one.
>
>  
>
>>Btw funny I was qoing to write a small FAQ/tutorial about it I hope You
>>will find it usefull :)
>>    
>>
>
>Cool.
>
>
>  
>
With that kind of count, I'd go for solutions 1 and/or 2, could give you 
better results in less time.

Alain


Post a reply to this message

From: Dave VanHorn
Subject: Re: Big whopping sparks
Date: 16 May 2004 09:42:38
Message: <40a76fce$1@news.povray.org>
> With that kind of count, I'd go for solutions 1 and/or 2, could give you
> better results in less time.
>
> Alain

Ok, #1 sounds good, but how do you actually generate something that looks
spark-like?

I found an include file for Megapov, but I'd rather stick with Pov-ray.


Post a reply to this message

From: Alain
Subject: Re: Big whopping sparks
Date: 16 May 2004 10:24:11
Message: <40a7798b$1@news.povray.org>
Dave VanHorn nous apporta ses lumieres ainsi en ce 2004/05/16 09:43... :

>>With that kind of count, I'd go for solutions 1 and/or 2, could give you
>>better results in less time.
>>
>>Alain
>>    
>>
>
>Ok, #1 sounds good, but how do you actually generate something that looks
>spark-like?
>
>I found an include file for Megapov, but I'd rather stick with Pov-ray.
>
A merge of some narrow cylinders and sharp cones filed with media could 
be a starter. You may need some spheres to fill some gaps.
You can adjust the magapov include to use it with POV-Ray, it take some 
work and testing.

Alain


Post a reply to this message

From: John VanSickle
Subject: Re: Big whopping sparks
Date: 16 May 2004 12:28:09
Message: <40A79696.73CCE919@hotmail.com>
Rafal 'Raf256' Maj wrote:
> 
> dva### [at] cedarnet news:40a6e00d@news.povray.org
> 
> > What sort of options are available for making big whopping sparks that
> > light up the scene?
> 
> FOr questions please use povray.general (or .newusers).
> 
> As for sparks, You can use
> 1) small bat very bright emission media
> 2) small spheres/etc with high ambient finish
> 3) real light sources
> 
> options 1) and 2) need radiosity and therefore are usualy slow, on the
> other hand using 3) is slow when YOu have too meany sparks.
> 
> Btw funny I was qoing to write a small FAQ/tutorial about it I hope You
> will find it usefull :)

You can use small ambient=1 no_shadow objects to model the sparks, but
a light source for each spark may not always be needed; a light source
in the middle of a group of sparks may be enough to look realistic.

If the sparks are in motion, you need to model them as portions of
a tube, or use some kind of motion blur.

Regards,
John


Post a reply to this message

From: Daniel Nilsson
Subject: Re: Big whopping sparks
Date: 17 May 2004 12:30:53
Message: <40a8e8bd$1@news.povray.org>
In news:40a76fce$1@news.povray.org,
Dave VanHorn <dva### [at] cedarnet> typed:
> Ok, #1 sounds good, but how do you actually generate something that
> looks spark-like?
>
> I found an include file for Megapov, but I'd rather stick with
> Pov-ray.

I did a spark as a test once. I think it looks rather nice and it
renders quite fast too.
Furtunatly I still have the code around.

/ Daniel Nilsson

Cut here...

#include "colors.inc"
#include "metals.inc"

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

light_source { <0, 0, 0> rgb <0.1, 0.4, 1.0>
  area_light x*5.9, z*0.3, 5, 3
  adaptive 1
  fade_distance 4
  fade_power 2
}

sphere { <-4, 0, 0>, 1 texture { T_Chrome_2E } }
sphere { <4, 0, 0>, 1 texture { T_Chrome_2E } }
cylinder { <-4, 0, 0>, <-4, -10, 0>, 0.1 texture { T_Chrome_2E } }
cylinder { <4, 0, 0>, <4, -10, 0>, 0.1 texture { T_Chrome_2E } }

plane { y, -10 pigment { White } }

cylinder { <-4, 0, 0>, <4, 0, 0>, 1.1
  hollow
  pigment { Clear }
  interior {
    media {
      method 3            // 3
      aa_level 3          // 4
      aa_threshold 0.05   // 0.1
      samples 16, 100     // Min 1, Max 1
      intervals 1         // 10
      ratio 0.9           // 0.9
      confidence 0.9      // 0.9
      variance 1/128      // 1/128
      jitter 0

      emission 1
      density {
        cylindrical
        rotate z*90

        color_map {
          [ 0.00 Black ]
          [ 0.40 rgb <0.1, 0.4, 1.0>*0.1 ]
          [ 0.80 rgb <0.1, 0.4, 1.0>*0.5 ]
          [ 0.90 rgb <0.1, 0.4, 1.0>*1.0 ]
          [ 1.00 rgb <0.1, 0.4, 1.0>*10 ]
        }
        warp {
          turbulence 0.5     // amount of turbulence
          octaves 4          // optional turbulence modifiers
          lambda 2
          omega 0.5
        }
      }
    }
  }
}


Post a reply to this message

From: Dave VanHorn
Subject: Re: Big whopping sparks
Date: 17 May 2004 13:46:01
Message: <40a8fa59@news.povray.org>
> I did a spark as a test once. I think it looks rather nice and it
> renders quite fast too.
> Furtunatly I still have the code around.

Looks good, now I have to see if I can get it into my scene.
Two banks of nine, plus one whopping big one.

BTW: Does this sort of spark, act as a light source?


Post a reply to this message

From: Daniel Nilsson
Subject: Re: Big whopping sparks
Date: 17 May 2004 14:47:44
Message: <40a908d0@news.povray.org>
In news:40a8fa59@news.povray.org,
Dave VanHorn <dva### [at] cedarnet> typed:
>
> Looks good, now I have to see if I can get it into my scene.
> Two banks of nine, plus one whopping big one.

It's the cylinder with its media interior that is the spark (but you've
allready figured that out, I guess), change its length and/or scale it
to make it fit your scene then translate/rotate it in place.

> BTW: Does this sort of spark, act as a light source?

The spark in my code does not light up the scene by it self unless you
use radiosity (I have not tested that with this scene). I included one
area light to approximate the light from the spark.

/ Daniel Nilsson


Post a reply to this message

From: Dave VanHorn
Subject: Re: Big whopping sparks
Date: 17 May 2004 19:12:40
Message: <40a946e8$1@news.povray.org>
> It's the cylinder with its media interior that is the spark (but you've
> allready figured that out, I guess), change its length and/or scale it
> to make it fit your scene then translate/rotate it in place.

I'm having limited success.  I've got some control over it, but not having
any luck at scaling it out to the big spark, 22 inches long (22 pov units,
or 220 pov units, or... )  Everything I do is scaled in inches, mm, or some
other real unit, so that measured parts actually fit in the scene.

> > BTW: Does this sort of spark, act as a light source?
>
> The spark in my code does not light up the scene by it self unless you
> use radiosity (I have not tested that with this scene). I included one
> area light to approximate the light from the spark.

I have radiosity turned on, but how do I make the sparks act as light
sources?


Post a reply to this message

From: Dave VanHorn
Subject: Re: Big whopping sparks
Date: 17 May 2004 19:14:21
Message: <40a9474d$1@news.povray.org>
See badbig.jpg in the images group


Post a reply to this message

From: Alain
Subject: Re: Big whopping sparks
Date: 17 May 2004 20:32:41
Message: <40a959a9@news.povray.org>
Dave VanHorn nous apporta ses lumieres ainsi en ce 2004/05/17 19:12... :

>>It's the cylinder with its media interior that is the spark (but you've
>>allready figured that out, I guess), change its length and/or scale it
>>to make it fit your scene then translate/rotate it in place.
>>    
>>
>
>I'm having limited success.  I've got some control over it, but not having
>any luck at scaling it out to the big spark, 22 inches long (22 pov units,
>or 220 pov units, or... )  Everything I do is scaled in inches, mm, or some
>other real unit, so that measured parts actually fit in the scene.
>
>  
>
>>>BTW: Does this sort of spark, act as a light source?
>>>      
>>>
>>The spark in my code does not light up the scene by it self unless you
>>use radiosity (I have not tested that with this scene). I included one
>>area light to approximate the light from the spark.
>>    
>>
>
>I have radiosity turned on, but how do I make the sparks act as light
>sources?
>
>
>  
>
When radiosity is on, then any media with any emission is a light 
source. You may try uping the emission value (>1), or using colour 
values greater than 1.

Your big spark looks like the media is perpendicular to it's containing 
cylinder.

Alain


Post a reply to this message

From: Dave VanHorn
Subject: Re: Big whopping sparks
Date: 17 May 2004 21:57:50
Message: <40a96d9e@news.povray.org>
> When radiosity is on, then any media with any emission is a light
> source. You may try uping the emission value (>1), or using colour
> values greater than 1.

I've got them cranked to about 1600 peak now, which is pretty high..

> Your big spark looks like the media is perpendicular to it's containing
> cylinder.

Hmm. That might explain things.
Let me fiddle a bit more.

I wouldn't say I'm new to povray, I've been using it, and Vivid before it,
for design work since '91, but I don't work with it that often, and I don't
do this sort of thing with it much at all.


Post a reply to this message

From: Dave VanHorn
Subject: Re: Big whopping sparks
Date: 17 May 2004 22:36:53
Message: <40a976c5$1@news.povray.org>
I may have something twisted.
There's a rotate Z*90 down there that I don't understand, but it seems much
the same either way.
In my "universe", things are scaled as <(5 * Inch), (3 * Foot), (2.5 *
Meter)> which makes it easy to keep dimensions sane when moving pieces
between projects.
I haven't tired (much) to convert this spark to my system yet.


//The tight core, purple-white
#declare Discharge_Spark = object { cylinder { <-1,0,-11>, <1,0,11>, 1}
                                      hollow
                                      pigment { Clear }
                                      interior { media { method 3
// 3
                                                         aa_level 4
// 4
                                                         aa_threshold 0.1
// 0.1
                                                         samples 16, 100
// Min 1, Max 1
                                                         intervals 10
// 10
                                                         ratio 0.9
// 0.9
                                                         confidence 0.9
// 0.9
                                                         variance 1/128
// 1/128
                                                         jitter 0
                                                         emission 1
                                                         density {
cylindrical
                                                                   //rotate
z*90
                                                                   color_map
{ [ 0.00 Black ]

[ 0.40 rgb <0.1, 0.4, 1.0> *  2 ]

[ 0.80 rgb <0.1, 0.4, 1.0> *  20 ]

[ 0.90 rgb <0.1, 0.4, 1.0> *  40 ]

[ 1.00 rgb <0.1, 0.4, 1.0> * 600 ]
                                                                            
 }
                                                                   warp {
turbulence 0.50     // amount of turbulence

octaves 3          // optional turbulence modifiers

lambda 0.1

omega 0.5
                                                                        }
                                                                  }
                                                        }
                                                }
                                                  scale<(1 * Inch),(1 *
Inch),(1 * Inch)>
                                                  }


Post a reply to this message

From: Christopher James Huff
Subject: Re: Big whopping sparks
Date: 19 May 2004 17:34:26
Message: <cjameshuff-34E370.16344519052004@news.povray.org>
In article <40a959a9@news.povray.org>, Alain <aze### [at] qwertygov> wrote:

> When radiosity is on, then any media with any emission is a light 
> source. You may try uping the emission value (>1), or using colour 
> values greater than 1.

Not quite...media interaction defaults to off. You need to specify 
"media on" in your radiosity settings.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Dave VanHorn
Subject: Re: Big whopping sparks
Date: 19 May 2004 21:15:36
Message: <40ac06b8$1@news.povray.org>
"Christopher James Huff" <cja### [at] earthlinknet> wrote in message
news:cjameshuff-34E370.16344519052004@news.povray.org...
> In article <40a959a9@news.povray.org>, Alain <aze### [at] qwertygov> wrote:
>
> > When radiosity is on, then any media with any emission is a light
> > source. You may try uping the emission value (>1), or using colour
> > values greater than 1.
>
> Not quite...media interaction defaults to off. You need to specify
> "media on" in your radiosity settings.

I'm confused.
Reading on media, everything seems to be about fog-like behaviour, and not
about emitting light.

I need Big Whopping Sparks that emit light.

See the latest in the images group, under "Big Whopping Sparks".


Post a reply to this message

From: Christopher James Huff
Subject: Re: Big whopping sparks
Date: 20 May 2004 00:53:27
Message: <cjameshuff-192642.23534319052004@news.povray.org>
In article <40ac06b8$1@news.povray.org>,
 "Dave VanHorn" <dva### [at] cedarnet> wrote:

> I'm confused.
> Reading on media, everything seems to be about fog-like behaviour, and not
> about emitting light.
> 
> I need Big Whopping Sparks that emit light.
> 
> See the latest in the images group, under "Big Whopping Sparks".

Emitting media glows, rather than absorbing or scattering light. If 
radiosity is on and "media on" is used, it will take media into account 
when computing radiosity lighting, and emitting media (or brightly lit 
scattering media) will cast a glow on nearby surfaces. (Media doesn't 
take radiosity into account, though...a bright surface won't illuminate 
nearby scattering media. That would be very slow, though it may be 
possible to make it reasonably fast with something like photon mapping.)

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Dave VanHorn
Subject: Re: Big whopping sparks
Date: 20 May 2004 01:10:52
Message: <40ac3ddc$1@news.povray.org>
> Emitting media glows, rather than absorbing or scattering light. If
> radiosity is on and "media on" is used, it will take media into account
> when computing radiosity lighting, and emitting media (or brightly lit
> scattering media) will cast a glow on nearby surfaces.

I am, but I'm not seeing the result.
These sorts of sparks are <BRIGHT>, and even in outdoor full daylight, I
would expect to see them cast light on the scene.  They are also <<LOUD>>
but there's no good way to convey that in pov ray.  The charachter of the
sound is quite unique.


> (Media doesn't
> take radiosity into account, though...a bright surface won't illuminate
> nearby scattering media. That would be very slow, though it may be
> possible to make it reasonably fast with something like photon mapping.)

How can I get this to cast a noticeable light on the scene?


Here's my "fast" radiosity settings:
                  radiosity { pretrace_start 0.50
                              pretrace_end   0.005
                              count 50
                              error_bound 0.5
                              recursion_limit 1
                              media on
                              normal off
                            }
                  photons { spacing 1 }
                  max_trace_level 10

So here's my spark:

//The tight core, purple-white
#declare Discharge_Spark = object { cylinder { <-1,0,-10>, <1,0,10>, 4}
                                      hollow
                                      pigment { Clear }
                                      interior { media { method 3
// 3
                                                         aa_level 4
// 4
                                                         aa_threshold 0.1
// 0.1
                                                         samples 16, 100
// Min 1, Max 1
                                                         intervals 1
// 10
                                                         ratio 0.9
// 0.9
                                                         confidence 0.9
// 0.9
                                                         variance 1/128
// 1/128
                                                         jitter 0
                                                         emission <10,10,12>
//High values obscure the core
                                                         density {
cylindrical
                                                                   rotate
x*90
                                                                   color_map
{ [ 0.00 Black ]

[ 0.40 rgb <0.15, 0.4, 1.0> *  0.02 ]

[ 0.85 rgb <0.15, 0.4, 1.0> *  .1 ]

[ 0.95 rgb <0.05, 1.0, 0.05> *  5 ] //Accent

[ 0.96 rgb <0.15, 0.4, 1.0> *  .2 ]

[ 0.99 rgb <0.15, 0.4, 1.0> * 60 ]
                                                                            
 }
                                                                   warp {
turbulence <0.1, 1, 0.1>     // amount of turbulence

octaves 8 // 10- too much         // optional turbulence modifiers

lambda 5 // 10 is "grainy"

omega 0.2 //0.1 sinuous 0.9 chaotic
                                                                        }
                                                                  }
                                                        }
                                                }
                                                  scale<(1 * Inch),(1 *
Inch),(1 * Inch)>
                                                  }


Post a reply to this message

From: Christopher James Huff
Subject: Re: Big whopping sparks
Date: 23 May 2004 14:18:34
Message: <cjameshuff-A8CA65.13185923052004@news.povray.org>
In article <40ac3ddc$1@news.povray.org>,
 "Dave VanHorn" <dva### [at] cedarnet> wrote:

> I am, but I'm not seeing the result.
> These sorts of sparks are <BRIGHT>, and even in outdoor full daylight, I
> would expect to see them cast light on the scene.  They are also <<LOUD>>
> but there's no good way to convey that in pov ray.  The charachter of the
> sound is quite unique.

Full daylight is bright. Unless you're very careful how you set things 
up, you are likely to just get washed out colors...remember that 
computer displays have a very limited range of brightness. If fully 
sun-lit white is 100% brightness, what's sun-lit + spark-lit white going 
to be? 100%.

Anyway, radiosity also isn't going to give you sharp shadows. It'd 
really only be good for giving an area with lots of sparks an overall 
glow.


> So here's my spark:

Uh...I think your indentation scheme needs a little work.
Anyway, you've done everything necessary to have the spark emit light, 
now you just need surroundings suitable for showing the emitted light. 
Also note that because you have no absorption to your media, it will not 
show up in front of bright backgrounds...the limited dynamic range 
problem again.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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