Procedural Mesh Examples - free!

Even though you’re obviously doing this in c++ and will be able to do this way faster than i am doing. Check out this series im working on https://youtu.be/0o7T6Pu0WJs

This is awesome man, I’m definitely going to go through your videos :slight_smile: Keep it up, I wish there had been something like this available when I started playing around with this.

I was using the pre-built 1.2 libraries. I did get static collisions enabled for the cube actor - but for some reason the same rules didn’t work for the noise-field terrain.

I’m still struggling to understand how Unreal deals with collision meshes in general - but here’s the configuration that worked for me. It would be nice to have physics turned on and collisions enabled, but I’m guessing you’d have to build the collision mesh in RMC by hand.

    	MeshComponent->SetSimulatePhysics(false);
       MeshComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
      MeshComponent->CreateMeshSection(0, Vertices, Triangles, BoundingBox, false, EUpdateFrequency::Infrequent);
      MeshComponent->SetMaterial(0, Material);
      MeshComponent->SetMeshSectionCollisionEnabled(0, true);

I just came across your question.

Most of the time if you only want static collision, in other words the RMC itself is not moving, you just need to tell the section to enable collsion either by the flag in CreateMeshSection, or using SetMeshSectionCollisionEnabled like you have here. The one problem with this is don’t expect it to be super fast. Collision in UE4 involves the PhysX cooker which isn’t the fastest thing around. The RMC is getting a slight upgrade to collision probably today actually as long as you’re on UE4.14 preview or above. I’m working on some potentially major upgrades and talking with Epic on the possibilities of this coming to mainline UE4 as to go beyond where the RMC is currently will require engine changes.

Now, if you’re wanting the RMC to have collision and physics enabled where it can move and bounce off things it gets more interesting. The above part with the cooker still applies but there’s another factor. By default the mesh sections use the triangular mesh you supply as the collision surface. The problem is PhysX doesn’t support moving triangular meshes for a list of reasons, and so the only way to get moving collision is using convex collision. Convex collision works fundamentally different, where the triangular mesh is mostly poly perfect collision and can handle convex/concave shapes, convex can only handle convex shapes. The way this is commonly handled for concave objects is to decompose it into multiple convex shapes to approximate the object. That is another slow thing to do usually, so in this case you’d have to probably generate those yourself from whatever is generating the shape.

Hope that helps even though it’s a month late! :slight_smile:

Thank you very much for the tutorial / example project!

The procedural mesh examples I tried before this one came out didn’t get me too far in getting anything actually working, but this made everything crystal clear!

Anyway, what I did is a thing that updates a mesh procedurally according to audio playing on the OS (eg. from Spotify/Foobar/Youtube/anything). My thing is bit of a mess though and not very stable. And it especially does not work out of the editor (yet?).

Here’s a longer description: https://rabid.prototyping.xyz/2017/0…real-engine-4/
and the source code: GitHub - Tsarpf/UE4-Procedural-Audio: Creates meshes procedurally in real-time from any audio playing

I’ve stopped developing this for now, so I thought I’d post it here if someone else wants to give it a go, or maybe someone comes up with something even better!

Adding collision for one might be cool.

Does that mean we can hope for faster collision processing?

Very cool! I was playing around with very similar things last year, including eXi’s plugin :slight_smile:

I got bogged down with real work, but will pick this up again later :slight_smile:

Two examples of what I was doing:

(very compressed on youtube but the sky has a full grid moving)

(a bit crude)

Oh my gosh, those are amazing. Thinking of picking this plugin up if it works with 4.14., I’d like to attempt procedural buildings :slight_smile:

I love it! Especially the sky thing. It would be an awesome addition to many games.

My initial idea was to make it so that the player could surf/snowboard on the sound wave, though making it fun to play while keeping the real-time aspect would be a challenge. Just as a visualization it might be cool though.

Project updated for UE 4.16. Going back to working on this to add more samples and adapt to the latest changes in the Runtime Mesh Component.

Updated with a new sample that is a (non line-based) Sierpinski mesh to showcase a more advanced UV mapping scheme.

Updated for 4.20 and latest ProceduralMeshComponent. Sorry how long it took! :slight_smile:

@SiggiG
some serious issues with the plugin… I cannot save the level map anymore! I used the branching tree class, create a blueprint with it and have some duplicates on the level… Any ideas?

Hey @Virtew sorry I didnt see this message until now. I havent taken a look at the examples for a while, so not sure whats going on or if its a problem with the Runtime Mesh plugin or not. Did you update all the submodules?

Updated to UE 4.22.

Because of confusion for some users, I merged the submodules all into a single project.

Sorry for the late reply you too… we abandoned that project soon after, not because of the plugin anyway. Didn’t check anymore, maybe we’ll have a try with the latest update! Thanks for the feedback.

Im so confused what is that and how to learn it?

Now updated for UE 4.25 and Runtime Mesh Component v4.1.

Sorry how long it took :slight_smile:

Updated for UE 4.26 and latest Runtime Mesh Component.

Hi, I’m trying to open it with UE 4.26.1 and these messages pop up
Any suggestion? :slight_smile:
Thanks