New to UE. not game dev, questions about realtime mesh alterations

As per the title, I’d love to know how realtime mesh alteration/deformations are done in realtime in UE and games in general (what part of the API must I access?). I’ve messed with procedural mesh generation before with little success but I just want to know how this is done. I have an application in mind which will require meshes to be deformed according to a simulation in real time. I understand there is a bandwidth limitation between the GPU and the CPU… which is what leads me to this query.

Any assistance would be met with great appreciation!! :smiley:

The regular Static Meshes cannot be deformed in real-time, because they are hyper-optimized by the renderer, sometimes in ways that don’t preserve the original index/vertex relationship.

The Skinned Meshes can be deformed, but only by pre-declared morph targets, or by moving bones around.

To update actual vertex/triangle data in real time (possibly every frame,) you’ll want to enable the Procedural Mesh plugin in the Plugins list, and then use the API provided by that module (mainly, CreateMeshSection and friends.)

You could also look at the Voxel Terrain plugin in the marketplace – if you purchase the full thing, I think it comes with source code for the plugin, and you can read through it for ideas about how to do procedural geometry update.

1 Like

OK that’s pretty much what I had going on.

I have enabled ProceduralMeshComponent and have been working with it.

Running UE-4.62.2; and I’m having a problem where when I load my project the UE4 editor crashes. Its not clear what caused it, but I understand that it initially crashed while editing my CPP files and I kept writing code after that, and havent been able to load said project since.

Again. Would love some help troubleshooting. And much appreciated @Jwatte!

Posting a log and screenshot of the error.

marine.log (40.8 KB)

I obscured a few things out of personal preference. I don’t believe they are necessary.

You are accessing an array out of bounds. If you start your project with the debugger attached you can probably trace the specific line where the error occurs.

This ocurred on project load. I couldn’t load the project. Turns out putting said code in the method responsible for filling the default values can be problematic if you’re code isn’t ready! I believe that first method (I forget its name) gets called on build.

Question. Are there any tree data structure’s available in UE4? I understand UE was not made with the CPP STL. Its just not in my interest to build my own tree implementation in CPP, but if I must, then I will. :frowning:

There’s TMap<Key, Value> which has the additional benefit of being UObject aware and thus participating in the Unreal garbage collection system (which is the main reason it uses its own containers.)

Also, you can start the editor without a project, attach with the debugger, and then load the project. Or you can start the project-loading editor from the debugger in the first place.

1 Like

Very good. Actually found that such data structures aren’t needed WHEW.