[TUTORIALS] Photons Be Free: Mini-tutorials and other curiosities

I am happy to hear it is a bug and not something I was doing incorrectly. I look forward to the fix. Thank you.

Destructible How-To #4: FBX Chunks Continued - Barrel and Fence

Coming Shortly.

Destructible How-To #5: Using “Do Not Fracture” to make a hole in the wall

Overview:

The Flag for Do Not Fracture allows assigned chunks to not be break away from the destructible even if enough force has been applied to do so. This can be useful for making sure parts of the destructible never break or if you want to have a simple hole that can be blown away in a wall for your character to go through.

Basic Destructible Settings:

Basic_Settings.png

For this part, the settings focused on are Impact Damage and Support Depth.

It is not required to use Impact Damage, but can be if you want a impact from any physical objects to impart damage on the destructible.

Support Depth on the other hand is required to make this work.

Chunk Parameters: Do Not Fracture

Depth 0: no fracture applied:

Depth 1: slightly exploded view of the fracture chunks:

In order to assign the chunks we want to NOT be fracture we need to select them with the mouse. Hold CTRL and LMB to select chunk that you want to assign a flag in Chunk Parameters. When selected you will see a blue bounds box around the chunk.

Once you have a selected the chunks you want to assign a flag, go to the Chunk Parameters Tab and select Do Not Fracture.

That’s it! You have now set up a basic wall that can have chunks that cannot be fractured.

Final Results

Destructible How-To #6: Using “Impact Resistance” for better damage effects (ie. glass vs. concrete wall)

THIS WILL ONLY WORK WITH 4.8 OR LATER.

Overview:

This will cover a basic setup for using **Custom Impact Resistance ** to make a destructible that can provide a low resistance to impact like Glass or one that provides more resistance to an impact, like a Concrete Wall.

Basic setup for LOW resistance

CustomImpactResistance_Low.png

for the basic setup enable Custom Impact Resistance and set a low value. This can depend on some of the Impact Damage and Damage Spread settings as well, but for a basic example this will get you started.

Demonstration of LOW resistance

Basic Setup for HIGH resistance

CustomImpactResistance_Low.png

Using High Resistance, the Impact Damage and Damage Spread play bigger roles in the look and feel of your destructible.

To find a good starting point for the High resistance, try setting a large value and working your way down to a lower one until you get something that looks OK.

At that point, Adjusting the Impact Damage and the Damage Spread can help refine this even further.

Demonstration of HIGH resistance

Other How-To #5: Custom Collision Beginning to End

Other How-To #5: Custom Collision Demonstration - Beginning to End

Overview:

This will be a demonstration of the concepts put forth in the documentation for FBX Static Mesh Pipeline.

Documentation: FBX Static Mesh Pipeline in Unreal Engine | Unreal Engine 5.1 Documentation

**Step 1: Collision Shapes **

There are three types of custom collision that can be used when creating your own custom collision.

When making convex collision shapes it’s best to avoid shapes that are like this:

https://docs.unrealengine.com/latest/images/Engine/Content/FBX/StaticMeshes/Convex.jpg

]

A mesh that is too accurate like this will not be considered as a single convex hull. See Step 3 for examples of why this will not work well as a convex hull.

**Step 2: Naming **

Box = UBX_[MeshName]_XX

Sphere = USP_[MeshName]_XX

Convex = UCX_[MeshName]_XX

When creating your custom collision mesh it is important that the mesh name of the collision mesh match the mesh you’re creating for collision. If you’re going to use more than one collision mesh you will simply need to add numbers to each collision mesh. If you’re using a single collision hull, there is no need to use “_XX” after the mesh name.

For example:

Mesh name: Statue

I want to add three collision spheres to my mesh.

I create the three spheres and name each one.

USP_Statue_00, USP_Statue_01, and USP_Statue_02

GIF demonstration

Step 3: Import Options

There are two options here that we need to be aware of when importing custom collision.

Auto Generate Collision: If there is no collision hulls detected with your mesh using the prefix UCX, USP, or UBX the editor will generate basic collision on import. If these prefixes are detected this option will be ignored on import.

One Convex Hull Per UCX: This option when disabled will import more accurate collision, but it will generate multiple convex hulls rather than a single convex hull. See the example below with this disabled. This can sometimes produce errors with collision hulls that are generated though.


Box Collision – UBX

UBX_BoxCollisionUE4.png


Sphere Collision – USP

USP_SphereCollisionUE4.png


Convex Collision – UCX

UCX_ConvexCollisionUE4.png


Convex Collision that is too accurate

Accurate Collision Mesh

accurateCollisionMesh.png

Results with Import options One Convex Hull Per UCX: Enabled

In this image you will see that with the option enabled in the import options the collision that is imported does not look like the more accurate collision mesh we have. This is because that would not be able to make a single convex collision hull.

Think about this like a barrel with the inside hollowed out. A single convex collision hull would not be able to provide accurate collision for the interior of the mesh. The collision would simply be a cylinder that is around the barrel as a single collision hull.


Results with Import options One Convex Hull Per UCX: Disabled

Now that we’ve disabled the option for one convex hull we can see that our mesh has more accurate collision that represents the original mesh above. This is done by creating multiple collision hulls from the more accurate collision mesh we tried to import.

As you can see in this image with some of the collision hulls pulled off to the side we now have multiple hulls that comprise our collision for the mesh. If you look at the indicated of primitives on the top left of the viewport in the Static Mesh Editor you will see that there is a number referencing how many collision hulls were created.

This is not necessarily the best option and it’s always better to use lower collision primitive counts where possible.


BONUS: Creating Collision in UE4 Static Mesh Editor with AUTO-CONVEX Collision

In the Static Mesh Editor go to Menu > Collision > Auto Convex Collision

This will open this tab:

There are two options here.

Accuracy: This will determine how accurate the collision hulls that are generated are to the mesh.

Max Hull Verts: This will determine the number of vertices that should be used for each collision hull that is generated.

Examples using Auto Convex Collision

Accuracy: 0.5
Max Hull Verts: 16
Num of Hulls: 3


Accuracy: 0.75
Max Hull Verts: 16
Num of Hulls: 5


Accuracy: 1.0
Max Hull Verts: 32
Num of Hulls: 24


Auto Convex is getting a good update in 4.8 that will make it much more accurate when generating collision via this method.

As you can also see from the number of collision hulls generated, even making out the auto-convex collision settings gives us much less than the 162 by generating our own collision that does not use a single convex hull.

The best choice here is to find a balance for what works best for your collision while retaining a more true collision response to your mesh. For objects that need it this would be a good way to get more accurate collision. For objects that don’t need accurate collision I would suggest using the box or sphere primitives where needed.

Ty very much, for this Thread.
What is with the performance inside UE, if you make massive use of auto-convex?
Best regards Stefan

The video doesn’t load in the forum, I had to quote to find the link and watch it in youtube.

In what regards? Using too many collision hulls for more accuracy?

Are you experiencing any issues with auto-convex collision causing performance issues? It seems to imply this in your question.

Let me know what your use with it is and I can do some of my own tests and see if I take a look. :slight_smile:

Thanks for letting me know ikifenix. Fixed the link. [TUTORIALS] Photons Be Free: Mini-tutorials and other curiosities - Community & Industry Discussion - Epic Developer Community Forums

Once 4.8 releases I plan on updating this since the car is noticeably stopped when it hits the DM and then it falls over.

With 4.8 I’ll be able to use Custom Impact Resistance to help make this better so that anything below that impact value will not cause any damage, but when I have a impact large enough it will knock it over without the stopped of the vehicle.

many thanks for you

Destructible How-To #7: The power of World Support

Overview:

In this short example we’ll go over the use of the “World Support” flag in the Destructible Mesh Settings.

World Support is simply a way to enable the Destructible to be environmentally supported by any static geometry inside the level that it’s in contact with so long as it has at least a Support Depth of 1.

Setting up World Support

The setup is fairly straight forward. There are two things that initially need to be setup to make this work. Support Depth needs to be set to the depth layer that it will be supported. If you’re using the in-editor tool this will simply be 1, since there cannot be more than one depth layer created in this tool.

The next setting is to enable “World Support” flag.

Demonstration

What’s going on:

By enabling World Support and using at least a Support Depth of 1 we have enabled our destructible to be supported by static geometry that it’s in contact with.

The Support Depth allows chunks to stick together without breaking apart unless they’ve received enough damage to do so. By enabling World Support this will keep the chunks that are in contact with static geometry that have not received enough damage to break free supported and in place.

The outer edges in this DM are supported by the static walls because they’ve not received enough damage to break free yet.

In the video demonstration, we see the first wall does not have World Support enabled. This allows the wall to be pushed back when enough force hits it. It will bounce around since it’s not supported by the environment, whereas the second wall is supported by the floor that it’s in contact with causing the bottom of the mesh to be environmentally supported by the static geometry.

Amazing documentation , I wanted to find information to how to implement physics calculate in UE4. Further, I also work with 3ds Max for create geometries and I was very interested to how to work with APEX PhyX plug-ing in Max. One question, It will be possible that APEX PhyX can be integrated into UE4 in the future?.

Thanks for the documentation and greetings.

Hey Jps7101,

At the moment there are no plans for Epic to integrate the full PhysX SDK into UE4 beyond what’s already available for destruction. HOWEVER, one of our community developers, Backov (Jason M.) has integrated it into his own build of the engine and he does hope that when he’s done with it to submit it as a pull-request so that it can be integrated.

You can find more information and a demonstration of his work here: I've made a new Destructible Mesh Editor for UE4 - Community & Industry Discussion - Epic Developer Community Forums

His version eliminates the need for PhysX Labs or the PhysX DCC Plugin to create destructible assets. I’ve got an early build of it that he demonstrates. I’ve talked with him and have a build of the editor to help him test it out and offer some feedback.

Feel free to ask questions anytime. If there is a setup with Destructibles that you’d like to see just post here and I’ll do what I can to get a simple example up, similar to the other ones I’ve got. :slight_smile:

Destructible How-To #8: Damage Spread

**Overview: **

The goal with this “How-To” will be to take a look at how Damage Spread works with applying damage to our destructible mesh.

**Step 1: What is Damage Spread? **

Damage Spread is essentially how easy damage spreads to the other chunks in the destructible.

If we have a wall destructible, think about the impact point being the center of a radius of damage. The damage spread will be how much damage is passed to the surrounding chunks to break them free as well.

If we have a damage spread of 0 only the chunks that are impacted directly and receive enough damage to break free will do so.

If the damage spread is set to 0.1 (default), if the impact force is strong enough the damage passed to surrounding chunks can be enough to break all or some of the chunks free.

This is the formula for calculating the Damage Radius:

Damage Radius = Damage * Damage Spread

All chunks within the damage radius will take full damage at the point of impact. At the edge of the damage radius 0 damage will be applied.

[SIZE=3]Demonstration[/SIZE]

Tips:

If you’re having trouble with setting up Damage Spread, try adjusting lower values for Impact Damage, setting a Damage Cap for damage application, and/or Increase the Damage Threshold.

A single settings will likely not produce the results you’re looking for. It will require multiple tweaks to get just right.

Hello ,

I will studied the documentation attentively. Thank you very much! :slight_smile:

Greetings.

Favorite thread ever. Thx

Could have a version of these tutorials in maya also

But do not worry, I wrote this more as a bookmark to be able to visit this thread later.:wink:

:cool:

Unfortunately, I only have direct access to Max and I’m not all that familiar with Maya to be honest.

I have, I think, three tutorials that use Max as a basis. Two of those are using plugin’s that should be very similar to use in Maya.

The APEX Cloth one should be very similar since that is just using the DCC Plugin for PhysXLab.

The DM Animated rigid mesh is the same process in Maya. Bake the animation to a timeline and make sure to group all the chunks together. Once that is ready, export with the animation and import into UE4.

The Collision Mesh setup, this may be different depending on a modifiers availability or not since I use a specific one to get better results. I’m just not familiar enough with Maya to say if this is the case there or not. :confused:

If I missed something or you have a specific one that needs better flow let me know and I can take a look. One of the guys on our team has Maya so I can always double check things there and better explain if needed. :slight_smile:

Hi, Hobson

Okay. Is possible to clearly understand their tutorials in Max. No problem:)

Coming in the near future.

This is something I’ve been working on in my free time outside of work that I plan to make available at some point soon.

Inspiration for this is directly taken from Marko Dabrovic and Crytek’s Frank Meinl

Marko Dabrovic’s version: http://hdri.cgtechniques.com/~sponza/files/

Marko.jpg

FrankMeinl’s version: CRYENGINE - Crytek"s powerful game development platform

My inspiration for recreating this is to use in a lot of lighting tests and general editor tests that I use for my own rendering uses. It’s still in the early stages as I need to clean up my Lightmaps, some geometry, and add some more detailing along with getting my materials. My main goal with this, unlike the original files, is to focus on a modular approach, especially for testing use cases with Distance Field techniques.

My ultimate goal with this is to have a bunch of test maps for this with a range of lighting tests from Static to Dynamic. If you follow any of my posts here just keep an eye out for updates in the near future. :slight_smile:

I also want to include not only the Sponza Atrium with this but some tests with simple Cornell Boxes. There are a host of tests and tweaks with GI that can be really interesting and fun to setup and get looking right. It’ll be fun to share these tests with you and get any feedback you may have.