tooll3 / t3

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

[BoxGradient] #440

Closed newemka closed 1 day ago

newemka commented 1 month 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 3 weeks 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 3 weeks 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 3 weeks ago

image

newemka commented 3 weeks ago

image

pixtur commented 1 day ago

Thanks for the contribution