Painting using a brush for iOS

Hello everyone,

I’m trying to make a painting app for iOS but I don’t know what is the best approach in implementing a brush.
First I started by using a Texture2D and SetPixels, which did what I wanted it to, but the Apply function was making the whole app too slow so I had to change direction. I though of using OpenGL but as I want more complex behavior from just drawing lines, I didn’t think that was I viable solution.

Therefore right now I’m trying to make this work by drawing on a mesh. Based on where the user clicks I generate vertices and triangles based on the width I want. This works perfectly for solid lines. However right now I want to add an air brush (similar to Windows Paint, or what they use for graffiti), and something like an oil / waterbrush. Basically all of the above require a triangle on the mesh to be drawn with either color variation or using a texture. I’m pretty sure I should be able to do something like that using shaders and applying the appropriate texture, but I’m not as knowledgeable to figure how to make it work.

Can I get any suggestions on how I can achieve what I’m trying to do, and if this is the right direction or if there is an alternative?


You could check out:

Unity Paint

It’s a demo made by Aron Granberg a while ago. It has pencil, line, eraser, and brush tools. I’m currently using it as a base for my own painting program. The original scripts are in Javascript but someone in the comments made a C# version.