Download The File: Building-a-Better-Nebula.xml
Download The File With More Stars: Building-a-Better-Nebula2.xml
The Objective
The purpose of this tutorial is to show you how I create various types of nebulas. This is what we’ll end up with:
The Filler Nebula
When I create a typical spacescape I like to start out with what I call a ‘filler’ nebula, that is, a nebula that sits in the background that you don’t really pay attention to.
First, fire up Spacescape.exe and create a new layer and change the ‘Layer Type’ to ‘Noise’
Now expand the layer parameters by clicking the arrow next to the layer title ‘SpacescapeLayer0’ and change the following parameters:
- Layer Name: Purple/Pink Nebula
- Random Seed: 8
- Inner Color: 160,32,255 (this is PINK)
- Noise Type: ridged
- Octaves: 8
- Outer Color: 73,0,112 (this is PURPLE)
- Power: 0.250
- Preview Texture Size: 1024
- Noise Scale: 0.5
- Threshold: 0.5
What we’ve done here is created a purple/pink nebula with a fair amount of detail and I’ve changed the threshold to 0.5 so that more purple shows up than pink. If you don’t remember what threshold is check out the ‘Your First Spacescape’ Tutorial or look at the ‘Spacescape Manual’
I’ve also set the ‘Power’ to 0.250 so that the gradient from purple to pink is more gradual than normal. The Noise Scale is set to 0.5 because I want larger features in the first octave of noise. Noise Scale controls how large the features are in the first octave of noise.
The Filler Nebula Mask
Masks can be tricky things, but so useful. In this case we’ll make one so that the filler nebula doesn’t fill the whole sky. Create a new noise layer with the following properties:
- Layer Name: Purple/Pink Nebula Mask
- Random Seed: 2
- Dest Blend Factor: src_alpha
- Inner Color: 0,0,0
- Octaves: 4
- Outer Color: 0,0,0
- Preview Texture Size: 1024
- Noise Scale: 0.5
- Threshold: 0.5
- Source Blend Factor: one
The Destination Blend Factor controls how the layers under the mask are drawn in the scene. In this case we’ve specified that the layers under the mask are only drawn when the src_alpha (the mask’s alpha) value is 1.0 – so where the noise value for the mask is 1.0 the layers underneath will show through. The Source Blend Factor is set to ‘one’ which means we want to use the color from the mask layer everywhere else.
I’ve also set the Noise Scale to 0.5 because I want the mask to have large features and it has just a couple octaves because it doesn’t have to be very detailed.
Some Filler Stars
Now lets create some filler stars! Create a new ‘points’ layer with the following properties:
- Layer Name: Purple Filler Stars
- Random Seed: 10
- Far Color: 0,0,0
- Mask Enabled: True
- Mask Octaves: 4
- Mask Noise Scale: 0.5
- Mask Random Seed: 2
- Mask Threshold: 0.4
- Near Color: 85,56, 134
- Number of Points: 2000
On this layer I’ve used the same noise properties as the mask layer so that these stars will only appear where the mask isn’t. NOTE: I set the mask threshold slightly lower here so that the stars will also slightly overlap the mask and spill into the dark areas of the spacescape.
Next let’s copy this layer and change the following parameters on the copied layer:
- Layer Name: Pink Filler Stars
- Random Seed: 11
- Far Color: 255,170,255
- Mask Threshold: 0.55
- Near Color: 255,85,255
- Number of Points: 200
These will be a sprinkling of bright stars in our nebula. Note that the mask threshold is HIGHER than the threshold value for the nebula mask, so these stars will cluster closer to the center area of the unmasked areas. Also, I only want a few of them so I set the ‘Number of Points’ to 200.
A Fiery Nebula
The next nebula we’ll create is a fire nebula and to do that we’ll start with a red base nebula with lots of detail.
Create a new noise layer and give it the following properties:
- Layer Name: Fire Nebula Red
- Random Seed: 14
- Gain: 0.7
- Inner Color: 255,0,0
- Noise Type: ridged
- Octaves: 10
- Outer Color: 170,0,0
- Power: 0.22
- Preview Texture Size: 1024
- Noise Scale: 0.5
- Threshold: 0.7
- Source Blend Factor: src_alpha
Couple items to note here that are important. First of all, I’ve set the Source Blend Factor to src_alpha because I don’t want the Outer Color to fill the whole sky so I made the nebula only visible where the Nebula alpha value is not zero. The alpha value is the same as the noise value which ranges from 0 to 1.
I’ve made the noise type ridged and given it plenty of octaves and I high texture preview size so all the detail is visible. I’ve also made the noise scale 0.5 so that the noise features start out large, then I made the threshold high so that the nebula isn’t huge. I also set the power to be lower so that the nebula would be much smaller.
The next thing to do is put a brighter more yellow nebula inside the red one to make it look hotter in smaller sections.
COPY the Fire Nebula Red layer and change the following parameters:
- Layer Name: Fire Nebula Yellow
- Inner Color: 255,255,0
- Outer Color: 255,85,0
- Power: 0.25
- Threshold: 0.8
This is basically the same nebula as the first but with the colors changed and the power and threshold changed so that the yellow nebula does not extend as far out as the red nebula.
Next let’s add some red stars in the fire nebula.
Create a new points layer with the following properties:
- Layer Name: Red Stars
- Random Seed: 15
- Far Color: 0,0,0
- Mask Enabled: True
- Mask Gain: 0.7
- Mask Noise Type: ridged
- Mask Octaves: 8
- Mask Power: 0.25
- Mask Noise Scale: 0.5
- Mask Random Seed: 14
- Mask Threshold: 0.6
- Near Color: 117,61,61
- Number of Points: 1000
I’ve created some red stars but I added a mask based on the red fire nebula noise parameters so that the stars primarily appear around the fire nebula, though I did lower the threshold so they spill outside it as well.
Now to really add some good looking stars lets use billboards.
Create a new billboards layer with the following properties:
- Layer Name: Red Billboard Stars
- Layer Type: billboards
- Random Seed: 15
- Mask Enabled: True
- Mask Gain: 0.7
- Mask Noise Type: ridged
- Mask Octaves: 8
- Mask Power: 0.25
- Mask Noise Scale: 0.5
- Mask Random Seed: 14
- Mask Threshold: 0.6
- Billboard Texture: flare-red1.png
These red billboard stars are some of my favorites – they just always look cool in a spacescape. I’ve masked them using the red nebula noise settings so they appear primarily inside the red nebula.
A Cold Nebula
We’ll use a similar approach to create a cold blue nebula.
Create a new noise layer with the following properties:
- Layer Name: Blue Nebula
- Random Seed: 108
- Dither Amount: 0.01
- Gain: 0.5
- Inner Color: 0,0,255
- Lacunarity: 2.61
- Noise Type: ridged
- Octaves: 10
- Outer Color: 0,0,127
- Preview Texture Size: 1024
- Noise Scale: 0.3
- Threshold: 0.87
- Source Blend Factor: src_alpha
The first thing I want to point out about this nebula is that I took a long time looking for the a nebula that didn’t stretch out across the entire sky. The ridged noise has a tendency to do that. I made the noise scale low and the upped the Lacunarity so that the noise would get more detailed with fewer octaves. Also, I lowered the dither amount so the nebula would be smoother.
Next lets copy the Blue Nebula layer to reside inside this one, just like for the fire nebula.
- Layer Name: Blue Nebula Inner
- Gain: 0.65
- Inner Color: 217,254,255
- Lacunarity: 2.61
- Noise Type: ridged
- Outer Color: 0,170,0
- Power: 0.4
- Preview Texture Size: 1024
- Noise Scale: 0.3
- Threshold: 0.85
- Source Blend Factor: src_alpha
This is basically the same layer but I messed with the power and threshold to make it not fill the entire blue nebula. I also upped the gain so that the more detailed octaves would be more visible.
Lastly lets add some billboard stars just like for the fire nebula.
Create a billboard layer with the following properties:
- Layer Name: Blue Stars
- Layer Type: billboards
- Random Seed: 4
- Mask Enabled: True
- Mask Gain: 0.5
- Mask Lacunarity: 2.6
- Mask Noise Type: ridged
- Mask Octaves: 5
- Mask Noise Scale: 0.3
- Mask Random Seed: 108
- Mask Threshold: 0.87
- Number of Billboards: 50
- Billboard Texture: flare-blue-purple2.jpg
Nothing fancy going on here, just used the same noise values as the Blue nebula for the mask so these stars appear mostly inside where the blue nebula is.
Nebula Dark Clouds
There is one last trick I’m going to include in this tutorial and that is what I call the dark nebula. Sometimes I like to add a dark nebula on top of one or more light nebulas to give the nebulas a bit more depth. It can also make the spacescape more sinister, as you only see dark clouds in space if there is something light behind them to make them show up.
So create a new noise layer with the following parameters:
- Layer Name: Dark Clouds
- Layer Type: noise
- Random Seed: 7
- Dest Blend Factor: one_minus_src_alpha
- Gain: 0.8
- Inner Color: 0,0,76
- Noise Type: fbm
- Octaves: 8
- Outer Color: 0,0,0
- Power: 2.5
- Preview Texture Size: 1024
- Threshold: 0.5
- Source Blend Factor: src_alpha
The dest blend factor is one minus src alpha which means that the background nebulas will appear where the dark nebula is not, where as the dark nebula will appear where dark nebula noise is greatest, which is all the remaining areas.
I chose dark colors and increased the gain so that the details of the extra octaves would stand out more and I increased the power to make the noise gradient more abrupt. I also had to play around with the random seed enough to get a setting I liked – one where the dark clouds didn’t cover up bits of the spacescape that I wanted visible, and overlapped parts of the spacescape that really set things off.
And that’s it for the nebula tutorial – hope you liked it!
Download The File: Building-a-Better-Nebula.xml
Download The File With More Stars: Building-a-Better-Nebula2.xml