Sunday, March 22, 2015

Blender/Python: Plot stars from the HYG data (version 2015-03-05)



slightly updated version from what was previously posted....

the colours for the spectral types are over-saturated but what I do to correct this is put the stars into their own layer in Blender and from there I use the compositing node that reduces the saturation of the colours down to the point where the colours look realistic.

In the compositing screen below I have FOUR layers, FUZZIER and FUZZY are used for blurring the atmosphere, auroras or whatever needs to be blurred. Generally I have two fuzzy layers because I often find that I need to have two independent levels of configurable fuzziness so I just make the two layers for using blurring and glare nodes of some kind so that I don't have to add them later. the PLANET layer is the main layer where the planets and moons and such are placed and the STARS layer is for the background stars

I reduce the saturation of the background stars so as to reduce the "colourness" of the background stars as this script makes the colours rather vibrant. ie. M class stars are bright red (R,G,B = 1,0,0) which isn't a very realistic colour for M class stars. I also add a bit of glare to the background stars such that there aren't solid points of light.


The script below only supports plotting stars on the inside of a sphere, I haven't quite got the relative brightness of stars correct when plotting a star field in which you could move the camera around and see the perspective and relative stellar positions change. eg. If you moved the camera to Alpha Centauri, you would see that the star Sirius is now a part of the Orion constellation and our Sun would become a star in Cassiopeia.