POV-Ray : Newsgroups : povray.newusers : Fade to white? Server Time
25 Nov 2024 09:24:49 EST (-0500)
  Fade to white? (Message 1 to 4 of 4)  
From: Joost de Greef
Subject: Fade to white?
Date: 19 Mar 2006 07:57:54
Message: <441d5552@news.povray.org>
Hi!

I'm new to POVRAY, and running into small problems. I would like to draw 
some balls on a white background, and have some kind of depth-queueing.
So basically, I would like to have the ball closest to the camera in full
color, while the ones further away fade to white. At best I seem to manage
to fade everything to grey, background including.
  Could someone please shed some Light on the issue for me? I've searched 
the net on various terms I could come up with, but being am absolute
beginner, my POVRAY-vocabulary is rather limited...

Thank you very much for your time!
Joost de Greef.
---- my futile attempts ----
#include "colors.inc"

background { White }

global_settings
{ max_trace_level 100 ambient_light rgb<1, 1, 1> }

light_source
{ <-100,4*100,100> color White shadowless }

/* makes the background black
fog
{
  fog_type 2
  fog_offset 0.0
  fog_alt 0.0
  up <1,0,0>
  distance 1
  color rgbt<1,1,1,0.9>
  rotate <0,0,90>
} 
*/

/* makes the background grey.
plane 
{
  y, 1
  texture
  {
    pigment
    {
      color rgbft <1,1,1,0.1,0.1>
    }
  }  
  hollow interior {fade_power 2.0 fade_distance 3}
}
*/
  
camera
{ orthographic location <0, 2, 0> look_at <0, 0, 0>
  right image_width/image_height*x*3 up y*3 }

object
{ union {
    sphere { <-1,-1, 0>, 1 pigment { color Blue } }
    sphere { < 0, 0, 0>, 1 pigment { color Blue } }
    sphere { < 1, 1, 0>, 1 pigment { color Blue } } } }


Post a reply to this message

From: Chris B
Subject: Re: Fade to white?
Date: 19 Mar 2006 08:55:32
Message: <441d62d4@news.povray.org>
"Joost de Greef" <gro### [at] gmailcom> wrote in message 
news:441d5552@news.povray.org...
> Hi!
>
> I'm new to POVRAY, and running into small problems. I would like to draw
> some balls on a white background, and have some kind of depth-queueing.
> So basically, I would like to have the ball closest to the camera in full
> color, while the ones further away fade to white. At best I seem to manage
> to fade everything to grey, background including.
>  Could someone please shed some Light on the issue for me? I've searched
> the net on various terms I could come up with, but being am absolute
> beginner, my POVRAY-vocabulary is rather limited...
>
> Thank you very much for your time!
> Joost de Greef.

Hi Joost,

You might want to try:

fog {
  fog_type 1
  distance 0.7
  color rgbt<1,1,1,0>
}

Regards,
Chris B.


Post a reply to this message

From: Chris B
Subject: Re: Fade to white?
Date: 19 Mar 2006 09:50:58
Message: <441d6fd2$1@news.povray.org>
"Chris B" <c_b### [at] btconnectcomnospam> wrote in message 
news:441d62d4@news.povray.org...
>
> "Joost de Greef" <gro### [at] gmailcom> wrote in message 
> news:441d5552@news.povray.org...
>> Hi!
>>
>> I'm new to POVRAY, and running into small problems. I would like to draw
>> some balls on a white background, and have some kind of depth-queueing.
>> So basically, I would like to have the ball closest to the camera in full
>> color, while the ones further away fade to white. At best I seem to 
>> manage
>> to fade everything to grey, background including.
>>  Could someone please shed some Light on the issue for me? I've searched
>> the net on various terms I could come up with, but being am absolute
>> beginner, my POVRAY-vocabulary is rather limited...
>>
>> Thank you very much for your time!
>> Joost de Greef.

Hello Again,

Here's an alternative using fog_type 2.
(It took me a while to work out what the settings were doing with type 2).

fog {
  fog_type 2
  fog_offset 1
  fog_alt 0.01
  distance 0.5
  color rgbf<1,1,1,1>
}

Type 2 is ground fog which by default creates fog relative to the X-Z plane 
and fades as it passes up the Y-Axis
Your camera is above the 3 spheres in the direction of the Y-axis, looking 
back down at the origin, so I think that having the fog fade as it 
approaches the camera is probably already what you want. In fact I think 
that the actual fading is probably not as interesting to you as the offset, 
which can provide a contant density of fog up to a given distance along the 
up-vector (in this case defaulted to the positive Y-axis).

Therefore the above example gives you a constant fog below the offset, which 
is set to 1 unit along the positive Y-Axis. This lines up with the centre of 
the sphere closest the camera. Above that offset (ie between the middle of 
the top sphere and the camera) the fog tails off pretty quickly, so doesn't 
have a significant effect on the color of the top sphere. Below that you get 
a constant fog, with the distance attribute describing the distance at which 
about one third of the light from the object is still visible. In the 
example above we get to see one third of the light at a distance of half a 
unit into the fog, which is about half way down the visible half of the 
sphere centred at the origin.

I've used a filter of 1 on the fog color to say 'filter all of the light 
from the object in the scene'.
You could use a low translucency setting instead (e.g. 0) and it should give 
you the same sort of effect.

Hope that helps.
Regards,
Chris B.


Post a reply to this message

From: grobbeltje
Subject: Re: Fade to white?
Date: 19 Mar 2006 10:32:55
Message: <441d79a7@news.povray.org>
Chris B <c_b### [at] btconnectcomnospam> wrote:
> Here's an alternative using fog_type 2.
> (It took me a while to work out what the settings were doing with type 2).
> 
> fog {
>   fog_type 2
>   fog_offset 1
>   fog_alt 0.01
>   distance 0.5
>   color rgbf<1,1,1,1>
> }
[very detailed (and usefull) explanation snipped]

> Hope that helps.
> Regards,
> Chris B. 
It certainly does!

Thank you very much for the quick response.

Have a nice day.
Joost.
-- 
Putting a computer in front of a child and expecting it to teach him
is like putting a book under his pillow, only more expensive.


Post a reply to this message

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