PLNTSCAP.GIF is an example of using post-processing on raytraced
images to generate realistic starfields.  Povray was used to generate
the large ringed planet and grey foreground moonscape.  The stars
were generated by using Fractint's starfield option on a "plasma"
fractal.  The purple nebula was generated by Corel's PhotoPaint.
The images were combined using PicLab.

In article <CtBrM6.5Dx@mishima.mn.org> tomg@mishima.mn.org writes:
>What's the best way to generate starfields in Povray?  Just map
>a texture on a black sky?

I've been wrestling with this problem for some time now - here's what I've
come up with so far. 

The problem with generating starfields in Povray is that stars are more or less
point sources of light.  So in order to make a realistic looking star field,
each star should consist of a single pixel.  (Ok, this is a subjective
opinion.  Personally, I think stars look better as single pixels.  Your
mileage may vary.)  This implies a resolution dependent texture function -
something that Povray does not support (and probably shouldn't.)  The thing to
do, then, is to generate the star field outside of Povray and combine the
Povray image and the star field image in a post-processing step.  This can
easily be accomplished with PicLab, a freely available image processing
program (try one of the many raytracing ftp sites to find this.)

The trick is to render your scene twice, once with a regular
black background (where the stars will eventually go), and once with an
all-white background and all of the foreground objects' textures set to black.
The second image can be used as a mask to "cut out" parts of the star field
image you don't want, allowing the modified star field to be added pixel by
pixel to the original black-background rendered image.  Complicated, yes, but
the results look really good.

I will try and upload an example of this technique to ftp.uwa.edu.au.  The
filename will be PLNTSCAP.GIF or something similar.

Of course, you can always use image maps or try to kludge a texture map into
looking like a bunch of stars.  I've had reasonable results with both
techniques, but find that using the above method yields more consistently
better images.

If you're trying to do an animation with star fields, good luck.  Short of
patching Povray to include a star field type texture (which has been done in
the past, at least for DKBTrace) I can't think of any method which will
look very good.

Barry Ferg | bdf@dsi.bc.ca | Opinions expressed are my own