Color Ramp function to Map Range Node?

I’ve been using variations of this simple starfield for a few years now, thought I’d set it up in a group node. Most of the needed inputs are no trouble, but the position of the white stop in the black/white Color Ramp is controlling the size of the star-blobs, and that can’t be connected to a Group Input socket.

I’ve heard that the Map Range node can do everything a black-to-white (or vice-versa) Color Ramp can do – if so, the setting I need should be exposed for a Group Input socket. But I’ve had no luck figuring this out. Any help?

20240428_Starfield_002.blend (151.7 KB)

Consider using a Greater Than math node for this case

2 Likes

@William is right, and the greater than node is way better even that color ramp in this case.
map range can do in black and white what color ramp can, but you’re missing the point that your color ramp is in CONSTANT mode and it’s used as a cutoff than a remap…

the map range node don’t have constant but you can have a similar results (if you really prefer it ) with “stepped linear” and tweak the steps

2 Likes

Long time ago I made this super super simple node group to emulate a color ramp (just 2 colors, no alpha). I intended to refine and improve the thing but, well, never did…
Maybe it could be a start for your custom implementation.

This is how it looks inside:

And here how it works:

1 Like

It’s less that I really wanted the Map Range node for this, and more that I remember someone complaining years ago that the Map Range and Color Ramp nodes did the same thing, having both was redundant. The Math Node’s Greater Than did what I was looking for, thanks to William and you:

Although I did turn out using the Map Range node to rework the Star Size input to something that felt more useful.

Not what I needed this time, but appreciate the thought!

1 Like

FYI there’s an aspiring GSOC student proposing to improve the color ramp nodes across Blender by adding color and stop inputs : https://devtalk.blender.org/t/gsoc-2024-draft-redesigning-the-color-ramp-and-enum-support-in-all-node-editors/33974

1 Like