x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Decals on destructibles

Hi

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

Best regards Pierdek

Product Version: Not Selected
Tags:
more ▼

asked Jun 23 '14 at 08:02 PM in C++ Programming

avatar image

Pierdek
2.6k 73 47 130

avatar image Pierdek Jul 08 '14 at 07:23 PM

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

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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)

more ▼

answered Jul 08 '14 at 09:45 PM

avatar image Pierdek Jul 08 '14 at 10:45 PM

Thanks for answer.

avatar image Pierdek Jul 09 '14 at 11:57 AM

Huh, I found something interesting, decals on destructibles are working ;)

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 ;)

avatar image Bladerskb Jul 09 '14 at 07:54 PM

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++.

avatar image Pierdek Jul 10 '14 at 06:34 AM

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.

avatar image overreal May 25 '17 at 08:28 AM

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.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question