Home Unreal Engine

Fade Texture to "Damage" Texture Material/Shader?

polycounter lvl 6
Offline / Send Message
Oblivion2500 polycounter lvl 6
I have characters in this game, I want to have their normal healthy textures by default but as they get shot and beaten over time, I want the texture to slowly turn into a "damage" texture like all cuts, bruises, and gore showing. Similar to how Mortal Kombat: Deadly Alliance/Deception/Armageddon did it as the players get beaten over time, they get bruises and cuts. How can I achieve this in Unreal Engine 4?

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    In short, "lerp" between the healthy and damaged textures in the material. The lerp alpha can be driven from blueprints or cpp, changing value when the guy got hit, etc.
  • Oblivion2500
    Options
    Offline / Send Message
    Oblivion2500 polycounter lvl 6
    Obscura said:
    In short, "lerp" between the healthy and damaged textures in the material. The lerp alpha can be driven from blueprints or cpp, changing value when the guy got hit, etc.
    Yes, that would work. Would there be a way with Blueprint to have "targeted" areas of the body/model to fade from healthy to damaged based on where you hit (ex: shot arm with the gun, the arm will get more damage, not just the whole body)?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Yes, there are 2 ways. You could  detech which physics body or hit box was hit, and select a mask based on that. Or, you could store the exact location of the hit, and update a render target. But this would probably get expensive with many characters so I would go with the previous method.
  • Oblivion2500
    Options
    Offline / Send Message
    Oblivion2500 polycounter lvl 6
    Obscura said:
    Yes, there are 2 ways. You could  detech which physics body or hit box was hit, and select a mask based on that. Or, you could store the exact location of the hit, and update a render target. But this would probably get expensive with many characters so I would go with the previous method.
    Well, my game has very low poly models and low res textures like an old 90s game. There won't be a lot of characters on one screen. I think the second option looks like a better choice for my game.  
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Its not the polycount that would make it heavy , but the amount of material instances and updates, if you have many characters. You would need to have one render target for each of the,, to store and display unique damage. If you end up going this way, I would recommend to use small render targets like 128, and rather sharpen it inside the material afterwards, with some blending trick.
  • Oblivion2500
    Options
    Offline / Send Message
    Oblivion2500 polycounter lvl 6
    Obscura said:
    Its not the polycount that would make it heavy , but the amount of material instances and updates, if you have many characters. You would need to have one render target for each of the,, to store and display unique damage. If you end up going this way, I would recommend to use small render targets like 128, and rather sharpen it inside the material afterwards, with some blending trick.
    So, is it the number of characters in the game? or per match characters being rendered at a time? There will be only 4 characters at a time per match at the most. The game will have a total of 12 characters to choose from.
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    it comes down to your target platform as to whether it'll run well enough but it's entirely possible to create a sort of bruise brush that you can splat down onto a render target at the exact point of impact - you'd be able to vary it by type of impact etc.. 

    The good thing is that you're only really ever paying once so you can layer up the damage almost for free (obviously you need to pay the shader cost + hit processing but that's fixed/cheap respectively)
Sign In or Register to comment.