Unreal 5.1 - How to paint damage textures and other effects on skeletal meshes

Published 2023-02-05
This tutorial video explains how to paint on skeletal meshes in game, which can be used to paint damage on materials, and other effects. Here are the techniques explained:

- Unwrap mesh in runtime to find a physics' hit UV location
- Use that UV to generate 2 masks as Render Targets
- One of them is used to swap the material textures for a "damaged" one
- The second is passed through a material stage to dissipate it, and then used to add glow and particle VFX.

All this solves the problem of not being able to get the hit UVs on skeletal mesh characters ("Find UV from hit" not working as of Unreal 5.1)

All Comments (21)
  • @lyoshko
    You set M_Unwrapper CaptureSize=1024 and SceneCaptureComponent2D Ortho Width=1024. It is not neccessary to match this size to texture size. It's not even pixels, it's centimeters. You can make both values=100 for example and it will still work. Thank you for nice tutorial! It's a good start to my planned car damage system.
  • Cant wait to try this out. Il keep you guys posted on whether I can get it to work or not
  • my dude, you are a hero. This is was one of the ( somewhat ) unsolved problems in UE (subbed too :)
  • @lucienbrandt111
    A month and a half struggling with this. And u save me alota frustration. Thank bro... Just wanna know how u do the particles part .
  • @indraprasathrau
    Thanks. Learned alot. There was some issues here and there.. but managed to fixed them 👍
  • @lyoshko
    I'm trying to reduce nodes count. When Creating Dynamic MI, i removed GetMaterial node before and SetMaterial node after. Still works fine.
  • @JunwithoutE
    Love the idea and I am so happy that such tutorial exist. Thank you. However, ran into a couple of problems. When I click the mouse to line trace, it won't draw the white mask(?) on the hit location and instead draw somewhere else. I have checked the render resolution and other settings. also, when I hit the skeletal mesh with the line trace, the frames drop alot. It goes from 120 fps to 30 fps immediately. Any idea why these are happening?
  • @lyoshko
    Your setup works when actor rotates around Z axis, but don't work when rotated around X or Y. That's because SceneCapture misalings to Unwrap mesh. I fixed this by moving SceneCapture to actor's 0,0,0 and removing CaptureLocation parameter +0,+0,+10.
  • @adimaxify
    Hi, great tutorial! I'm having an issue where when I paint on a certain part of the mesh I have other parts of the mesh kinda slowly filling in with paint too, like i have a sphere and the line trace mask works perfectly but the top and bottom of the sphere start slowly becoming colored too. Thanks!
  • @user-tt6bw5xe9m
    I want to create slash scars like this ,I used decal and calculated correct rotation and position in blueprint,but decal effect is not good on skeleton meshs.I don't know how to do same thing like this video? SphereMask looks like a 3D mask,and don't need to consider rotation problem ,so it can works. how can i sample and paint correct rotate texture mask on skeleton mesh? Please help.
  • @ArminJohansson
    Is there no easy way of outputing the painted shaders color as a texture, instead of having to flatten and spread out the mesh on the ground and capturing it from above to get the same effect?
  • @dookee9626
    Great video! Would it be possible to use a custom texture mask instead of a sphere mask? Also, could how could this system be used to make a blood flowing system similar to overgrowth's?
  • @geri121
    Hi, I followed the tutorial step by step for a project I am working on. Everything works fine EXCEPT the whole mesh gets the emissive color and not just the point it should. (a already tried to set the radius to really low values but still the whole mesh is affected). (you said something about setting the SceneCaptureComp2D-Rotation to World? How do I do that? When I set it "World" in the viewport editor it changes nothing) I am using 5.1
  • @yearight1205
    I work in cinematics not video games. I have a fight scene where I need a character to have a sword impale him and the armor to be visibly damaged. How would you go about doing this in Unreal Engine? I can't obviously have the armor come back together, so it would need to be something that stays there. Any ideas?
  • @jesseyules
    Q: I'm interested in synching the mask opacity with the health bar. Can I do this via the Material graph? Or is there a better place to connect? Thanks for all your help! :)
  • @comebackguy8892
    Followed your tutorial... And it works wonderfully, but I have question that I can't quit wrap my head around. What if we have multiple layers? I've added another texture parameter and another unwrapper that compares the bullet impact to to the regular (first layer) materials parameter, but the compared locations are wrong (as in offset). I then save the overlap as the other new parameter, but because of the wrong alignments this doesn't work. Any tips?
  • @Brudiz
    Hello. Your system works amazing and performant, but I have some problems. It looks like mesh UV seams can't be affected by mask. Can you provide some fixes?
  • @MaMa-rc4eo
    I used the basic third person template and followed this tutorial, but got stuck at 9:29. There is nothing shown at the CaptureLocation. I could share the project if you would take a look at it.