tooll3 / t3

Tooll 3 is an open source software to create realtime motion graphics.
MIT License
3.48k stars 193 forks source link

[BoxGradient] #440

Closed newemka closed 5 months ago

newemka commented 6 months ago

sdBox version of [RadialGradient] This is an implemetation of the signed distance field "Box - Exact" desbribed in the "2D distance functions" article on Inigo Quilez's website.

image

pixtur commented 5 months ago

Do you think it would be possible to merge this with NGon? I believe that should be a minor change and would make that op even more powerful.

newemka commented 5 months ago

Do you think it would be possible to merge this with NGon? I believe that should be a minor change and would make that op even more powerful.

True, adding the gradient parameter to Ngon will make it more powerful.

But the shape of NGon is driven by a Radius whereas SdBox size uses width and height. Adding a stretch parameter to NGon allows to generate rectangles but the gradient gets stretched.

Then I'd like to keep [BoxGradient] but use sdRoundedBox instead of sdBox https://iquilezles.org/articles/distfunctions2d/

newemka commented 5 months ago

image

newemka commented 5 months ago

image

pixtur commented 5 months ago

Thanks for the contribution