I am really interested in making night skies full of beautiful stars as in this image

enter image description here

or even this

enter image description here

But the best Blender tutorial I found about making such a thing ended up looking like this

enter image description here

Is Blender able to make such a thing, or do I need to learn Photoshop to make stars and galaxies?

  • 1
    $\begingroup$ Blender can certainly make something like that, however, I think it's safe to say it falls under the "advanced shader" category. I'll work on some prototypes, but I'm making no promises - I'm fully willing to admit that this is at the far reaches of my abilities (likely beyond) at this point. Maybe someone with more experience will come along in the meantime. $\endgroup$ Jun 25 '20 at 16:33
  • 1
    $\begingroup$ Just a question though, is this meant to solely be an environment shader, or could this also apply to a large (skymap) sphere? $\endgroup$ Jun 25 '20 at 16:35
  • $\begingroup$ not that familiar with these terms :( but i am interested in making a flat render not a skymap $\endgroup$ Jun 25 '20 at 16:50
  • $\begingroup$ Try the highly-recommended Physical Starlight And Atmosphere: blendermarket.com/products/physical-starlight-and-atmosphere I'm strongly considering getting it myself. $\endgroup$ Jun 25 '20 at 18:36
  • $\begingroup$ thanks for the answer but the reason why i started blender is to learn how to make 3d object myself so using a software to do it for me isn't something that i am interested in $\endgroup$ Jun 25 '20 at 18:55

Ok, so here it is. Here's my attempt at your shader. I'll just let you take that all in. It's not perfect, but it's getting closer to what you're looking for, and hopefully the breakdown will help guide you in your own shader making adventures.


So, I think I'm going to go ahead and name this one "A whole lotta noise", because, as is the case with many procedural shaders, it includes a great deal of noise textures. It is my task throughout this breakdown to help you make sense of all of them.

Let's start with the obvious - a stary sky is going to need stars - lots of them. Big, small, bright dim - the whole deal. So, leet's make some stars. I see from your image that you have that part down pretty well, but regardless, i'll walk through the apporach so others reading can follow as well, and maybe you can combine our two styles in your final shader.

I got my initial star shapes by combining a Voronai Texture with the randomness set to 0, with a White Noise Texture. This special little combo yields "Cell noise" otherwise known as pixellated squares of varying brightness. I chose squares, because it was an easy way to get a lot of stars, distributed the way I want. The fact that they start square doesn't matter so much, because they will be small, blended with other things, and I have plans to blur them slightly later on as well in the compositor. So, In my mind, squares are fine for now. To get a more varied look to the stars, I used 4 different White Noise Nodes of different scales.

However, the result given by the White Noise is mostly on the light side (not very star like) so I clamped the values with a ColorRamp. I clamped it rather tightly because the initial map yields too many "stars", so I clamped even most of the grays, leaving only a small amount of white with just a tiny bit of variance in grey levels that I take advantage of in the next set of ColorRamp Nodes that I use to give the stars a bit of color. I didn't give any color to the smallest stars, because they are very small, and color variations wouldn't show anyway.

Lastly, I started mixing them together. FYI - all the MixRGB Nodes set to "ADD", that are adding a nodes values to itself, is just a quick way I know of brightining the "bright" values of an image, without brightening the overall image. See below:


The next stage (actually 2 stages) was to remove some of the extra "noise" (too many stars), by multiplying my star-maps with some Noise Textures of different scales and distortions. I used ColorRamp Nodes to control the strength of the noise I was using to darken. This has 3 effects - Firstly, it flat out removes a bunch of the stars. this is good, because it makes the image less "noisy". Secondly it varies the brightness of all the stars that are left in the map, making them more realistic, as if some were closer than others. Lastly, it rounds off many of the sharp edges to the White Noise squares, making them more like stars and less like blocks.


Ok, so now we have a starfield, but that's rather boring, so let's add some "nebulae". Firstly, we don't want the nebula to take up the whole sky, so we have to "section off" an area for it. To do this, I used a Gradient Texture, rotated and clamped it, and multiplied it with the dark values from yet another Noise Texture to get a slightly "whispy" horizon. The reason I left it whispy is because I will be using this as both an image and a mask. I want the image to be varied in brightness, as well as a mask that is varied in opacity. Because pure white is considered "fully opaque" as an alpha value, and pure black is considered "fully transparent", I wanted a bit of grayscale variance so the transparency "blends", without harsh cuttofs - Kind of like a cloud.


I then multiplied this map with "darkness mask" I made from a Gradient Texture. NOTE - the TEXTURE COORDINATE I am using for this particular gradient is UV, as opposed to GENERATED for everything else. I did this because it gives me more precise control over the gradient's position via the Mappong Node and the ColorRamp. I used this as a way to further "section off" the cloud. The result of which looks like this: (FYI - The brightness and contrast values (mainly brightness) do a pretty good job of controlling the cloud size.)


Now starts the coloring section. The first thing I did was give 2 "layers" to the cloud, by using 2 different ColorRamps, one Blue, and the other Pink. The pink one I made smaller than the other by reducing the brightness (and subsequently the cloud size) ahead of the coloring. I then mixed them together, using an inverted version of the smaller "cloud" as a mask that I further adjusted with a ColorRamp to make the pink cloud "show through" the blue to my satisfaction. See below:


I then combined this with the darknes values from a detailed and clamped Musgrave texture to make it look more like a real nebula, with dark areas abound.


For the area "inbetween the stars", and to form part of the "background noise" of the universe, I combined some more Noise Textures and a Wave Texture with some bue and aquamarine ColorRamp values, using the wave to help define some of the "flow areas" to what I will now call "cosmic gas".


I also made a second set of "background-background" noise, which I mixed in right near the end, because I felt dark areas of the image were still too dark, ad were missing something in my mind. I think I could have chosen better colors, and a beter mix, but I was tired of fiddling with it at this point.


Lastly, I used a Gradient Texture, mapped, rotated and mixed with some more clamped Noise Textures to define the area of the sky where the sky background noise would effect.


Lastly, I mixed them all together - The STARS, the CLOUD and the BACKGROUND NOISE. I ran the result through an emission shader to boost the values and the result looks like thsi (I pictured on both a plane and a sphere.) I turned on bloom as well for a slightly added effect - you can control this by the emission value to an extent.


But wait, we're not done - time for some compositing. The last step is to put a camera in front of the plane, and render an image. From there, you can go to the compositing window and play to your hearts content. I was aiming for the minimal work possible, so I just slightly enhanced the image with a Glare Node. This further rounds out the stars, and adds a twinkle". I purposely over-used it in the final image because I really wanted to demonstrate how it makes an image seem "fantasy like". Feel free to change the values to your preferences (it's largely controlled by the "threshold" value of the Glare Node).


Final result looks like this:


I've also included the whole blend file for all those who want to play with it.

File is here -

A last note - for a real bonus, switch over to the WORLD section in the shading tab. I've left the same map there just waiting to be hooked up. Give it a try, but be warned, it made my GPU take quite a breath. Use sparingly. All the best.

  • $\begingroup$ Omg man this is unbelievable like Christopher you have unbelievable skills this is awesome $\endgroup$ Jun 26 '20 at 6:25
  • 1
    $\begingroup$ Glad you like it. I'll admit it's a bit sloppy - there are some things that could probably be omitted or simplified, and it's a bit heavy on performance, but it gets the job done to a decent degree. I'm not really happy with the way some of the background noise came out. I wanted a more even glow, but I couldn't get it "just right". When you mess with shaders too long, you eventually hit a point where your changes start making things look worse again, so I stopped where I was. Hopefully, enough of the general idea is there that you can make use of the concepts going forward. $\endgroup$ Jun 26 '20 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.