Version 2.0.0
Complete surface-tracking solution with modular brushes, canvases and additional tools.
Create stunning interactive surfaces just in a second.
Last Documentation Video [V1.0]
Last Overview Video [V2.0.0]
If the documentation was made in older Mesh Tracker version, it’s still related to the actual version. If you need any further help, do not hesitate to contact me.
Developer Change-Log
version 2.0.0 [16.10.2022 - dd/mm/yyyy]
- Major cleanup & refactor
- Added smart track X Y Z rotations
- Updated Surface Drawing component
- Added visual brush feature
- Added URP support
- New example scene for URP example content
- Updated example content
Content
Basics & Intro
Mesh Tracker allows you to create interactive surfaces of any kind such as snow, mud, sand, sea and many more. Create footprints, trails, dynamic waves and make your project much more interactive.��You don’t need any programming skills. The plugin is ready for well-organized designers and advanced Unity users.
The package contains 2 most important components: MeshTracker_Object and MeshTracker_Track.�There are a few additional components:�MeshTracker_Particles, MeshTracker_ProceduralPlane & MeshTracker_Drawing
The whole track system is based on Ray Casting - ray origin and ray direction with specific distance and custom conditions. Shaders are based on two-texture-channels that blends together (upper & lower) with tessellation and displacement.
Compatible (officially) for Unity 2019 and newer. �Ready for Built-in Renderer Pipeline and Universal Renderer Pipeline.
More about each additional component on next slides...
MeshTracker_Object is a base-system for surfaces. This component must be added to the deformable surface.
It’s divided into two categories: GPU & CPU based�• GPU-Based allows you to run the mesh track system via shaders, which saves more performance, evaluates better results and works on grayscale masks (requires specific material).�• CPU-Based allows you to run the mesh track system mostly via CPU, it’s supported by Multithreading, less multi-platform issues, easier to set up, but less effective, worse results and might take more performance. The CPU-Based system handles direct mesh vertices.
MeshTracker_Track is a source of tracking. This component allows you to deform objects with MeshTracker_Object and deform its entire surface. It’s based on chronological order of layers & track layers management. Each layer class contains several properties such as Track Size, Track Graphics, Ray Distance, Condition, Events and so on...
MeshTracker_Particles allows you to simulate tracks by the specific particle collision. This component should be applied onto object with particle component. Requires track graphic and track brush. There is an option to customize track on your own. This component allows you easily simulate snowing, raining, water splashing and more...
MeshTracker_ProceduralPlane is an additional component to generate plane with custom vertex count. This is very required component if your application is focused on mobile platforms.�(mobiles don’t support tessellation).
MeshTracker_Drawing is an additional component for surface drawing with user friendly editor and useful functions for drawing. User is able to choose any grayscale brush and apply it to any surface containing MeshTracker_Object component. It’s great to make a high-quality looking surfaces.
Quick Application
Application of Mesh Tracker system is very easy. All you need is a surface [planar object highly recommended] and Track source.�
�Summary:�What will you need for basic Mesh Tracking?��• At least one object with MeshTracker_Object�• At least one object with MeshTracker_Track�• Track Graphic [You can use Track Creator for creating Tracks]�• Material [shader MeshTracker_Opaque] applied onto surface
material of type MeshTracker_Opaque.
Planar Mesh
representing our surface with MeshTracker_Object
Any Object
representing our track source that will hit objects with MeshTracker_Object
Track Creator
Track Creator is an additional tool to help you create new tracks as quick as possible. But why do I need Track Creator for creating some white and black circles?
Mesh Tracker - GPU-Based system works on grayscale textures which give information of ‘how deep/ high the surface should be’. This information is in every texture’s pixel. ��The more white pixels the texture has, the higher the surface is. �The more black pixels the texture has, the lower the surface is.
And that’s also how you can customize tracks. �Track Creator is simple and great tool for it and you are free-to-use it.
Any texture can represent ‘Track Graphic’, but Track Creator is specially designed for complete-spherical tracks. This quick solution allows you to start this tool directly from Editor and create track of any type anytime.
Track Creator is unfortunately available for
Windows OS only.
API
The whole system contains components with internal & public functions & attributes. If you are experienced programmer and you would like to make some changes or use the code, this API is for you. All functions can be called internally or through Events. Almost all properties contain Tooltips & well-organized comments.
namespace MeshTracker
MeshTracker_Object�MeshTracker_Track�MeshTracker_SurfaceDrawing�MeshTracker_Particles�MeshTracker_ProceduralPlane
Go to the next slide for more API.
MeshTracker_Object
GPU-Based Tracker [masks and grayscale textures]
• Tracking type (GPU/CPU based?)
• Custom canvas (by color tone b/w)
(If enabled, starting canvas not required)
• Starting canvas texture for tessellation
• Canvas texture quality
(The higher quality, the more performance)
• Repair surface feature
• Mesh collider generation
Available Public Functions
public void FGPUbased_CreateTrack(TextureCoords, Size, Graphic, Brush, YRotation)�• Create track on specific texture-coordinate with size, graphic, brush and rotation�public void FGPUbased_SaveCurrentCanvas(FilePath)�• Save current canvas into texture & specific path�public void FGPUbased_ClearCanvas()�• Clear current canvas content & reset all the surface heights�public void FGPUbased_CreateRepairTrack()�• Create a repair track instance on the surface (if original canvas is assigned)
CPU-Based Tracker [mesh, rigidbody, collisions & Unity PhysX]
Available Public Functions
public void FCPUbased_CreateTrack(AtPoint, Radius, Direction)�• Create track on a specific world-point, radius and direction�public void FCPUbased_ResetSurface()�• Reset current surface & all vertices to the original position
• Tracking type (GPU/CPU based?)
• Multithreading support for complex meshes
• Overall vertices world direction
• Exponential/ Linear processing
(Exponential evaluates smoother results)
• Adjust radius by the input value
(this is recommended to be checked)
• Additional condition for more physical-based interactions
• Specific tags allowed
• Custom interaction speed of vertices
(If disabled, vertices will be instantly updated)
• Repair mesh by specific speed
MeshTracker_Track
Base Layer
• Is track targeted to CPU/GPU
based systems?
• Add & Remove last layer
• Paste layer [if possible]
• Available array of layers
• If enabled, user will be able to
use effects in layers
• Quality of effects
(the higher - the more performance)
• If enabled, system will be
updated every frame
• Update after some interval
• Interval value in seconds
Available Functions
public void F_DetectSurface()�- Process raycast and detect surface - if the surface is detected, track will be proceeded
�• If booleans AlwaysCheckSurface and UseIntervals are disabled, you are able to call this functions manually. The function will process all existing layers.
• Track Size (adjust and see in editor)
• Track size will correspond to the objects
local scale.
• Track Graphic texture (grayscale)
• Brush Type (for additional details)
(more about brushes later)
• Track Name in editor
• Track Color in editor
• Ray origin from cursor input
• Ray direction in world-space (u,d,r,l,f,b)
• Origin location offset
• Raycast distance
• Allowed layers (Default, Water…)
• If disabled, user can edit which tag is
allowed
• Use object speed limits
• Track effects (more in the next slide)
• Enable events (OnSurfaceDetected)
• Copy, Duplicate and Remove layer
• Show debug graphics in editor scene
More about Track Effects next slide
MeshTracker_Track - Track Effects
Track Effects allow user to create multiple tracks at once. User can define track of what size will be at the start and what size will be at the end of its lifetime. Track Effects can be used for creating artificial waves, drops, advanced footprints, mud-tracks and many more.
In the earlier versions of Mesh Tracker, there was a component called Mesh Tracker_Fluid which theoretically did the same job as Track Effects, but it was very slow and not effective for performance. This component was removed in the Mesh Tracker V1.4 and replaced with Track Effects.
Track Effects is a brand new feature built directly in MeshTracker_Track component with much better performance results on all available platforms (including mobile).
• If enabled, use Graphic & Brush
from the original track above
• Smart rotation technique
• Process track effects in local space
• Direction of track effects
• Proceed effect twice?
• Effect motion speed
• If disabled, the effect will move exponentially with specific drag
• Overall effect lifetime in seconds
• Change brush opacity during the lifetime (if possible)
• Change track size during the lifetime (if possible)
Track Effects (in specific Track Layer)
‘Side-waves’ while walking
‘Side-waves’ while driving
MeshTracker_SurfaceDrawing
Base
• Available track graphics
• Slider to select track index
• Randomize tracks while drawing
• Mobile platform supported�• Input Key (If not mobile platform)
• Drawing track size�• Drawing track opacity�• Drawing track height
• Load selected track graphics into specific UI layout parent
• If ‘Track image button pressed’
• Additional conditions
Available Functions
public void PUBLIC_ChangeTrackGraphic(Parameters)��• Change exists track graphic by specific index in the mmt_TrackGraphics array
public void PUBLIC_ChangeTrackSize(Parameters)��• Change current track size by float or UI.Slider
public void PUBLIC_ChangeTrackStrength(Parameters)��• Change current track strength by float or UI.Slider
public void PUBLIC_ChangeTrackHeight(Parameters)��• Change current track height by float or UI.Slider
public void PUBLIC_SetImageToSelectedTrack(Parameters)��• Get selected track graphic to selected image (visualize the selected track)
URP & Built-in RP
Mesh Tracker can handle systems for both units - CPU and GPU. But the most effective way is to go through GPU - GPU-Based tracking system.��The package contains shaders for both renderer pipelines (URP/Built-in) that can be used for any type of surface. The shader has many properties and you can achieve interesting results of your choice. You can create simple water shader in a few clicks.��All shaders can be found in Matej Vanco/Mesh Tracker. As mentioned earlier, there are two major categories: URP and Built-In RP. URP version contains just one universal shader for both Opaques and Transparents. Built-in RP contains 3 types of shaders: Opaque, Transparent and Mobile. Mesh Tracker Opaque is recommended for non-transparent surfaces. Mobile shader works for Mobile platforms (IOS & Android). It’s highly recommended to use Built-In pipeline for mobiles as the URP is mostly focused on mid/hi-end devices. But still URP works with mobiles.��There is an additional cross-pipeline shader called Mesh Tracker Brush that can be used for Track Graphics as an editable tool. It adjusts track graphics opacity and its grayscale-intensity. Material that contains Mesh Tracker Brush can be assigned to the brush type in Mesh Tracker layer.
Shaders: Built-in RP
Mesh Tracker GPU-Based tracking system for Built-in RP is pretty intuitive and offers many settings that can help you to achieve desired results. First of all, if you work in a project that uses Built-in Renderer Pipeline, find the MeshTracker_ Shaders_Built-InRP unity package file and extract the file in your project. A shader sources will appear. Let’s see what the shader parameters contain…
All three shaders that the Built-In RP contains (Opaque, Transparent & Mobile) have almost identical fields that appear or disappear (depends on shader type). For example, transparent-only fields won’t show up if you use Opaque shader. Or Mobile shader doesn’t use tessellation, so there won’t be any fields for that.
It’s mostly recommended to use Built-in RP for low-end and mobile devices as the Built-In RP version of Mesh Tracker contains a complete shader that supports mobiles. It was also tested and proved by many users.
The shaders in Mesh Tracker are based on blending two major channels (two albedos, normals, speculars/metallics) with additional interpolation value. The blend value is received from displacement map red channel that is drawn using the Track Graphics in Mesh Tracker Track component. As you can see in the shader parameters, there is an upper albedo input and lower albedo input. These two channels are blended together based on heightmap displacement texture. You can offset the blend value by the Interpolation Multiplier that lies in the upper part of the shader.
• Upper color value
• Lower color value
• Color multiplications for emissives
• Color alpha + Interpolation multiplier
• Upper Albedo input [Diffuse]
• Lower Albedo input [Diffuse]
• Upper Normal input [Bump]
• Lower Normal input [Bump]
• Normal power
• Emission field [Texture input & color]
• Metallic field [Texture input & intensity]
• Specular power
• Tiling and offset
• Fluid settings
• Fluid speed [speed of textures tiling]
• Enable drops effect [water distortion]
• Additional second normal texture
• Fluid direction 1 [dir of texture1]
• Fluid direction 2 [dir of texture 2]
• Tiling and offset
• Additional edge blending (soft edges)
• Enable wave effect
• Track depth
• Tessalation amount
• Min & Max detail distance
• Displacement texture [should be grayscale or RT] - will be set internally according to your settings]
• Update normals on the object according to grayscale texture
Some attributes might not be visible in different shader types
Transparent only
Shaders: URP
Mesh Tracker GPU-Based tracking system for URP is in fact equals to the Built-in RP, but the results look much realistic! First of all, if you work in a project that uses Universal Renderer Pipeline, find the MeshTracker_ Shaders_URP unity package file and extract the file in your project. A shader sources will appear. Let’s see what the shader parameters contain…
Both surface types that the URP offers (Opaque & Transparent) have almost identical fields that appear or disappear (depends on surface type). For example, transparent-only fields won’t show up if you use Opaque shader.
It’s mostly recommended to use Built-in RP for low-end and mobile devices as the Built-In RP version of Mesh Tracker contains a complete shader that supports mobiles. It was also tested and proved by many users.
The shaders in Mesh Tracker are based on blending two major channels (two albedos, normals, speculars/metallics) with additional interpolation value. The blend value is received from displacement map red channel that is drawn using the Track Graphics in Mesh Tracker Track component. As you can see in the shader parameters, there is an upper albedo input and lower albedo input. These two channels are blended together based on heightmap displacement texture. You can offset the blend value by the Interpolation Multiplier that lies in the upper part of the shader.
• Surface options in “URP-Simple-Lit”
(Choose between opaque and transparent)
• Surface inputs in “URP-Simple-Lit”
• Primary main “Upper” base albedo map
• Main specular value (use HDR slider as well
for intensity modification)
• Advanced options in “URP-Simple-Lit”
> Mesh Tracker parameters start here <
• Main general tiling value (for all channels)
• Secondary tiling value (for secondary maps)
• Additional animated tiling feature
• Linear/ Non-linear interpolation (see tooltip)
• Additional interpolation Y level
• Secondary “Upper” base albedo map
• Secondary “Upper” normal map + intensities
• Secondary “Upper” specular map
• Underwater surface color
• Additional edge blending (soft edges)
• Two “fluid” textures - creates refraction effect
• Additional “wave” effect
• Tessalation amount
• Min & Max detail distance
• Displacement texture [should be grayscale or RT] - will be set internally according to your settings] + displacement value
• Update normals on the object according to grayscale texture
Some attributes might not be visible in different surface types
Transparent only
URP Additional Setup (for transparents)
There is an additional setup for Mesh Tracker GPU-Based tracking system for URP if you would like to create transparent URP materials with Mesh Tracker. Transparent materials in URP Mesh Tracker use GrabPass feature which works differently in URP. Please follow the steps below to completely and properly setup Mesh Tracker for URP.
Examples
Mesh Tracker contains many solid examples with full source and descriptions. You are also very free to try four example short scenes that are available for free to download (Windows & OSX only). Please keep in mind that the example demos are focused on the surface simulations and not game mechanics and gameplay.�Mesh Tracker contains all the example scenes and more.
Click on images at the right side of the screen to download demo.
Simple sea simulation
Control a boat on an open sea�Realtime sea simulation�Advanced track effects for “side-waves”�Full & simple sea interaction
3rd person snow simulation
Control a character on a “snowy” surface�Real time snow + lake simulation�2 Track sources for each foot�Modular and interactive tracks
Vehicle snow simulation
Control vehicle on a “snowy” surface�Real Time snow simulation�4 vehicle types�Modular and interactive tracks
Vehicle mud simulation
Control a vehicle on a “muddy” surface�Real Time mud + “muddy” pond simulation�4 vehicle types�Modular and interactive tracks
Smart Tracks
Smart Tracks is an advanced feature for track behaviour. Smart Tracks are used to visualize track by the objects move direction. The results are more realistic, but the process requires special track graphics. In Track Creator, enable Smart Track to generate Smart Track graphic.
�To enable Smart Track feature, go to your track layer and enable Use Smart Layer Rotation.
Tracks with Smart Tracks Tracks without Smart Tracks
FAQ (Frequently asked questions)
FAQ (Frequently asked questions)
Warnings
Mesh Tracker version 2.0.0
THANK YOU FOR YOUR ATTENTION
I hope the documentation helped you a little bit!�Join my official discord server to stay in touch!�[Just click the image below]�
�
If you would like to reach me out anyway, contact me HERE.