Removing grass and small foliage

How to change generated runtime terrain

Summary

Published: Mar 18 2025 by justarandomguyintheinternet Last documented update: Jul 08 2025 by mana vortex

This guide shows how to selectively block small foliage such as grass and pebbles, which is generated at runtime for terrain.

Wait, that's not what I want!

If you would rather edit other objects: don't. Remove the original, then spawn your edited object in the same spot.

Requirements

  • WolvenKit

  • MS Paint

Finding the terrain mesh

  • First, find the worldTerrainMeshNode on which the foliage resides, using RedHotTools

    • To make this easier, go to the settings tab of the World Inspector window, and set "Show Marker" to always

  • Copy the mesh path clipboard by middle-mouse-button clicking it

Locating the right terrain mesh node, made easier by forcing markers to always show

Extracting files in WolvenKit

  • Now, add the mesh file to your WolvenKit project

  • Open the mesh file

  • At the top of the mesh view window, you will see a collection of "CBitMapTexture / Texture Preview" headers

    • Locate the CBitMapTexture which when hovered shows the file-name ...foliage.xbm

    • Right click it, and select "Extract Embedded File", and chose a location to save it too (Default is fine)

    Find the one which is a BW texture, and the corresponding CBitMap texture one, which is named ...foliage.xbm

    Right-Click the CBitMapTexture one, and select extract

Finding the right part

  • Now you must figure out what part of the texture to edit, to do this try and map the texture to the game world

  • E.g.

Editing Texture

  • Export the .xbm using WKit's exporter, as .png

  • Open it in e.g. MS-Paint

  • Paint the parts of which you want to remove the foliage black

    • Make sure you use full black, and do not end up with grayscale pixels

  • Re-import the texture into WKit

Make the terrain use the custom texture

  • Now, make the terrain mesh use your custom foliage mask texture, as follows:

Change the MaskFoliage of the terrain mesh' perloadLocalMaterialInstances to point to the modified foliage mask
Make sure this is set to default

Last updated