POV-Ray : Newsgroups : povray.advanced-users : light filter in media Server Time
3 Jul 2024 06:16:36 EDT (-0400)
  light filter in media (Message 1 to 8 of 8)  
From: Woody
Subject: light filter in media
Date: 23 Dec 2007 21:15:01
Message: <web.476f153cc3e5249f534b0ad0@news.povray.org>
Can someone help me out with this scene? I'm trying to create a glowing
cylindrical object (to look like a spotlight that fallsoff without using an
actual light source) and I'm getting some results that look like coincident
surfaces. Code is below.

Also, how would I go about modifying this so it does not look like a black end
has been pasted on a green cylinder?

#include "colors.inc"

#declare cam_pos=(x*4+y*3+z*-2)*2;
camera {
 location cam_pos
 look_at (x*1+y*0+z*0)*0.5


}


light_source {
 cam_pos
 color White
}

 cylinder { 0, <1,0,0>, 1

        pigment {
                gradient x
                pigment_map{
                        [0.0 color Green filter 1]
                        [0.05 color Green filter 1]
                        [0.8 color Green filter 0]
                        [1.0 color Green filter 0]
                }
        }
        hollow

        finish{ ambient 0.000 diffuse 0.000 specular 0}
        interior{
                media{
                        emission 1
        }       }
        scale x*3
}


light_source{
        cam_pos
        color White
}


Post a reply to this message

From: Jan Dvorak
Subject: Re: light filter in media
Date: 24 Dec 2007 02:44:55
Message: <476f6377@news.povray.org>
Woody napsal(a):
> Can someone help me out with this scene? I'm trying to create a glowing
> cylindrical object (to look like a spotlight that fallsoff without using an
> actual light source) and I'm getting some results that look like coincident
> surfaces. Code is below.
> 
make the cylinder a little bit shorter or scale the pigment. Your 
pigment has a sharp transition right on the {x,3} surface.


Post a reply to this message

From: Trevor G Quayle
Subject: Re: light filter in media
Date: 24 Dec 2007 09:25:01
Message: <web.476fc11381a774e8c150d4c10@news.povray.org>
"Woody" <nomail@nomail> wrote:
> Can someone help me out with this scene? I'm trying to create a glowing
> cylindrical object (to look like a spotlight that fallsoff without using an
> actual light source) and I'm getting some results that look like coincident
> surfaces. Code is below.

Coincident surfaces also occur with patterns like gradient.  There is a hard
transition from 1 back to zero at each frequency.  Adjust the map size or the
cylinder size as you would for any coincident surface.

-tgq


Post a reply to this message

From: Alain
Subject: Re: light filter in media
Date: 24 Dec 2007 15:32:31
Message: <4770175f$1@news.povray.org>
Woody nous apporta ses lumieres en ce 2007/12/23 21:11:
> Can someone help me out with this scene? I'm trying to create a glowing
> cylindrical object (to look like a spotlight that fallsoff without using an
> actual light source) and I'm getting some results that look like coincident
> surfaces. Code is below.
> 
> Also, how would I go about modifying this so it does not look like a black end
> has been pasted on a green cylinder?
I would alter the scene as follow:
> 
> #include "colors.inc"
> 
> #declare cam_pos=(x*4+y*3+z*-2)*2;
> camera {
>  location cam_pos
>  look_at (x*1+y*0+z*0)*0.5
> 
> 
> }
> 
> 
> light_source {
>  cam_pos
>  color White // add *2 if this light is not bright enough
> }
> 
  cylinder { 0, <1,0,0>, 1

         pigment {rgbt 1} // No need to see the container
         hollow

         finish{ ambient 0.000 diffuse 0.000 specular 0}
         interior{
                 media{
                         emission y/2 // to prevent the oversaturation
//adjust the colour to your taste
                         density {gradient -x scale 1.01}//prevent second ramp 
from apearing
         }       }
         scale x*3
}

> 
> //remove this second light. It will make the rendering faster.
> light_source{
>         cam_pos
>         color White
> }
> 
> 
Whenever you have more than 1 light_source at the same location you should 
replace them with a single one having the sum of all the original ones. It 
render faster as you now need only 1 shadow test instead of two, or more. The 
color value of a light is not limited to 1.
light_source{0 color 2}
and
light_source{0 color 1} light_source{0 color 1}
both have exactly the same effect on your scene.

-- 
Alain
-------------------------------------------------
But I thought YOU did the backups...


Post a reply to this message

From: Woody
Subject: Re: light filter in media
Date: 25 Dec 2007 19:50:00
Message: <web.4771a51a81a774e87ae6bc470@news.povray.org>
> Whenever you have more than 1 light_source at the same location you should
> replace them with a single one having the sum of all the original ones. It
> render faster as you now need only 1 shadow test instead of two, or more. The
> color value of a light is not limited to 1.
> light_source{0 color 2}
> and
> light_source{0 color 1} light_source{0 color 1}
> both have exactly the same effect on your scene.
>
> --
> Alain
> -------------------------------------------------
> But I thought YOU did the backups...

The double light was actually an accident. But thanks for the info. I was not
aware of light_sources being greater than 1. Thanks for all the good advice.


Post a reply to this message

From: Alain
Subject: Re: light filter in media
Date: 26 Dec 2007 14:21:38
Message: <4772a9c2@news.povray.org>
Woody nous apporta ses lumieres en ce 2007/12/25 19:49:
>> Whenever you have more than 1 light_source at the same location you should
>> replace them with a single one having the sum of all the original ones. It
>> render faster as you now need only 1 shadow test instead of two, or more. The
>> color value of a light is not limited to 1.
>> light_source{0 color 2}
>> and
>> light_source{0 color 1} light_source{0 color 1}
>> both have exactly the same effect on your scene.
>>
>> --
>> Alain
>> -------------------------------------------------
>> But I thought YOU did the backups...
> 
> The double light was actually an accident. But thanks for the info. I was not
> aware of light_sources being greater than 1. Thanks for all the good advice.
> 
> 
In the samples scenes, there is one with a light that have a value of 1000!

-- 
Alain
-------------------------------------------------
I drive way too fast to worry about cholesterol.


Post a reply to this message

From: Kenneth
Subject: Re: light filter in media
Date: 2 Jan 2008 02:30:00
Message: <web.477b3afd81a774e878dcad930@news.povray.org>
"Woody" <nomail@nomail> wrote:
> Can someone help me out with this scene? ...I'm getting some results that look
> like coincident surfaces.
>

Another solution would be to add a slight translation to your color_map, which
will pull its sharp index-list "crossover" position away from the cylinder's
end cap:

         pigment {
                 gradient x
                 pigment_map{
                         [0.0 color Green filter 1]
                         [0.05 color Green filter 1]
                         [0.8 color Green filter 0]
                         [1.0 color Green filter 0]
                            }
                  translate .0001*x

                  ...etc. ....

Ken W.


Post a reply to this message

From: Kenneth
Subject: Re: light filter in media
Date: 2 Jan 2008 02:45:01
Message: <web.477b3f5781a774e878dcad930@news.povray.org>
"Woody" <nomail@nomail> wrote:

> Also, how would I go about modifying this so it does not look like a black end
> has been pasted on a green cylinder?
>

Looking over your scene code and running it, I was wondering if the following
alternate code is what you're trying to achieve? I've reworked yours (and
eliminated the lights, which actually aren't necessary):

#include "colors.inc"

#declare cam_pos=(x*4+y*3+z*-2)*2;
camera {
 location cam_pos
 look_at (x*1+y*0+z*0)*0.5
}

 cylinder { 0, <1,0,0>, 1
   hollow
         pigment {color rgbt 1} // transparent

         finish{ ambient 0.000 diffuse 0.000 specular 0} // finish is optional
      // with this rgbt 1 object

        interior{
                media{
                        emission .6
                        density{
                            gradient x
                            color_map{
                               [0.0 color Green] // green media
                               [1.0 color rgb 0] // no media at all
                                     }
                               }
                     }
                }
        scale x*3
}

Ken W.


Post a reply to this message

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