8
$\begingroup$

I am creating a completely procedural space with some stars, nebula, etc. The stars are generated by a Voronoi texture hooked up to a Color ramp - a pretty usual approach as far as I know. I would like to decrease the amount of stars in the scene.

The Color ramp connected to the Voronoi texture has three colors inside it as follows:

  1. Black at position 0
  2. White at 0.001
  3. Black at 0.002

I have tried decreasing the amount of stars by setting the positions within the color ramp to lower values like 0, 0.0001 and 0.0002, but the amount of stars seems to stay the same.

I am fine with the size of the stars, I would like to just make fewer of them. Sadly, even after several hours of trying, I seem to be unable to achieve it. With that, I would be very grateful if anyone could give me some advice how to achieve this.

The node setup is below, the scene preview can be seen here Scene preview and the blend file is here Blender file. Using blender 2.8 with Cycles.

The node setup is pasted below:

enter image description here

$\endgroup$
  • $\begingroup$ A (noise texture + "less than") for the fac corresponding to the first add rgb which is at top center on the setting (the one receiving its inputs from the top left frame) $\endgroup$ – lemon Jul 27 at 17:09
  • 2
    $\begingroup$ A noise texture which fac is clamped by a less than reduces the influence of the first input of the add rgb. i.stack.imgur.com/WanlH.jpg $\endgroup$ – lemon Jul 27 at 17:15
  • $\begingroup$ Thank you! Just what I was trying to do! If you don't mind, post this as an answer so that I can mark it as the solution. $\endgroup$ – Ondrej Jul 27 at 17:23
9
$\begingroup$

A noise texture which fac is clamped by a less than reduces the influence of the second input of the add rgb.

enter image description here

More generally:

A noise texture is kind of random pixels, specially at high scale. From that, if we clamp its result by a less than or greater than (or colorramp), then you will pick a partial amount of this randomness.

In particular here, that gives us less stars.

$\endgroup$
6
$\begingroup$

I'm not sure I can justify every node here mathematically.. top row power node, adjusts variance in star size, multiply node maps into the threshold given by the color ramp... they all interact, but I've found it quite controllable...

enter image description here

...but it's the bottom row, which colors the stars and multiplies the color with the greyscale generated by the top row that gives control over making stars appear or disappear randomly, according to how many of them you color black.

The color of the stars, before mapping by the bottom color ramp, is provided by the random color/factor of Voronoi cells, each of which contains 1 star, so long as the texture space of the Cells and Intensity Voronoi textures is the same.

With a lot mapped to black:

enter image description here

With fewer mapped to black:

enter image description here

Which does the job without changing the star size or position, and without preferentially knocking out smaller stars.

enter image description here

$\endgroup$

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.