Fellow graphics programming nerds: any ideas for how to turn noise (I’ve got gradient, value, and cellular) into a shape with sharp ”tips”, like conifer trees?
I’ve tried:
- `pow(noise, someHighNumber)`, but it doesn’t help with the rounded tips
- `1 - abs(noise)`, but it only creates long ridges, while I’d like more or less freestanding shapes
Thanks for the help, everyone! Based on your replies I flailed around a bit here and seem to have found what I was looking for.
`1 - pow(1 - x, 0.4)` seems to sharpen the tips and round the bottoms of this cosine wave, and should do the same to my noises.
Although it turns out I was thinking of this problem all wrong. Even if I "sharpen" the noise in 1D, it'll still obviously look "round" in 2D, and I won't be able to use it to draw those sharp tips. Maths is hard.
Oh well, for now I'll just stick with thin rounded conifers (right) and wide rounded broadleaf trees (left). They look alright. I was just hoping to get a bit more contrast between the shapes.
@jonikorpi Maybe this would help https://thebookofshaders.com/05/kynd.png as inspiration
@schme It does, thank you! It makes me think there has to be _some_ power function that mostly cancels out the curvature of whatever noise I’m using. I guess I could just trial-and-error it….
@jonikorpi Is the problem that your noise has bulges that don't go to the max, thereby not becoming tip-like when you apply one of the solutions?
I wonder if you could normalize it in a local manner, e.g. calculate each local maxima and then figuring out which local maxima each point is closest to and normalize it using that? Makes sense? Not sure if it'd be viable in real-time.
@jonikorpi min or smoothmin of two offset or different noise functions is also a good one for this.