POV-Ray : Newsgroups : povray.newusers : Improved Starfield Server Time
1 Nov 2024 23:15:24 EDT (-0400)
  Improved Starfield (Message 1 to 2 of 2)  
From: Jeff
Subject: Improved Starfield
Date: 9 Nov 2004 05:15:01
Message: <web.419097ec7fb2550ba305bce00@news.povray.org>
Comments and suggestions for improvement are welcomed.

The "physics" of the "tinting sphere" were derived from "Sky Catalogue
2000.0" by Cambridge University Press. It *approximates" the "real"
distribution of stars by color. This method is NOT perfect (think the logic
all of the way through) and I DID tweak the spectrum a bit for a more
pleasing appearance.

To change from tinted stars to all-white, remove or comment out the second
sphere with a radius of 9,899,999.

This code is "medium density" - to go to a light density, change the
color_map falloff point in the outer sphere (radius 9,900,000) from 0.100
to 0.050, and change the pigment scale from 50000 to 75000. To go to a
heavier density change the color_map falloff from 0.100 to 0.200 and change
the pigment scale from 50000 to 25000.

// Persistence Of Vision raytracer version 3.6.1
// StarsTD2.pov SCENE file

// ********************************************************************
camera {
    perspective
    location <0.00,0.00,0.00>
    angle 45.00
    look_at  <0.00,0.00,1.00>
}
// ********************************************************************

sphere { <0,0,0>,9900000 hollow no_reflection
  pigment { crackle form <1,0,0>
    color_map {
      [0.000 0.100 color rgb <1.00,1.00,1.00> color rgb <1.00,1.00,1.00>]
      [0.100 1.000 color rgb <0.00,0.00,0.00> color rgb <0.00,0.00,0.00>]
       }
     scale 50000
    }
  finish {ambient 1 diffuse 0}
}

sphere { <0,0,0>,9899999 hollow no_reflection no_shadow
  pigment { bozo cubic_wave noise_generator 3
    color_map {
      [0.000 0.005 color rgbf <0.40,0.40,1.00,1.00> color rgbf
<0.40,0.40,1.00,1.00>]
      [0.005 0.107 color rgbf <0.60,0.60,1.00,1.00> color rgbf
<0.60,0.60,1.00,1.00>]
      [0.107 0.300 color rgbf <0.70,0.70,1.00,1.00> color rgbf
<1.00,1.00,1.00,1.00>]
      [0.300 0.466 color rgbf <1.00,1.00,1.00,1.00> color rgbf
<1.00,1.00,1.00,1.00>]
      [0.466 0.618 color rgbf <1.00,1.00,1.00,1.00> color rgbf
<1.00,1.00,0.60,1.00>]
      [0.618 0.963 color rgbf <1.00,0.90,0.30,1.00> color rgbf
<1.00,0.40,0.40,1.00>]
      [0.963 1.000 color rgbf <1.00,0.40,0.40,1.00> color rgbf
<1.00,0.40,0.40,1.00>]
       }
    turbulence 0.9
    scale 30000
   }
  finish {ambient 0 diffuse 0}
}


Post a reply to this message

From: Jeff
Subject: Re: Improved Starfield
Date: 9 Nov 2004 22:40:01
Message: <web.41918c8d98c849a8819ea3080@news.povray.org>
All right, that first post showed some inexperience.

Originally, I tried layering PIGMENTS onto ONE big sphere with this
structure: sphere { pigment (StarDots} pigment {StarTints} finish {ambient
1 diffuse 0} }.

That didn't work for a couple of reasons, so I decided that in order for me
to do what I wanted, I had to use a series of nested spheres - as in my
first post in this thread, the outer sphere for the stars, the inner sphere
to tint the stars. This is cumbersome and slows PovRay down. But the last
time I touched a raytracer was PovRay 3.1g, a few years ago. It never
occured to me to layer *textures* onto ONE sphere.

Now I am using ONE big sphere such as : sphere { texture{pigment{StarDots}
finish{ambient 1 diffuse 0}} texture {pigment{StarTints} finish{ambient 0
diffuse 0}} .. texture{OtherTextures} }.

This yields almost exactly the same result, uses less memory and is faster.
On my archaic P166 system, the first method with two spheres took 00:14:23
(863 seconds) for a high-density starfield. Adding MORE semitransparant
inner spheres for additional effects such as obscuration would certainly
increase rendering time significantly. The second method with just one
sphere and two texture layers takes 00:11:10 (670 seconds). AND I found
that adding a third, fourth etc. layer for "special effects" does NOT slow
the render down much.

Also: I tweaked the colors. The first attempt was to provide a "realistic"
distribution of star colors. But I tweaked it to be more esthetically
pleasing.

Here is a version - ONE sphere, four layers - the top two layers provide
magnitude variation/obscuration, AND a glowing band - kind of like the
Milky Way running from upper right to lower left.

// Persistence Of Vision raytracer version 3.6.1
// MilkyWay.pov SCENE file

// ********************************************************************
camera {
    perspective
    location <0.00,0.00,0.00>
    angle 45.00
    look_at  <0.00,0.00,1.00>
}
// ********************************************************************

sphere { <0,0,0>,9900000 hollow no_reflection

 texture {
  pigment { crackle form <1,0,0>
    color_map {
      [0.000 0.200 color rgb <1.00,1.00,1.00> color rgb <1.00,1.00,1.00>]
      [0.200 1.000 color rgb <0.00,0.00,0.00> color rgb <0.00,0.00,0.00>]
       }
     scale 25000
    }
   finish {ambient 1 diffuse 0}
 }

 texture {
  pigment { bozo cubic_wave noise_generator 3
    color_map {
      [0.000 0.450 color rgbf <0.60,0.60,1.00,1.00> color rgbf
<1.00,1.00,1.00,1.00>]
      [0.450 0.550 color rgbf <1.00,1.00,0.60,1.00> color rgbf
<1.00,1.00,1.00,1.00>]
      [0.550 1.000 color rgbf <1.00,0.60,0.60,1.00> color rgbf
<1.00,1.00,1.00,1.00>]
       }
     turbulence 0.9
     scale 50000
    }

  finish {ambient 0 diffuse 0}
 }

 texture {
  pigment { gradient x phase 0.5
    color_map {
      [0.000 0.500 color rgbf <0.30,0.30,0.30,1.00> color rgbf
<1.00,1.00,1.00,1.00>]
      [0.500 1.000 color rgbf <1.00,1.00,1.00,1.00> color rgbf
<0.30,0.30,0.30,1.00>]
       }
     turbulence 0.5
     scale 7000000
     rotate <0,0,-70>
    }
  finish {ambient 0 diffuse 0}
 }

 texture {
  pigment { gradient x phase 0.5
    color_map {
      [0.000 0.400 color rgbf <1.00,1.00,1.00,1.00> color rgbf
<0.80,0.80,1.00,0.10>]
      [0.600 1.000 color rgbf <0.80,0.80,1.00,0.10> color rgbf
<1.00,1.00,1.00,1.00>]
       }
     turbulence 0.5
     scale 7000000
     rotate <0,0,-70>
    }
  finish {ambient 0.7 diffuse 0}
 }

}


Post a reply to this message

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