POV-Ray : Newsgroups : povray.general : Lights in an object : Re: Lights in an object Server Time
30 Jul 2024 16:24:24 EDT (-0400)
  Re: Lights in an object  
From: Dave VanHorn
Date: 28 Oct 2008 10:45:01
Message: <web.4907254237e3ca30a08ed15e0@news.povray.org>
"Bob Hughes" <omniverse charter net> wrote:
> "Dave VanHorn" <mic### [at] gmailcom> wrote in message
> news:web.49063d6478db427ea08ed15e0@news.povray.org...
> >
> > The cylinder object gives me a nice looking fire, (complicated)
> > and the chalice object is fine, but the light sources which should be up
> > in the
> > fire object, don't seem to get OUT.
>
>
> Hmmmm. You don't show what your Flame is made of, such as filtered pigment
> or media, but I'm not sure why you aren't seeing any light from the fire. I
> ran a render of what you are trying using my own fire material and other
> than no_shadow preventing shadowing from the fire cylinder I can see the
> light source.

It's a complicated thing, but it's not causing the lights not to get out.


> Your area_light isn't what I've ever used or recall seeing used, having no
> perpendicular axis to make the grid of lights. And yet that doesn't seem to
> be the actual problem you are getting there, if mine rendered the same here.

The docs say you can make it a linear light by doing X1 in one axis.

> Just to be sure, I changed it to be <1,0,0>,<0,2,0>,5,10 so I could see
> everything else wasn't wrong in some way.
> Something to keep in mind about area_light is how it is still like a point
> source when it comes to location and other things unrelated to the shadowing
> it causes. So other than shadows it is like a regular point of light.

Right.. I'm seeing light from it now, but I'm not seeing the softened shadows,
which I should be..

> Also not knowing your Chalice object means it is possible a surface is
> obscuring the light. There might be a clue by how your fire object has a
> bottom slightly above the light_source, perhaps meaning your Chalice has a
> surface at the same place? So remember area_light remains a point-like
> source based on its location and not the grid being created.

It should be, but not completely.  That's what I intend.
I thought I'd outsmart it and use a "looks like" to find out where the lights
are, but that just gives one sphere no matter how many lights I specify.


This version is sort of working..

#declare Fire = object { union { cylinder { <0,0.01,0>, <0,3,0>, 1.0 hollow
                                            material { Flame }
                                            translate <-0,0.5,0>
                                            no_shadow
                                          }
                                 object { Chalice rotate <0, 0, 0>
                                          photons { target 1.0
                                                    refraction off
                                                    reflection on
                                                  }
                                        }
                                 light_source { <0,0,0>
// light's position
                                                color rgb 0.250
// light's color
                                                area_light
                                                <0.0, 0.0, 0.0> <0.0, 1.0, 0.0>
// lights spread out across this distance (x * z)
                                                1, 8
// total number of lights in grid (4x*4z = 16 lights)
                                                adaptive 1
// 0,1,2,3...
                                                fade_distance 2
//
                                                fade_power 2
//
                                                translate <0, 2.0, 0>
//
                                                // Good for locating the lights
                                                looks_like {sphere { <0, 0, 0>,
0.25 }}
                                              }
                               }
                      }




#declare Chalice = object { union { cone { 1*y,  0.75,
                                          0, 0.0
                                          open
                                          //material { M_Glass }
                                          texture { T_Brass_3E
                                                    normal { bumps 0.1 scale
0.05 }
                                                  }

                                        }
                                   cone { 1*y,  0.0,
                                          0, 0.75
                                          open
                                        }
                                  }
                          }



#declare Flame = material { texture { pigment {rgbt 1.00} } // Just plain clear
                 interior {

                            //Explosive interior
                            media { // POV-Ray supports three types of media:
emissive,
                                    // absorbing, and scattering. "emission" is
self-illuminated
                                    // media. it will not cast light on other
objects, but it
                                    // has the appearance of glowing.
"absorption" blocks light
                                    // instead of emits light. absorbing media
casts shadows on
                                    // other objects. "scattering" media is lit
by other
                                    // light sources, and can scatter light. it
is substantially
                                    // slower to render than the other two
types, however, it
                                    // can be used with photons to create
effects like
                                    // visible sunbeams
                                    emission 5.0
                                    absorption 5.5

                                    // LAYER 1
                                    //
                                    // for our first layer, we'll blend the edge
of the sphere
                                    // to transparent. this will make edges less
obvious and help
                                    // hide the fact that the media is contained
inside a sphere.
                                    // we want it to look free-floating, so it's
important to
                                    // disguise the edges

                                    density { spherical
                                              density_map { [0.0 rgb <0.0, 0.0,
0.0>]
                                                            [1.0 rgb <1.0, 1.0,
1.0>]
                                                          }
                                            }


                                    // LAYER 2
                                    //
                                    // explosions usually have bright centers.
for our second layer,
                                    // we'll give the explosion a "hot" core by
multiplying past
                                    // the 1.0 range in the center... POV-Ray
doesn't support HDRI
                                    // (the MegaPOV build does) but this trick
works nonetheless


                                    density { spherical
                                              density_map { [0.7 rgb <1.0, 1.0,
1.0>]
                                                            [1.0 rgb <8.0, 8.0,
8.0>]
                                                          }
                                            }



                                    // LAYER 3
                                    //
                                    // now that we've blocked out the general
shape of our media,
                                    // for our third layer we want to get it
looking more cloud-like
                                    // and less like a ball. we'll do that by
adding some soft, low
                                    // frequency turbulence

                                    density { spherical
                                              density_map { [0.00 rgb <0.0, 0.0,
0.0>]
                                                            [0.20 rgb <0.5, 0.0,
0.0>]
                                                            [0.40 rgb <0.8, 0.4,
0.0>]
                                                            [0.85 rgb <0.2, 0.2,
0.6>]
                                                            [0.95 rgb <0.1, 0.1,
1.0>]
                                                          }

                                              // here's where the magic
happens... a low turbulence setting
                                              // causes our media to take on a
soft, cloud-like shape

                                              warp { turbulence 0.6
                                                     lambda 1.5
                                                     // low omega values create
soft, blurry results;
                                                     // higher values are crisp
and wrinkly
                                                     omega 0.50
                                                   }


                                              // this warp causes the explosion
to look like the particulate
                                              // is ejecting from the center by
pulling in all of the color
                                              // toward the center... I haven't
tried it, but I bet you
                                              // could do some nifty animations
by adding a clock term to
                                              // one of these values

                                              warp { black_hole <0.0, 0.0, 0.0>,
2.0
                                                     strength .95
                                                     falloff 2.5
                                                   }

                                             }

                                  //
                                  // LAYER 4
                                  //
                                  // explosions have lots of detail, with many
fine swirls and
                                  // eddies. we can simulate this by using a
high-frequency
                                  // turbulence value. again, we'll multiply
past 1.0 to keep
                                  // the explosion "hot"

                                  density { spherical density_map { [0.0 rgb
<0.0, 0.0, 0.0>]
                                                                    [0.1 rgb
<1.0, 0.0, 0.0> * .75]
                                                                    [0.2 rgb
<1.0, 0.5, 0.0> * .75]
                                                                    [0.8 rgb
<1.0, 1.0, 2.0> * 2.5]
                                                                  }
                                            warp { turbulence 1.5
                                                   lambda 2.5
                                                   omega 0.55
                                                   octaves 7
                                                 }
                                            scale .75

                                            warp { black_hole <0.0, 0.0, 0.0>,
2.0
                                                   strength .8
                                                   falloff 2.0
                                                 }
                                          }


                                  // if you find that you have glitches or black
spots in
                                  // your media, try turning up the number of
samples.
                                  // more samples will cause it to render
slower, so don't
                                  // turn it up more than you need to
                                  samples 20
                                  scale <0.500, 2.00, 0.500>
                                  translate <0.0, 1.0, 0.0>
                                 }
                               }
                          }


Post a reply to this message

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