I am trying to figure out how the Drawing Canvas works.
What I want is to mix a Perlin noise and then some linear gradients together. After that, I want to clap the colors (let's say 50/50, Black and white) but I can't figure out how. Appreciate any help I can get, thanks! :)
Here is what it looks like:
Your issue isn't clear to me. What do you mean by clamp colors?
Perlin noise is a gradient by nature, why are you drawing a gradient instead of the actual value at each coordinate??
By clamping the colors, so pr. pixel values > 0.5 ? 1 : 0
Everything over 0.5 will have a values of 1 instead.
The gray scale is converted to black and white.
This picture is like what I want to achieve. (did it in photoshp)
Sounds like you already know how to do it?
Change the set value action in event 4 to:
Set Value to AdvancedRandom.Classic2d(x1,y1)>0.5?1:0
Sure. But that Will only Work for the Perlin noise map. I need to do it for the linear gradient too.
Develop games in your browser. Powerful, performant & highly capable.
If it's greyscale, you can loop through each snapshot pixel again to apply the conditional clamp. Use any of red/blue/green since they should always be the same in greyscale. Set snapshot pixel SnapshotRedAt(x, y)>50?100:0 for each color, or set an intermediate local variable to make it cleaner.
Alternatively, you can simply use the blackwhite layer effect.
Ah ok, thanks mate. 🙏☺️