adamwulf/JotUI

Add option to interpolate brush rotation throughout stroke

adamwulf opened this issue · 2 comments

Right now, the brush rotation is static throughout the entire stroke. The brush texture can be rotated only once at the beginning of the stroke, and that rotation is used for the rest of the stroke. This is great for creating highlighter style pens where a rectangle texture can be rotated to the initial direction of the stroke and then kept constant (as is done in Loose Leaf's highlighter), but it would allow for more interesting brushes to also be able to interpolate the rotation throughout the stroke, as is done with color and width.

any update on this ?

I haven't started work on this one yet, it'd be a great place for someone to jump in and add it. Very old versions of JotUI had interpolated rotation, but used gl_triangles to render instead of gl_points.

Older GL versions couldn't rotate point sprites, so I had to use two triangles to rotate a square of the texture per 'dot' instead of 1 gl_point per dot. I calculated the rotation per dot, then calculated the corners of the triangle to render. All of the code for calculating the interpolated rotation should still work in theory, and then update the shaders to use that rotation as input.

the old rotation was taken out around 9bfb57f, so you might still be able to compile - or at least see the code - at 5c08617.