POV-Ray : Newsgroups : povray.newusers : A few problems : Re: A few problems Server Time
29 Jul 2024 12:17:40 EDT (-0400)
  Re: A few problems  
From: Abe
Date: 1 Jan 2006 16:30:01
Message: <web.43b845d28c0fdebea1533070@news.povray.org>
> 3) The blue planet has a thin "atmosphere" that I made with a thin spherical
> shell containing blue-colored scattering media. The trouble is that the
> atmosphere cuts off abruptly and looks awful. How do I get spherical
> density_maps to work with scattering media so that the atmosphere drops off
> gradually? I can't get them to work at all; POVRay keeps complaining at me
> if I try.

I've used the following approach in the past:
#include "functions.inc"
#declare Atmos=
sphere {
  0, PlanetSize+AtmosHt
  hollow
  texture {
    pigment {color rgbt 1}
    finish{specular 0  ambient 0 diffuse 0}
  }
  interior{
    media{
      scattering{1 rgb AtmosIntensity*<.4,.5,1>/PlanetSize extinction 0}
      density{
       function{min(1,max(0,f_sphere(x,y,z,PlanetSize)/AtmosHt))}
       poly_wave AtmosFalloff
       color_map{[0 rgb 1][1 rgb 0]}
      }

    }
  }
  translate PlanetPosition
}

Note that the values for PlanetSize, PlanetPosition, AtmosHt, AtmosFalloff
and AtmosIntensity obviosly need to be declared. I was playing with values
of 0.2 and 2 for AtmosFalloff and AtmosIntensity respectively with ok
results under a light_source color of rgb <1,1,1>.

The reason for dividing the media intensity by planet size is to keep the
media "intensity" somewhat constant irrespective of container size.

The function f_sphere is clamped and scaled so as to return 0 at (and below)
the planet's surface increasing to 1 at (and above) a distance of AtmosHt
from the planet's surface.

You could probably also use a tight area light instead of a point light for
the sun to soften the terminator a bit. Remember to take advantage of
circular and orient.

> 4) This one's kind of subtle. The dust ring is also made of scattering media
> and circles the entire planet. There is a small region near the night side
> of the planet where light scatters from the ring and passes through the
> atmosphere but it ends up brown instead of blue. It's as if the atmosphere
> is absorbing the blue light from the scattered rays instead of scattering
> them again. Is that supposed to happen? and how do I fix it?

If you did not explicitly set the extinction value in the scattering
statement for your media then you are using the default extinction value of
1. Set the extinction value to 0 to eliminate the attenuation effect.

Let us know what works for you!

Abe


Post a reply to this message

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