memononen / nanovg

Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
zlib License
5.15k stars 771 forks source link

How to do bilinear gradient? #546

Open SC5Shout opened 5 years ago

SC5Shout commented 5 years ago

How to draw bilinear gradient?

image

kritzikratzi commented 5 years ago

just came here to say: this image is incredible. does it appear as if it's moving when looking around to anyone else??

SC5Shout commented 5 years ago

🤣 🤣 🤣 I do not know whatcha taking 'bout man. what actually TF?

orange451 commented 4 years ago

Just do 2 linear gradients?

SC5Shout commented 4 years ago

And how to combine them to 1 geometry?

orange451 commented 4 years ago

They wont be 1 geometry--Why do they need to be?

SC5Shout commented 4 years ago

Because every geometry is a draw call. Why to have 2 draw calls?

orange451 commented 4 years ago

I highly doubt this will be the bottleneck in your application. AFAIK NanoVG doesn't support bilinear gradients, so you're stuck with your 2 drawcalls 🤷‍♂

SC5Shout commented 4 years ago

I was hoping that someone would know how to modify nanovg to support bilinear gradient.