Hello there! I’m working on a little project about drawing, and I wanted to share with you my progress and ask some questions
Here’s a video:
(I know, my drawing skills aren’t exactly awesome)
In short, the plane is a Runtime Mesh Component that gets its vertex colors updated every frame. This is done by a C++ function (for performance reasons) that lerps between the brush color and the old vertex color based on the distance to the cursor, the falloff curve (currently linear) and a strength value controlled by the player.
However, I’m running into some obstacles:
First, when painting some colors over others everything looks horrible. Colors shift awkardly and hues appear out of nowhere. I know this is due to the interpolation function I’m using, the FLinearColor::LerpUsingHSV(From, To, Alpha) one. As explained in this article, this might be due to a poor function. Therefore I wan to write my own, but I’m not sure what algorithm to use. Any clues?
Also, when applying a brush it takes in account all vertices of the mesh and their distance. Taking in account only the affected vertices would be much faster. However, I can’t seem to find a function to return the points at certain or lower distance to a given point that don’t require iterating over all the vertices
Anyway, I will a color selector and some other stuff while waiting for the Runtime Mesh Component version 2 that will hopefully allow me to paint any mesh, not just a plane
Please share your feedback!