Decals on destructibles

Hi

Decals dynamically spawned on destructible meshes aren’t working:(
Do you have any plans to fix it?

Best regards
Pierdek

Questions without answers = bad support. It is better to give answer like that: we don’t know, do it yourself or something.

We currently only have deferred decals and projecting them to many small pieces of geometry would be very inefficient and problematic (masking, per object projection, coarse culling, maintain transformations). This problem would be better solved with classic forward decals or using dynamic texture mask - which we don’t support yet. We have plans implementing both but because decals could be projected to any material this is more tricky in the general case (WorldPosOffset/Displacement/Skinning/Morph, animated meshes in general). We don’t have this task on the near term timeline.
Some workaround might be possible (adjust the destructuble material, change the decalmask of dynamic meshes to receive decals - can look ok for controlled static cases)

Thanks for answer.

Huh, I found something interesting, decals on destructibles are working :wink:

The issue is in the ShooterGame example

UGameplayStatics::SpawnDecalAttached(DecalData->DecalMaterial, FVector(DecalData->DecalSize, DecalData->DecalSize, 1.0f),


I changed 
FVector(DecalData->DecalSize, DecalData->DecalSize, 1.0f) 

to

FVector(DecalData->DecalSize, DecalData->DecalSize, 5.0f)

And I see decals:)

Of course when destructible is destroyed, all decals dissapear but this is another problem :wink:

Martin, what about projecting them on the part of the wall that wasn’t destructed not on the destroyed pieces.

For example you shoot a shotgun at a wall. pieces and chunks full off and a decal is spawn at the area where the destruction took place? Is there anyway to enable this through c++.

Another piece of code that may be removed:

void UDestructibleComponent::OnDamageEvent(const NxApexDamageEventReportData& InDamageEvent)
{
	SpawnFractureEffectsFromDamageEvent(InDamageEvent);

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

If I comment out this section:

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

The decals projected on non destroyed part of destructible will stay.

Its 2017, and I see the issue still remains. For a large destructible wall, shooting a small section will hide all the decals, that’s looks bad.