Decals and Destructible Meshes

Hi everyone, I noticed that all decals applied on destructible meshes disappear when i start fracturing it. Is there a way to avoid this behaviour? Am i doing something in a wrong way?

I would like to get a result similiar to the game HATRED (that is made with Unreal Engine 4 and uses the destructible mesh), where the blood decals and the bullet holes decals does not disappear after the mesh is fractured.

Hope someone can help me :slight_smile:

I attach some images for better understanding how it looks like in the game.

This can’t be done with blueprints, take a look:
https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Private/Components/DestructibleComponent.cpp


void UDestructibleComponent::OnDamageEvent(const NxApexDamageEventReportData& InDamageEvent)

// After receiving damage, no longer receive decals.
if (bReceivesDecals)
{
	bReceivesDecals = false;
	MarkRenderStateDirty();
}

Comment this code and the decals will stay. You should write some logic to hide decals, for example when all destructible chunks dissapear or something :slight_smile: for performance reasons.

I modified that file and recompiled the project in visual studio but it doesn’t seems to work, decals still ‘‘disappear’’ when the DM ‘‘cracks’’. The decal tho is still there in fact if another object pass near the area where there was the decal it stil project on the mesh.

a82d892bfc8903366b3d50a30d5795f74c961a21.jpeg

BEFORE

AFTER

Did you recompiled whole engine or only your project?

If you’re referring to this: Building Unreal Engine from Source | Unreal Engine Documentation yes, i did it.

Still doesn’t work :confused:

EDIT: i read online that this is some kind of feature that UE4 has in its code to be more ‘‘optimal’’ (?). But for me this make no sense, if i want that the decal stays on the mesh, why i’m not able to make it? :frowning:

Unfortunately that is how decals work - they are projected at runtime.

AFAIK if you want the decals to stay on the fractured pieces, you will need to apply them in an alternative many.

For example, stamp them to the texture that is applied to the fragemented pieces. (This is more work)

@OptimisticMonkey I don’t care if the decal stays on the chunks, I just want the decal to stay if the DM (destructible mesh) is destroyed. I wish i could achieve a result similiar to THIS game (Hatred): http://imgur.com/a/r4Im8

Right now when the DM is ‘‘fractured’’ in any area all the decals projected on it disappear, and i don’t want this to happen, ( i don’t care about the performance ) seems incredible that a powerfull engine like UE4 has this HUGE limit (in my opinion). I hope there is a solution for this :frowning: