POV-Ray : Newsgroups : povray.newusers : Glow effect problem Server Time
29 Jul 2024 06:26:56 EDT (-0400)
  Glow effect problem (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: Mike8
Subject: Re: Glow effect problem
Date: 30 Jan 2007 12:55:00
Message: <web.45bf857112efcd2e97986bf60@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> You can use looks_like to make a light have a visible object there.
> Then use a media glow in that object. It's important to remember
> that an object needs to be hollow to contain a visible media.
>
> //example
> light_source {
>   <0, 0, 0>
>   color rgb <1, 1, 1>
>   looks_like {
>      sphere{<0,0,0>,1
>         hollow
>         material {
>            texture {
>               pigment {Clear}
>            }
>            interior {
>               media{
>                  emission 0.75
>                  scattering {1, 0.5}
>                  density {
>                     spherical
>                     color_map {
>                        [0.0 rgb <0,0,0.5>]
>                        [0.5 rgb <0.8, 0.8, 0.4>]
>                        [1.0 rgb <1,1,1>]
>                     }
>                  }
>               }
>            }
>         }
>      }
>   }
> }
Thanks, the code works well, but I've hit another problem. My light source
is already contained in a translucent object, like a lightbulb.
Unfortunately, it seems to be blocking the glow effect. Is there a way to
correct this, without making the lightbulb invisible? Thanks.
Also, is it possible to add the same kind of glow effect to objects other
than light sources?
I hope I'm not asking to many questions. Thanks for everyone's input!
Michael


Post a reply to this message

From: Tim Attwood
Subject: Re: Glow effect problem
Date: 31 Jan 2007 01:26:03
Message: <45c0367b$1@news.povray.org>
> Thanks, the code works well, but I've hit another problem. My light source
> is already contained in a translucent object, like a lightbulb.
> Unfortunately, it seems to be blocking the glow effect. Is there a way to
> correct this, without making the lightbulb invisible? Thanks.

Media effects can't exist inside of a non-hollow object... so you
can just add the hollow keyword to your lightbulb object , or you
could difference out the insides.

object {LightBulb hollow ...}

or

global_settings {
   assumed_gamma 2.2
   max_trace_level 10
}

#declare glow = material {...};
#declare glass = material {
   texture {
      pigment {Clear}
      finish { phong 0.3
               reflection 0.3}
   }
   interior {ior 1.3}
};
#declare LightBulb = difference {
   sphere{<0,0,0>,1}
   sphere{<0,0,0>,0.99}
};
object{LightBulb material{glass}}

> Also, is it possible to add the same kind of glow effect to objects other
> than light sources?

You can use a media inside any hollow translucent object,
there doesn't need to be a light involved.

light_source {  <0, 0, 0>
  color rgb <1, 1, 1>
}
sphere {<0,0,0>,0.989 hollow material{glow}}

or

light_source {
  <0, 0, 0>
  color rgb <1, 1, 1>
  looks_like {
     sphere {<0,0,0>,0.989 hollow material{glow}}
 }
}

The looks_like removes the interaction of the light
and the media though, so if you don't use it the
light will be attenuated by the media.

You can also use a media statement alone, then it is
applied to the whole scene, (except inside non-hollow
objects), that's good for a hazy look but can be
somewhat slow.


Post a reply to this message

From: Alain
Subject: Re: Glow effect problem
Date: 31 Jan 2007 17:31:40
Message: <45c118cc$1@news.povray.org>
Mike8 nous apporta ses lumieres en ce 30-01-2007 12:50:
> "Tim Attwood" <tim### [at] comcastnet> wrote:
>> You can use looks_like to make a light have a visible object there.
>> Then use a media glow in that object. It's important to remember
>> that an object needs to be hollow to contain a visible media.
>>
>> //example
>> light_source {
>>   <0, 0, 0>
>>   color rgb <1, 1, 1>
>>   looks_like {
>>      sphere{<0,0,0>,1
>>         hollow
>>         material {
>>            texture {
>>               pigment {Clear}
>>            }
>>            interior {
>>               media{
>>                  emission 0.75
>>                  scattering {1, 0.5}
>>                  density {
>>                     spherical
>>                     color_map {
>>                        [0.0 rgb <0,0,0.5>]
>>                        [0.5 rgb <0.8, 0.8, 0.4>]
>>                        [1.0 rgb <1,1,1>]
>>                     }
>>                  }
>>               }
>>            }
>>         }
>>      }
>>   }
>> }
> Thanks, the code works well, but I've hit another problem. My light source
> is already contained in a translucent object, like a lightbulb.
> Unfortunately, it seems to be blocking the glow effect. Is there a way to
> correct this, without making the lightbulb invisible? Thanks.
Just make the lightbulb hollow, that way, it will be filled by the media.
You can also surround it with a somewhat larger, totaly transparent object, that 
will contain the media.
> Also, is it possible to add the same kind of glow effect to objects other
> than light sources?
Absolutely!
Just place another, larger transparent hollow object around it. Fill that shell 
with some emissive media.
> I hope I'm not asking to many questions. Thanks for everyone's input!
> Michael
> 
> 
> 
> 

By adding those transparent objects, you may get some dark spots. That appens 
when you reatch the max_trace_level. Just set it to a larger value in the 
global_settings block, the default value is 5.

-- 
Alain
-------------------------------------------------
No matter how much you do, you never do enough.


Post a reply to this message

From: Mike8
Subject: Re: Glow effect problem
Date: 1 Feb 2007 20:30:00
Message: <web.45c2940b12efcd2e9c03588e0@news.povray.org>
Hey all,

    Thank you to everyone, you've been extremely helpful! I have just one
more question on this subject. The media glow effect that I created using
the code all of you provided works very well. The only thing wrong with it,
is that the brightness of the glow doesn't fade at the edge, it's just a
sharp, though translucent, edge. I hope that makes sense. How can I change
this? Again, thanks for all of your help!
Michael


Post a reply to this message

From: Tim Attwood
Subject: Re: Glow effect problem
Date: 2 Feb 2007 01:57:56
Message: <45c2e0f4$1@news.povray.org>
>    Thank you to everyone, you've been extremely helpful! I have just one
> more question on this subject. The media glow effect that I created using
> the code all of you provided works very well. The only thing wrong with 
> it,
> is that the brightness of the glow doesn't fade at the edge, it's just a
> sharp, though translucent, edge. I hope that makes sense. How can I change
> this? Again, thanks for all of your help!

If you want to not see the edges you need to fade the color_map
for the density to clear at the edges.
[0.0 rgb <0,0,0>]


Post a reply to this message

From: Mike8
Subject: Re: Glow effect problem
Date: 4 Feb 2007 22:30:00
Message: <web.45c6a3d212efcd2e68bb41110@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> >    Thank you to everyone, you've been extremely helpful! I have just one
> > more question on this subject. The media glow effect that I created using
> > the code all of you provided works very well. The only thing wrong with
> > it,
> > is that the brightness of the glow doesn't fade at the edge, it's just a
> > sharp, though translucent, edge. I hope that makes sense. How can I change
> > this? Again, thanks for all of your help!
>
> If you want to not see the edges you need to fade the color_map
> for the density to clear at the edges.
> [0.0 rgb <0,0,0>]

Hey,
    Well, that works well in my small test scene, but in the main scene the
fade problem remains. The color map is
                      [0.0 rgb<0,0,0.5>]
                      [0.5 rgb<0.4,0.4,0.8>]
                      [1.0 rgb<1,1,1>]
At the very center, there is a white sphere. Everywhere else, there is
either a blue glow (the first rgb value) or nothing, depending on what I
input for the first rgb set. The code in the test scene and the main scene
is identical. What's going on? Thanks,
    Michael


Post a reply to this message

From: Tim Attwood
Subject: Re: Glow effect problem
Date: 5 Feb 2007 03:43:33
Message: <45c6ee35$1@news.povray.org>
> At the very center, there is a white sphere. Everywhere else, there is
> either a blue glow (the first rgb value) or nothing, depending on what I
> input for the first rgb set. The code in the test scene and the main scene
> is identical. What's going on? Thanks,

Color maps fade from 0 to 1 linearly, but the spherical pattern
is going along a curve. You can tweak the location and color
to suit what you want in the color map. The colors are added
to the background color, white tends to saturate...

However, the spherical pattern is located at the origin, to move
it you need to define it at the origin, and then translate it.
You won't see the spherical pattern if you just place the container
object elsewhere.

This is correct:
sphere {<0,0,0>,1 hollow material{glow} translate <0,1,0>}

This is wrong:
sphere {<0,1,0>,1 hollow material{glow} }


Post a reply to this message

From: Mike8
Subject: Re: Glow effect problem
Date: 8 Feb 2007 11:55:00
Message: <web.45cb55dc12efcd2eec8e142c0@news.povray.org>
"Tim Attwood" <tim### [at] comcastnet> wrote:
> Color maps fade from 0 to 1 linearly, but the spherical pattern
> is going along a curve. You can tweak the location and color
> to suit what you want in the color map. The colors are added
> to the background color, white tends to saturate...
>
> However, the spherical pattern is located at the origin, to move
> it you need to define it at the origin, and then translate it.
> You won't see the spherical pattern if you just place the container
> object elsewhere.
>
> This is correct:
> sphere {<0,0,0>,1 hollow material{glow} translate <0,1,0>}
>
> This is wrong:
> sphere {<0,1,0>,1 hollow material{glow} }

I'm sorry, I don't understand how that applies. Perhaps I explained badly.
In an empty test scene, the glow effect fades smoothly from the center to
the edge. The code follows:
light_source {<2,0,0> color White
   looks_like{
   sphere{<0,0,0>,1
     hollow
      material{
       texture{
        pigment{Clear}
        }
    interior{
    media{
      emission 0.75
      scattering {1, 0.5}
      density{
        spherical
        color_map{
          [0.0 rgb <0,0,0>]
          [0.5 rgb <1,1,1>]
          [1.0 rgb <1,1,1>]
}
}
}
That works perfectly. The glow in my main scene however, uses the same code
but does not fade. The different code segments follow:
light_source {
    <39.167,9.901,-40.446>
     color rgb <1,1,1>

And    interior{
        media{
         emission 0.75
         scattering {1, 0.5}
         density {
           spherical
           color_map{
            [0.0 rgb <0,0,0.5>]
            [0.5 rgb <.8,.8,1>]
            [1.0 rgb <1,1,1>]
}
}
}

I hope that clears this up! Thanks,
    Michael


Post a reply to this message

From: Tim Attwood
Subject: Re: Glow effect problem
Date: 8 Feb 2007 15:01:30
Message: <45cb819a@news.povray.org>
With media you are modeling a sphere
that is filled with a gas that varies in
color...
The final color depends on the background,
for example a red glow will appear purple
against a blue sky.
You can keep tweaking the size of the
sphere and the color map until you get
somewhat what you'd like.

In the real world, bright spots come from
a lens distortion effect at your eye.

Chris Colefax's include file models this by
placing a 2 dimensional disc with an
appropriate semi-transparent texture
near the camera. Some values are passed
by #declare to set the apparent location
of the glow, etc. In general for the type
of situation you are describing it would
be the better approach.
http://www.geocities.com/ccolefax/lenseffects.html

There's nothing keeping you from modeling
both the gas and the lens effect.


Post a reply to this message

From: Mike8
Subject: Re: Glow effect problem
Date: 8 Feb 2007 23:50:00
Message: <web.45cbfc6612efcd2ed646235f0@news.povray.org>
I think I understand. Thanks for your help!
Michael


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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