Mesh generation plugin for ue4
open up {your project}.uproject
in a text editor, and add the following:
"Plugins": [
{
"Name": "MeshGen",
"Enabled": true
}
]
}
the whole uproject file should look something like this:
{
"FileVersion": 3,
"EngineAssociation": "4.22",
"Category": "",
"Description": "",
"Modules": [
{
"Name": "{your project}",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine"
]
}
],
"Plugins": [
{
"Name": "MeshGen",
"Enabled": true
}
]
}
- In folder
{your project}/Config
, create a file calledMeshGen.ini
- Populate it with two arguments:
generator_type: SIMPLE
settings_file: {generator settings file name and location}
you can see & set other generator types in GeneratorFactory If no settings file is provided, it will fill the parameters with default values. You can see how settings file is read in GeneratorBase constructor
- In Unreal Editor, click and drag MeshGenerator class object from content browser into scene. Tip: To see plugin content, click
View Options
at the bottom right corner of the Content Browser window and toggleShow Plugin Content
- Click
Play
and the generator should start doing it's work!
GeneratorBase is the Parent class for all procedural generator types. the only function that must be overriden is loadTilesAsync(const TileList&)
.
The way the MeshGenerator Works is through a series of steps:
- Determine which "tile" the player pawn is occupying
- Determine which tiles should be rendered in game, and which tiles should be loaded into memory
- load and render relevant tiles, and unload / derender obsolete ones.
- repeat 1-3
Custom mesh constructors must define the vertices, connectivity index, and texture of tiles as calls are made to the loader. SimpleGenerator uses perlin noise to create a 2d plane with texture relative to vertex height.