Thursday, February 1

Procedural star field in Blender

In the right-hand panel, turn off Reflective Caustics and Refractive Caustics under Scene.



Go to the World setting in the right-hand panel

Move mouse cursor to bottom of menu on the window at the line, until it changes to a double ended arrow.

Slide the window up to make it larger.

Change the bottom view to the node editor.

Switch to World at the bottom.

Click on the Use Nodes in the right-hand panel.

Add a Noise Texture

Set the Scale of the Noise Texture to 500 or so.


Add a ColorRamp

Add a MixRGB node.

Set the top color of the MixRGB node to black


Connect the Color output of the Noise Texture to the Color2 input of the MixRGB node.

Connect the Color output of the Noise Texture to the Fac input of the ColorRamp.

Connect the Color output of the ColorRamp to the Fac of the MixRGB node.

Connect the Color output of the MixRGB node to the Color input of the Background node.

Change the upper window to Rendered

Adjust the sliders on the ColorRamp to get the look you want.

The further to the right the black slider is, the more black the background. The further to the left the white 
slider is the more stars.

And use the Detail in to Noise Texture to control the number of stars.

To add different size stars, hold Shift and select the Noise Texture and the ColorRamp, then press Shift-D to Duplicate.

Change the scale of the second Noise Texture to a lower value.

Add another MixRGB node between the first one and the first ColorRamp node.


Connect the Color output of the top ColorRamp to the top Color input of the new MixRGB node. Connect the Color output of the bottom ColorRamp to the bottom Color input of the new MixRGB node.


Change the new MixRGB to Add.


No comments: