Touch Paint | Paint on the screen or an object using touch. |
The Touch Paint node implements a highly configurable painting system based on touch input. It is not limited in the number of touches that can paint at the same time but only offers one set of brush settings for all touches. In general it is used for signage tasks, to give the user the ability to mark certain areas or to just give the user visual feedback on where his touch is.
When the user touches the active area of the paint node, particles are internally created as blobs of paint. The user can change color, size and many other settings while he is painting and all painting done before the change will stay the same. The user can assign a brush shape by using the BrushTexture property but in general it is advisable to use the default round brush due to the fill-in and overdraw that is required to produce a consistent line even when the touch moves quickly.
The most important setting performance-wise is the FadeOut behavior property. When fade out is deactivated, the particles generated during painting will be baked into the result texture and are free for re-use during the next frame. This is the most efficient mode of operation.
When fade out is activated, the result texture is re-created each frame to be able to fade out the paint. The type of fade behavior can be set with the FadeStart property. Either the paint starts fading as soon as the particles are created (resulting in a nice tail following the touch), the paint starts fading when the touch ends (i.e. the user is finished painting and raises the finger from the tracking surface) or when the reset event is manually fired. Note as the user continues to paint, more and more particles are created. Until a particle completely fades out and dies, it is rendered into the result texture every frame which can lead to performance penalties. When the Eraser property is activated, "negative particles" are created that will also render each frame. Erasing therefore does not decrease but actually further increases the particle count. In case of performance problems, consider deactivating fade out altogether or decreasing the fade out time.
This node can be used in two different operation modes via the BehaviorScreenAligned property. In Screen-Based mode, the node functions much like an Overlay Rectangle in that the painting surface is always aligned with the screen and the painting result will be rendered as an overlay. Unlike the standard rendering behavior, the Touch Paint node will render itself after its subtree has been rendered.
In Object-Based mode, the node operates similar to the Touch Transformation Nodes in that it will calculate its result based on a planar mapping in the local X/Y-plane. As with the Touch Transformation Nodes, the meshes underneath the interaction node are only used for the initial intersection test, not the mapping calculation itself. Therefore using anything other than a unit rectangle will in general create unexpected results.
To translate/scale/rotate the rectangle, use an Axis above the paint node so that both the paint node (or rather its mapping system) and the rectangle are transformed consistently.
Depending on the speed of movement and the refresh rate of the input device, the gap between actual touch position updates can get quite large. To compensate this, Ventuz creates a "fill-in" by drawing additional particles every few pixels between two registered positions of a touch. This is done by linear interpolation, therefore a curve drawn with the Touch Paint Node can appear bumpy. In such cases, try to increase the update rate of your device and/or use the Interaction Post Processing features in the Project Properties.