Removing grass and small foliage
This guide shows how to selectively block small foliage such as grass and pebbles, which is generated at runtime for terrain
Requirements
WolvenKit
MS Paint
Finding the terrain mesh
First, find the
worldTerrainMeshNode
on which the foliage resides, using RedHotToolsTo 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

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
This texture is used as a mask, to block foliage spawned at runtime based on various other embedded masks, appearing in certain spots
Try and figure out which part of the texture corresponds to what part of the world
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:

MaskFoliage
of the terrain mesh' perloadLocalMaterialInstances
to point to the modified foliage maskMake sure you set the Flags of the Value
is set to Default

Last updated
Was this helpful?