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. While it is not limited in the number of touches that can interact, or paint at the same time, it 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 their touch is.
When the user touches the active area of the paint node, particles are internally created as blobs of paint. Among other settings, the user can change the color and size of the brush while painting; all of the painting done before any of these changes are made will stay the same. The user can assign a brush shape by using the BrushTexture property. 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 no matter the speed the interaction takes.
In Ventuz 8, the way the Touch Paint Node is rendered has been overhauled. The Touch Paint Node now uses correct color spaces and pre-multiplied alpha. It is still possible to use the Legacy Mode to have the Touch Paint Node work the way that it did before Version 8.
Additionally, there is now a new Intensity slider to increase or decrease the intensity of the drawn line.
In Ventuz 8, it is now possible to undo and redo strokes if the EnableUndo property is set to true. The Undo & Redo methods perform the corresponding operation. As stroke we define the interaction between the TouchBegin and TouchEnd event.
The most important setting, performance-wise, is the FadeOut behavior property. When FadeOut is disabled, the particles generated during painting will be "baked into" the result texture and the particles will be destroyed. This is the most efficient mode of operation because Ventuz renders a single texture instead of multiple particles.
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 and calculated every frame. This can lead to performance penalties if too many particles exist at once. When the Eraser property is activated, "negative particles" are created that will also render each frame. Erasing therefore actually 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 for 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.