prev index next 
Special Effects 
 POV-Ray Tips, 
 Tricks, and Techniques
Starfield Image Maps? 
 
Constantine Thomas has a nighttime scene: Probably a very frequently asked question, but does anyone know how to make a starry sky in POV-Ray? I've tried to map an image_map of stars (made using random noise in Paint Shop Pro) onto the inside of a sphere, but that doesn't seem to work... I just want lots of one or two-pixel dots on a black background, on the inside surface of a very large sphere.

Maybe I'm using the wrong approach - does anyone know how to simulate a starry sky using textures like bozo and the others in POV-Ray? I'd prefer the stars to be on the inside surface of a sphere, rather than just mapped onto a plane, if possible!
 

Carl Perkins uses this technique:
I find that this works OK:

sphere { <0,0,0>, 100000
  texture {
    pigment {
      spotted
      color_map {
        [0, .2995 color Black color Black ]
        [.2995, .3 color rgb <.7,.7,.9> color rgb <.4,.4,.45> ]
        [.3, .4995 color Black color Black ]
        [.4995, .5 color White color White ]
        [.5, .7997 color Black color Black ]
        [.7997, .8 color rgb <.75,.1,.1> color rgb <.45,0,0>]
        [.8, .899  color Black color Black ]
        [.899, .9  color Gray15 color Gray10 ]
        [.9, 1.001 color Black color Black ]
      }
    }
    finish { ambient 1 diffuse 0 }
  }
  no_shadow
}

If the size of the objects in your scene is larger than 10% of the radius of the sphere, you probably need to make it bigger.  The idea is that the sphere is so large that with the texture being the default scale 1 what you end up with is basically a random distribution that does not appear to have any normal texture-like pattern (i.e. the pattern I use above is "spotted", but the result is not a collection of a few large spots or, due to the color_map, sets of concentric circles and whatnot, but is rather a seemingly random distribution of single non-black pixels on a black background, probably about 2.5% non-black so any 10x10 pixel region on the screen will typically have 2 or 3 non-black pixels in it).
 

  1