3Ducttapes(); Yvo von Berg | CG Toolsmith blog | C++, Python

Tycoon C++ Track presets

Track presets

  • Testing partial track presets, so you can quickly place your favorite loopings. Currently set to work with a specific track length only.

Regenerating Normals and Tangents after deformation

  • I have to update the normals and tangents after deforming the track piece, this process can be slow on larger meshes. To solve this I run the normal generation as an Unreal background task: https://wiki.unrealengine.com/Using_AsyncTasks

It is only possible to update geometry on the main game thread, so I cache all the generated values and re-run the update on the game thread every few seconds. The result is a nice streamlined workflow where the normals catchup quickly after adding some pieces.

  // Generate normals
  (new FAutoDeleteAsyncTask<TangentCalculationAsyncTask>(
    NewPiece
    )
    )->StartBackgroundTask();