Diamond, triangle and other shaped ramps

Hello TD community!

How does one create diamond, triangle and other shaped ramps based on a horizontal and vertical ramp? Or are there other optimized ways? This is what I got so far (and more):

Greets Daan

Hi @dnmn,

fun one.

Diamond / Square could be done by taking the average of a horizontal and a vertical ramp and then using a animated horizontal ramp as a lookup:

Triangle I’m not sure…

cheers
Markus

1 Like

Amazing! Thank you Markus.

A follow up question on your network: how do you get ramp3 to be so tight in the middle splitted into black and white?

Not sure if this is “correct” but it surely looks like a triangle :slight_smile:

Now I wonder, how to get it in the center…

Hard edge ramps : choose “step” in the Interpolate Notches parameter.
To draw triangles, I use the circle TOP where you can set “polygon” and divisions to 3 (from your screenshot it seems you don’t need a ramp but rather hard edge shapes)
For a diamond, I would use the rectangle TOP

2 Likes

Hi @GauthierDewez,

I thought the goal was to have animated ramps… otherwise yes, for generating shapes the Circle TOP is perfect.

cheers
Markus

Thank you both for the replies. The goal is indeed to have animated ramps:

I’m a fan of modular synthesis (but can’t afford it, yet), so I thought it would be fun to create certain modules in TD to get a similar result and meanwhile practice on my TD skills.

For the first module, I’m trying to create LZX Visual Cortex and its ramp generator:

But I wonder If I can do this with only TOPS or if its better to use GLSL or the MetaRamp for this? It might be a bit over my head in the current level I’m at, but I’m having fun! :blush:

Hi! This is a fun one.

I usually try to avoid recommending shaders to relatively new users, however, the triangle ramp is kind of a perfect use case.

Here’s my setup:

Stuff about the shader:
I’m using a function for the triangle by Inigo Quilez that I found here:

Iq is an excellent resource on shaping functions. He has a site dedicated to them here:

For some reason I couldn’t quickly beat his triangular SDF into shape for your use case, but the reference shader on shadertoy included the non-sdf triangle formula used in this example.

triangle.toe (4.3 KB)

1 Like

Here’s a version made without GLSL using just ramps.

The resulting triangles have rounded sides which is totally not what you were asking for, but maybe kind of cool anyway.
triangle2.toe (4.2 KB)

1 Like

Thanks a bunch Florian, I think it looks cool! You definitely gave me some food for thought, and ramped up this project! :sweat_smile:

For the ones interested:

ramp_generator.tox (9.3 KB)

Thanks to the helpful replies here, this tutorial (https://www.youtube.com/watch?v=rGJCdQ-5gNw) (and a lot others :sweat_smile: ), we now have a (semi) Visual Cortex inspired ramp generator in TD. :raised_hands: