Representing star fields

Includes projections onto spherical and cylindrical maps

Written by Paul Bourke
June 2001

Creating good star fields is not as simple as it might seem. One approach (the physically elegant one) is to place some geometric object at the right location, generally a sphere at some fixed large distance from the center of the model. This has the problem of what primitive to use and how big should that primitive be. If the star object is too small then it will be missed by the raytracer, even with a high level of antialiasing. If the primitive is too large then the stars won't look like point sources. The same arguments apply to the distance the stars are placed from the center of the model. If it's too close then the stars will look large, if too far away then the stars will be missed by the raytracer. Fiddling the characteristics of the star positions depending on the typical camera position is tedious.

One way around the above problem is to create a large sphere around the model and map a high resolution texture onto that sphere. This immediately solves the problem with the size of the stars, they will appear the same size irrespective of the radius of the sphere the texture is mapped onto. One implication is that the size of the stars will vary depending on the dimensions of the rendered image, so a different texture size may be required for small rendered images compared to large images.

The following image 8192x4096.png has been created as a star map to be applied as a texture to a sphere using standard spherical texture coordinates. It is based upon real star positions. The magnitude, and therefore apparent brightness, is mapped onto the size of the dots. To assist with antialising, the stars are blurred. Note also the distortion (stretching) of the stars towards the top and bottom, this exactly compensates for the distortion introduced by the spherical (polar) texture mapping. The appropriate texture size depends on the resolution of the final images, a few different sizes are provided: 1024x512.png, 2048x1024.png, 4096x2048.png.

[ Click for high resolution version (8192 x 4096) ]

PovRay description

The following illustrates how this might be applied as a texture map star sphere in PovRay. The exact settings for the finish {} may vary depending on other aspects of the model environment.

/* Star field */
sphere {
   <0,0,0>, 1
   pigment {
      image_map {
         png "starmap.png"
         map_type 1 /* Spherical */
   finish {
      ambient 2 /* Inverse of earlier global ambient level */
      diffuse 0
   scale 1000000 /* Depends on model units */
Other issues

  • The distance the stars or star sphere with the texture map are placed cannot be infinitely distant or even at the real distance because of realities in the numerical systems used in computers. Closer stars mean that they are not necessarily invariant on the sky as the camera is moved they are in reality. One solution to this is to center the star field sphere about the camera, in which case the stars don't move in relation to the camera.

  • The dynamic range of the usual 8 bit greyscale range (256 levels of grey) is not nearly enough to represent the dynamic range of star brightnesses. This could be helped by using 16 bits per (r,g,b) or moving towards a 16 bit luminance model.

New: Oct 2011

The following higher resolution spherical maps were generated for a project in conjunction with Chris Brooks. A different algorithm was used whereby stars, from the same catalogue, are placed on the image plane with a Gaussian spread and magnitude related to the star brightness. A selection of images are provided below, they are each 16 bit tiffs (for enough dynamic range), provided at 16K and 32K resolution, the last number in the file name relates to the maximum standard deviation of the Gaussian.

16384 x 8192 x std30
32768 x 16384 x std30
16384 x 8192 x std60
32768 x 16384 x std60
16384 x 8192 x std120
32768 x 16384 x std120

Star Positions

Collated by Paul Bourke
Based on tables in the "Bright Star Catalogue, 5th Revised Ed."
January 2000

Ever wanted to include real star positions in your models or renderings? The data here will let you do that, it provides the positions in both polar and Cartesian coordinates, it also gives the visual magnitude. It contains all the stars that are brighter than magnitude 6.5, stars visible to the human eye have a magnitude around 4 (depending on the lighting conditions from where you're viewing). There are over 9100 stars listed.

This file gives the positions of the 9000 brightest stars. The 6 columns are labelled as follows
  • RA (Right ascension) The Star's east-west location on Earth's celestial sphere west of the Equinox Line. In degrees ranging from 0 to 360.

  • Dec (Declination) Declination is the star's angle north or south of Earth's celestial equator, ranging from -90 degrees at the south celestial pole to +90 degrees at the north celestial pole. In degrees.

  • Mag (Magnitude) The apparent visual magnitude (brightness to an observer on Earth) this star would have if it were at a distance of exactly 10 parsecs (32.64 light-years). The sun has an absolute visual magnitude of +4.85. Note that the magnitude scale decreases with brightness; a star of magnitude +6.0 would be 100 times dimmer than a star of magnitude +1.0.

  • x, y, z coordinates of the stars projected onto a unit sphere centered at the origin. Simply multiply these coordinates to scale the sphere up to whatever "infinity" is in your application.

The original tables and documentation can be found here.

A useful include for C applications is: stars.c.

Projection onto Cylinder and North/South poles

Collated by Paul Bourke
January 2008

The following is the mapping onto a cylinder, including the top and bottom caps. The cylinder covers -50 to 50 degrees vertically, the planar caps being therefore 50 to 90 degrees (north pole) and -50 to -90 degrees (south pole).

North cap
Plane (inscribed circle) above 50 degree declination

South cap
Plane (inscribed circle) below -50 degree declination

Cylinder, -50 degrees to 50 degrees vertically, 360 degrees horizontally

It was originally intended to be used as a physical star projector, namely to be printed and stuck together to form a real cylinder with a bright light source on the interior. To this end there are alignment points, a red star at the north pole, a blue point at the south pole, green points spaced at 1 degree intervals across the boundaries and also showing positive right ascension at the equator. It is expected that these alignment markings would be removed with a physical marker or digitally once the alignment is understood.

Simulated interaction between M31 and M32

Jeremy Bailin, Paul Bourke, and Karl Gordon
June 2004

Interaction between M31 and its satellite M32. Gray fuzz is the old stellar component, red circles represent the ISM, star formation/supernova events are bright white circles and the newly-formed stars are the smaller white circles. The passage of M32 through the disk triggers star formation at the observed location of NGC 206 and opens a hole in the disk at the observed location of a hole in the dust emission. Credit: Jeremy Bailin, Paul Bourke, and Karl Gordon.


Representing galaxies and planetary nebulae
using 3DStudioMax

by Navpreet Singh
Supervised by Paul Bourke
November 2001

R e a l

V i r t u a l









Modelling Galaxies Using 3DStudioMax

By Sivakumar Maniam, Suzan Hendrata, Rebecca Ng
Supervised by Paul Bourke
November 2004

Elliptical galaxies are generally circular in shape and are often elongated. Most galaxies in the universe are either elliptical or spiral. The Sombrero galaxy is composed of massive dust clouds, and a bright centre core, which is composed of millions of young stars. In 3D space the Sombrero galaxy has a flat, stretched out shape, with a bulging core that is surrounded by dark dust clouds.


Spiral galaxies are defined as spirals, because they have spiral arms. The galaxy NGC 4603 contains several spiral arms, immersed with dust clouds, which absorb the light pulsating from the stars within it. NGC 4603 is a distant galaxy, which contains a special class of pulsating stars called Cepheid. NGC4603 is also associated with other large collections of galaxies in the Centaurus cluster.


There are approximately 3% of galaxies, which cannot be classified as elliptical or spiral. Often they are distorted and have no rotational symmetry. These types of galaxies are often formed when galaxies collide or when the galaxy is very young and has yet to reach a symmetrical shape.

NCG 4242 has an intense bulging nucleus and surrounding gas. As you move further away from the centre, the brightness of the galaxy decreases. Although NGC 4242 appears bright blue in colour, the images of NGC 4242 are often artificially coloured when reproduced for visual impact. The nucleus is most likely at the centre of the galaxy, and made up of a cluster of young stars. Individual (possibly older) bright stars outside of the nucleus are also part of the galaxy and are positioned on the centre plane. The images show a front-on view of the galaxy, but it is possible that it would appear somewhat flat from side on.

Visualisation of the 2dF data

Survey revealing the 3D distribution of galaxies

Images from these renderings appeared in the 13 March 2003 Nature journal.

Featured in the AAO newsletter, #100, July 2002

Appeared on the cover of the
2001-2002 Anglo-Australian Observatory Annual Report

Frame from a stereoscopic flight through the dataset

Frame from a stereoscopic flight through the dataset

100Mpc sub cube (white)

Volume rendered density function

Partly transparent isosurface of 100Mpc cube

Partly transparent isosurface

Isosurface made more transparent on sides facing the camera

Isosurface represented as a net fabric