Course Meshes

To create separate playable surfaces, like fairways and greens. We need to convert the basic shapes we drew in Inkscape into 3D objects that are sloped to match our terrain. We created a specialized tool for this, called Meshery.

  1. Course Meshes
    1. Creating Meshes
    2. Import Meshes Into Unity

Creating Meshes

  1. Download and open the Meshery tool.

    On Windows, you may get a warning from Microsoft Defender. Click More info and then select Run anyways

  2. Click the Import RAW Terrain button and locate the raw terrain data file you created in the Course Terrain step.

  3. Click the Import SVG button and locate the SVG file you created in the Course Map step.

  4. Set the Terrain Height value to the same thing as your Terrain Height in Unity.

    To find your terrain height

    1. Click the terrain object in your scene.

    2. Click the Terrain Settings tab in the Inspector on the right.

    3. Scroll down to your Terrain Size section and you should see Terrain Height

  5. In Meshery you can optionally set a Terrain Smoothing value for you terrain, to smooth out any rough / bumpy terrain. For more fine grained control, consider editing and smoothing your terrain in Unity and exporting a new RAW file for Meshery.

  6. Click Export Meshes and select a the location to save your OBJ file containing your course meshes.

Meshery Screenshot

Import Meshes Into Unity

Next you’ll want to import the OBJ file into your Unity project. These meshes will sit just above your terrain layer. Make sure you’re using the project template and have the OpenGolfSim Developer Toolkit package, which should include a tool for importing and batch assigning base materials to your meshes.

  1. In your Unity project, go to Tools > OpenGolfSim > Import Meshes

  2. Click the Select Folder button and locate the folder on your computer that was created by the Course Meshery tool.

    Import Mesh Screenshot

  3. At this point you can batch assign materials like grass and sand to your course surfaces.

  4. Click the Import OBJs button and wait for the script to automatically import the course meshes to your scene.

  5. Once the task finishes, you should see a new parent game object with the name of your file.

  6. After import, you’ll likely need to reposition the parent game object to sit above the terrain by offsetting the Y position to be above the terrain.


Next up: Build Your Course