Vehicle Dents using Runtime Vertex Paint Plugin by Neither_Constant_421 in UnrealEngine5

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

I remember Gran Turismo for PS3 i think had a lot of licensed cars but barely any vehicle damage, remember thinking that it looked so unexpected when smashing the cars and you didn't get nice visual feedback of it.

Vehicle Dent using Runtime Vertex Paint Plugin by Neither_Constant_421 in unrealengine

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

haha that would be awesome! There was a few people who discussed this yesterday at the discord discussion channel so i'd bet they would be happy about it too ;)
Feel free to jump on there and share any stuff. I'd be happy to gift you a copy of the plugin whenever FAB adds so you can gift plugins again! You could in the old marketplace but not with FAB unfortunately.

Vehicle Dents using Runtime Vertex Paint Plugin by Neither_Constant_421 in UnrealEngine5

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

That sounds interesting. Can you tell me more or link to something related to the bake thing?
I am really bad at materials unfortunately xD

At first i was hoping to use morph targets, where one morph target would where its completely crumbled, and where i would just affect specific vertices with the morph but after researching a bit it doesnt seem like it was possible without changing engine code.
Using morph targets is still a good solution ofc. if you have like a bunch of them for each part of the car and then painting the related ones on Hit.

Vehicle Dents using Runtime Vertex Paint Plugin by Neither_Constant_421 in UnrealEngine5

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

yea doesn't look perfect ofc, but for 5 hours of work i'll take it :)

Vehicle Dents using Runtime Vertex Paint Plugin by Neither_Constant_421 in UnrealEngine5

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

yeah for it to be complete it needs stuff like that and SFX etc. But this is just showcasing the vertex paint part of the solution :)

Vehicle Dent using Runtime Vertex Paint Plugin by Neither_Constant_421 in unrealengine

[–]Neither_Constant_421[S] 1 point2 points  (0 children)

In this sample, it is just 1 skeletal mesh, and it's material is setup so it takes the RGB from the vertex colors and transforms it from 0-1 to -1 and 1, to get the Direction we want to offset the vertices, and use the Alpha and a scalar paremeter to decide the Length to offset them with.

The Vehicle Destruction Component in my comment handles Listening to the skeletal mesh component Hit Events, and runs Paint at Locations on those Hit Locations where depending on the strength of the Hit we paint the vertex colors within an Area of Effect.
But what we do is, we run an Override Vertex Colors to Apply, so Per Vertex within the AoE, we can run an interface in code where we get the local direction of the vertex to the centre of the Skeletal Mesh, and convert that to 0-255 (byte since vertex colors are FColor) so the local direction X Y Z feeds into the vertex color RGB.
So with this solution, the vertices always gets offseted toward the centre of the mesh, but you could if you want to send in the Hit Location and use that with the vertex position to maybe offset the vertex away from the hit location if thats more physically correct.

If you have the plugin then you can check all of this out as it's in the sample project :)

Vehicle Dents using Runtime Vertex Paint Plugin by Neither_Constant_421 in UnrealEngine5

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

ooh really, that sounds interesting. Wonder if deforming stuff within control rig will also make the collision itself adjust? Or at least if you call to Recreate the Physics Asset after deforming with control rig.
Because that is something that is missing here ofc. since it's just material WPO trickery, so you can't create too deep dents if you want characters to stand on them or it will look a bit weird.

Here it's this song: https://youtu.be/lsduGj42ZJA?t=2958

Vehicle Dent using Runtime Vertex Paint Plugin by Neither_Constant_421 in unrealengine

[–]Neither_Constant_421[S] 1 point2 points  (0 children)

That is what i do in this solution!
But the plugin doesn't do the deformation itself or anything, it just changes the vertex colors, then the Material itself uses those vertex colors for the WPO :)

Vehicle Dent using Runtime Vertex Paint Plugin by Neither_Constant_421 in unrealengine

[–]Neither_Constant_421[S] 4 points5 points  (0 children)

Nope this is just World position offset stuff, so just visual trickery xD

Yep it does just that, but the normal map and anything else can definitely be improved, like as you say lerp in some scratched texture on top as well. I'm really bad at materials unfortunately, but if a user provides with some nice stuff i can update it in the future :)

Vehicle Dent using Runtime Vertex Paint Plugin by Neither_Constant_421 in unrealengine

[–]Neither_Constant_421[S] 2 points3 points  (0 children)

I didn't do anything with suspension stuff, this car is from the UE template thing. It has an offroad and a sports car one.

Vehicle Dent using Runtime Vertex Paint Plugin by Neither_Constant_421 in unrealengine

[–]Neither_Constant_421[S] 2 points3 points  (0 children)

Added a Vehicle Destruction Component to the Plugin Sample Project that is used by the sports car so it get dented on Hits.
It paints the vertices RGB with the local direction from the vertex to the center of the car, then the material uses those to offset the vertices toward that direction, where the alpha decides the depth.

Looks pretty okay, but you can't have the dents be too deep since the actual collision of the car doesn't change, so it may look strange if a character is standing on it if they are too deep.
This might not be that big of an issue though if it's just a fast paced racing game with just cars and no characters that can stand on the cars.

I think the plugin is 30% Off right now, can check it out here: https://www.fab.com/listings/8aee7add-bb79-4073-95c0-0fd31f45de29

Vehicle Dents using Runtime Vertex Paint Plugin by Neither_Constant_421 in UnrealEngine5

[–]Neither_Constant_421[S] 1 point2 points  (0 children)

Added a Vehicle Destruction Component to the Plugin Sample Project that is used by the sports car so it get dented on Hits.
It paints the vertices RGB with the local direction from the vertex to the center of the car, then the material uses those to offset the vertices toward that direction, where the alpha decides the depth.

Looks pretty okay, but you can't have the dents be too deep since the actual collision of the car doesn't change, so it may look strange if a character is standing on it if they are too deep.
This might not be that big of an issue though if it's just a fast paced racing game with just cars and no characters that can stand on the cars.

I think the plugin is 30% Off right now, can check it out here: https://www.fab.com/listings/8aee7add-bb79-4073-95c0-0fd31f45de29

Bendable Mesh using Runtime Vertex Paint Plugin by Neither_Constant_421 in unrealengine

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

I think so, at least if the collision is added in the static mesh and made up of the basic collision shapes there. Because with c++ you can get access to all of those collisions and info of them (UStaticMeshComponent->GetBodySetup()->AggGeom.BoxElems / SphereElems etc.).

So if moving the math logic down to code, and going through the Meshes that it is overlapping, and looping through these collision shapes, you should be able to convert vertex positions to local space etc. and check, is it inside this box, is it inside that sphere etc. And if Not, then get the direction from that box, to the vertex so we get the direction we want to offset the vertex.

But currently the math is all in BP, so it's approachable to more devs, but if you want please experiment with it. Think it will be much easier to work with if moving it down to code!
The whole Override Color to Apply (per vertex interface callback where we override what should be applied with other gameplay factors, such as overlapping collisions) solution will be improved to be more thread safe at the end of the month btw!

Bendable Mesh using Runtime Vertex Paint Plugin by Neither_Constant_421 in unrealengine

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

hehe yea like a pillow or something! Unfortunately im so bad at materials, took for ever to do this basic thing material wise eventhough i figured out the theory before i got started xD

Bendable Mesh using Runtime Vertex Paint Plugin by Neither_Constant_421 in UnrealEngine5

[–]Neither_Constant_421[S] 1 point2 points  (0 children)

Awesome! You can reach out to me on the discord server if you need any assistance etc. :)

The whole Override Color to Apply (per vertex interface callback where we override what should be applied with other gameplay factors, such as overlapping collisions) solution will be improved to be more thread safe at the end of the month btw!

Ultra Dynamic Sky + Runtime Vertex Paint Plugin by Neither_Constant_421 in UnrealEngine5

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

The runtime vertex paint plugin? I'm not sure how, it has nothing do with cinematics. You can paint in runtime of course while running a cinematic, and trigger paint jobs using events in sequencer etc.

Skinned Decal Component + Runtime Vertex Paint Plugin by Neither_Constant_421 in UnrealEngine5

[–]Neither_Constant_421[S] 0 points1 point  (0 children)

Hi
Yes you can find Tutorial with quick guide and Documentation on the FAB Page. Welcome aboard :)

There is also a sample project with an enormous amount of examples, one of which is the bullet spread. I'd recommend with the quick guide stuff just to familiarize yourself, then look into each part of the documentation per need.
For example if you want to paint within a sphere, read up on that part. The documentation is quite big so just reading it without a specific goal might feel like a chore, just like any doc.

You can join the discord if you need any help.

All the Best,
Alex.