Show Sidebar

In Depth - Temporal Anti Aliasing

Note: This should not be confused with graphical anti-aliasing techniques used on the GPU/in the rendering process.

Bolt has built-in support for handling the dis-joint relationship between Update and FixedUpdate in Unity, to put it a bit more bluntly: The simulation (FixedUpdate) and rendering (Update) portion of your game does not always line up 1:1 with each other. This causes what's commonly known as 'micro-stutter'.

When you define a 'Transform' property on your state in Bolt, you need to assign a transform to it in the Attached callback to have it sync over the network. Normally a simple prefab would look like this:

And the code for hooking up the transform like this:

If you've used bolt past the first part in the 'Bolt 101' series, this should look very familiar. Since all simulation happens in FixedUpdate, this setup can lead to 'micro-stutter'. The way to deal with this is something called Temporal Anti-Aliasing, see wikipedia for more info: en.wikipedia.org/wiki/Temporal_anti-aliasing.

The first thing we need to do is to just setup a normal class field on our 'Sphere' class, and pass that in as the secondary value to SetTransforms.

We then split out the mesh rendering parts from our root game object into a child object, and make sure to assign the new 'SphereMesh' child object to the 'Render Transform' property we created on our 'Sphere' script, like this:

Now Bolt will take care of handling all artifacts which happen from FixedUpdate/Update not lining up perfectly.

 To Document Top