Unreal Engine how can we achieve soft Skin Physics in Unreal Engine

darkevilhum

Newbie
Sep 9, 2017
50
54
I actually took a close look in VAM, there was a scene where you could enable slowmotion, so I watched it closely and I believe this method is similar to how it's done there (it's obviously actual softbody though, not thruogh material, but how it looks is similar to how this effect you suggested probably would), I don't know if it's a unity function or something the developer did, I just noticed that when the ass was shaking a certain way (normally you can't see it), a big chunk of it moved like bone based jiggle while the surrounding areas moved more like jelly.

Let me see if I can't capture it.

View attachment 3902946

There's definitely some merit to this idea.

Edit: Also about sending the data from a materialbp to another, one way I know can be used to do that is rendertargets,In blueprints there's a node to draw a material to rendertarget. There's also a node to create a rendertarget so you do not have to pre-create one (only a placeholder). I'm not sure how expensive it is to draw to rendertarget every frame though. To then pass that on to the main body mateiral, the easiest way to do it would be to use dynamic material instance, and just passing the rendertarget to a texture sample node that way (you do not have to pass it on every frame, just once when the rendertarget is created).
I haven't tried VAM personally but watching that gif is interesting.. it actually isn't very realistic for one. But it certainly is very dynamic and flesh-esque. I can see there is spring movement driving it at a base level but the edges distort in a very odd way, I wonder if there was some shader tricks used here.

The first thing that comes to mind is maybe that used something similar to the spring bone>shader method I described earlier but then used better shader knowledge to make it look like above? The immediate idea I have is perhaps using sine/time to "animate" those jiggle masks in the shader as they are sampled which might result in what we see in that gif where the edges of movement have this particular deformation that looks oddly "soft".

I'm quite busy with work and stuff atm but I hope to experiment with that and also the depth fade trick you found. These may be able to come together to form some sort of soft body solution that is passable.
 
  • Like
Reactions: Velomous

RawDarkness

Newbie
Sep 20, 2021
75
148
Found this thread just now. Super interesting research and results!
I did a dive into the subject a few months back (also trying to achieve naughty simulator results with materials) but it seems you have all far surpassed where i ended up before giving up.

As for dynamic penetrations, i did a simple setup using bone locations driving morph targets (physics asset for driving bone location based on collisions).
This worked but i never got around to tweaking it so i ended up scrapping it and not using it. Maybe someone else can get further with the concept as it was very cheap in terms of performance.

Basically the flow was, on tick in character (as bone locations could not be gotten in ABP for some reason), get some bone location, send it to ABP, drive morph based on location in ABP. As a proof of concept, i did it for just 1 bone, but with some fine tuning the result might be much better.
Its not soft body physics collision level stuff, but its something.

Gif with result in link:

1723189156771.png 1723189165496.png
 

darkevilhum

Newbie
Sep 9, 2017
50
54
Found this thread just now. Super interesting research and results!
I did a dive into the subject a few months back (also trying to achieve naughty simulator results with materials) but it seems you have all far surpassed where i ended up before giving up.

As for dynamic penetrations, i did a simple setup using bone locations driving morph targets (physics asset for driving bone location based on collisions).
This worked but i never got around to tweaking it so i ended up scrapping it and not using it. Maybe someone else can get further with the concept as it was very cheap in terms of performance.

Basically the flow was, on tick in character (as bone locations could not be gotten in ABP for some reason), get some bone location, send it to ABP, drive morph based on location in ABP. As a proof of concept, i did it for just 1 bone, but with some fine tuning the result might be much better.
Its not soft body physics collision level stuff, but its something.

Gif with result in link:

View attachment 3913054 View attachment 3913056
Thanks for sharing how you implemented this. Using physical bones to drive morph targets is definitely how I would opt to implement opening/closing of genitals and such. I did consider just doing spring based physics on bones which are weighted but often that requires custom weighting/rigging and might be less performant.
 

RawDarkness

Newbie
Sep 20, 2021
75
148
Thanks for sharing how you implemented this. Using physical bones to drive morph targets is definitely how I would opt to implement opening/closing of genitals and such. I did consider just doing spring based physics on bones which are weighted but often that requires custom weighting/rigging and might be less performant.
I tried that at first (but with very little weigh painting changes). It can probably be done, but i had horrible results with it, physics bodies going all over the place etc.
If the character mesh and bones where made with it in mind or modified heavily its probably doable and the better approach. Since im using a daz mesh with just a few tweaks and too little patience for weight painting, i gave up on it :D
 

RawDarkness

Newbie
Sep 20, 2021
75
148
For the material functions, i have one node that im not sure which one it should be, the highlighted one in the main material function. It just copies in as unspecified. This is on 5.4 but shouldnt matter.
1723199592425.png
1723199652489.png
 

Velomous

Member
Jan 14, 2024
176
149
Welcome to the party rawdarkness! Your game looks really impressive, I'm surprised I haven't heard of it before.

I already tried playing a bit with dynamic penetration using pure collision here here and here, it basically worked ok but just needed more tweaking (it wasn't expanding enough for the size of the penetrating object, but it's not really surprising, i'm unfamiliar with physics asset and had very little idea of what i was doing)

Your approach seems a pretty decent solution for that, taking in a bp calculated value and turning it into a sort of multiplier.

The unspecified function is probably some function that was removed in a recent version of the engine, if you can get back on the engine version you originally made this with (so that it isn't unspecified) you can just double click on it to see what exactly it's doing and use that information to re-create it.

The reason there's nothing new from me is mostly just that I jump between things a lot, I've got a lot of features to create so I just do them in no particular order, yesterday I was playing with a character creation UI.

Here's some of the stuff i've done if anyone's interested, a lot of it you may have already seen

You don't have permission to view the spoiler content. Log in or register now.

When I've played with the character creation ui enough i will probably start messing around with either chaos flesh or penetration mechanics.

If anyone wants any of the code displayed in there that I didn't link to, just let me know, it's all fairly basic though.

Edit: Also I found a pretty good video on mesh painting by accident

It's just doing the same stuff that's been discussed before, unwrapping the UV and processing it into UV coordinates, but I like how it basically covers everything. Hate how slow the guy talks though.
 
Last edited:

darkevilhum

Newbie
Sep 9, 2017
50
54
For the material functions, i have one node that im not sure which one it should be, the highlighted one in the main material function. It just copies in as unspecified. This is on 5.4 but shouldnt matter.
View attachment 3913362
View attachment 3913363
ss+(2024-08-10+at+06.20.14).jpg

That will be my fault. Hard to keep track of the random functions I end up making. The one that's missing is a small utility function for grabbing a normal that seemed to have better results than the built in one. (I updated my original post too for clarity).
 

Velomous

Member
Jan 14, 2024
176
149
I'm thinking about chaos flesh now, I have (finally) found , even if it's pretty chunky.

I'm not putting a lot of hope into chaos flesh being a solution for us though, mostlybecausedespite how long it's existed it's still just version 0.1 implying that nobody's working on it and it'll probably get cut from the engine soon. It's also almost certainly incomplete, buggy and expensive.

100824-212646.gif

Yeah it is very expensive, above has number of cells 5, below has number of cells 7.
100824-213620.gif

So the number of cells is kinda like the accuracy, the number of tetrahedons, you can see how the below spheres have more detail than the one up above; but the 5-7 range seem to be about the maximum tolerance before I start losing too much fps (for the record, the default number of cells is 32, which is accurate)

Now the problem is that the loss in accuracy is pretty high.

You don't have permission to view the spoiler content. Log in or register now.

It'd be fairly safe to say that 32 cell is roughly the accuracy we need right? maybe we oculd get away with 16 but it'd be pretty shit.

So I put 3 of these ac.tors side by side and start simulating, my fps:

7: 60fps with 3
16: 44fps with 3 (Playable but unacceptable)
32: 15fps with 3


Now I'm not sure what goes into determining how well it performs, i tried taking a simple sphere shape, it's got 600 vertices, the cine camera has 4000 vertices. I also tried a simple cube, the sphere and cube were orders of magnitude worse than the cinecam for some reason on the fps, I think it might have to do with the actual mesh size rather than the level of detail.

But I believe I have at this point gathered enough data to be quite certain that chaos flesh is not a good solution for realtime softbody simulation. The cloth sim idea at page one was a better solution than this. I would rather go the niagara softbody route than this as well, it performs way better and doesn't really look worse.

Also a lot of static meshes just didn't work with it at all, it just wouldn't load them right for no discernable reason. All my custom static meshes (e.g. that didn't come with the engine) wouldn't work with it.

Edit: went back to working on penetration a bit, reworked that dildo system I made, thought I'd share, i'm gonna try messing with penetration again.
View attachment 120824-201104.mp4
 
Last edited:

RawDarkness

Newbie
Sep 20, 2021
75
148
Welcome to the party rawdarkness! Your game looks really impressive, I'm surprised I haven't heard of it before.

I already tried playing a bit with dynamic penetration using pure collision here here and here, it basically worked ok but just needed more tweaking (it wasn't expanding enough for the size of the penetrating object, but it's not really surprising, i'm unfamiliar with physics asset and had very little idea of what i was doing)

Your approach seems a pretty decent solution for that, taking in a bp calculated value and turning it into a sort of multiplier.

The unspecified function is probably some function that was removed in a recent version of the engine, if you can get back on the engine version you originally made this with (so that it isn't unspecified) you can just double click on it to see what exactly it's doing and use that information to re-create it.

The reason there's nothing new from me is mostly just that I jump between things a lot, I've got a lot of features to create so I just do them in no particular order, yesterday I was playing with a character creation UI.

Here's some of the stuff i've done if anyone's interested, a lot of it you may have already seen

You don't have permission to view the spoiler content. Log in or register now.

When I've played with the character creation ui enough i will probably start messing around with either chaos flesh or penetration mechanics.

If anyone wants any of the code displayed in there that I didn't link to, just let me know, it's all fairly basic though.

Edit: Also I found a pretty good video on mesh painting by accident

It's just doing the same stuff that's been discussed before, unwrapping the UV and processing it into UV coordinates, but I like how it basically covers everything. Hate how slow the guy talks though.
Thank you! Lots of really cool progress on stuff i either should look in to or have but never got anywhere on.
For painting cum on to meshes, i opted for the "easy" path of using the skinned mesh decal plugin. I ended up with a working solution but my shaders are crap so im not really using it currently.



If you need any pointers on a customization system, just give me a shout. I have a fairly feature rich system set up in my game currently and have iterated over it for a long time now. You seem to have stuff mostly figured out though. The complicated parts (imo) is usually soft referencing textures/meshes and saving/loading of state.

Short showcase of how i set it up with customization.


View attachment 3916235

That will be my fault. Hard to keep track of the random functions I end up making. The one that's missing is a small utility function for grabbing a normal that seemed to have better results than the built in one. (I updated my original post too for clarity).
Ah that makes sense, thank you for the updated function! :)
 
  • Red Heart
Reactions: Velomous

Velomous

Member
Jan 14, 2024
176
149
Thank you! Lots of really cool progress on stuff i either should look in to or have but never got anywhere on.
For painting cum on to meshes, i opted for the "easy" path of using the skinned mesh decal plugin. I ended up with a working solution but my shaders are crap so im not really using it currently.



If you need any pointers on a customization system, just give me a shout. I have a fairly feature rich system set up in my game currently and have iterated over it for a long time now. You seem to have stuff mostly figured out though. The complicated parts (imo) is usually soft referencing textures/meshes and saving/loading of state.

Short showcase of how i set it up with customization.



Ah that makes sense, thank you for the updated function! :)
Very cool stuff, the best way to do semen is probably a combination of mesh painting (whichever method you use to do it) and particle effects (so we can make it leak and stuff), I'm kinda curious about how he did it in head game, the ejaculation has got really shit performance there but the semeon on skin effect is on point. Also interested in how he did makeup, he has this running mascara and lipstick smearing effect that's really cool and i'm dying to replicate lol.

Speaking of which, I'm curious about how you're applying the makeup and tattoos, is that also the skinned mesh decal plugin or are you applying it to the skin material somehow?

On the customization system ui I have 2 questions.

First is I noticed on my end that if I have a lot of widgets under a scrollbox fps starts dropping, did you figure out a solution to optimize that somehow? Cuz I notice you have quite a lot of them and your performance looks fine (although I didn't start noticing issues till around the 500 mark so maybe you're still within safe limits, barely?)

The second is, would you like a search system? I'm sure you could have figured it out easy enough on your own, but since I already did it I figured I might as well share it.

View attachment 130824-173425.mp4
















You don't have permission to view the spoiler content. Log in or register now.
 
  • Like
Reactions: Oppailance

RawDarkness

Newbie
Sep 20, 2021
75
148
Very cool stuff, the best way to do semen is probably a combination of mesh painting (whichever method you use to do it) and particle effects (so we can make it leak and stuff), I'm kinda curious about how he did it in head game, the ejaculation has got really shit performance there but the semeon on skin effect is on point. Also interested in how he did makeup, he has this running mascara and lipstick smearing effect that's really cool and i'm dying to replicate lol.

Speaking of which, I'm curious about how you're applying the makeup and tattoos, is that also the skinned mesh decal plugin or are you applying it to the skin material somehow?

On the customization system ui I have 2 questions.

First is I noticed on my end that if I have a lot of widgets under a scrollbox fps starts dropping, did you figure out a solution to optimize that somehow? Cuz I notice you have quite a lot of them and your performance looks fine (although I didn't start noticing issues till around the 500 mark so maybe you're still within safe limits, barely?)

The second is, would you like a search system? I'm sure you could have figured it out easy enough on your own, but since I already did it I figured I might as well share it.

View attachment 3928523
















You don't have permission to view the spoiler content. Log in or register now.
For makeup i simply use material parameters and switch between textures as alpha masks and set the color as another material parameter. Soft loading the textures and only saving/storing the Int value for the texture item also makes saving and loading easy.
1723622782929.png
1723622857805.png
1723622915175.png

Tattoos is a lot more complicated since i wanted a dynamic system that allows any combination of tattoos.
Basically i have a render target per UV on the body set in the material.
This render target is used to get alpha and color values and set them in the skin shader.
1723622969541.png

The logic is pretty much an array of possible tattoos populating a dropdown list. Each tattoo has a struct holding the data once its applied (texture index, color, UV offset/scale, intensity) and the struct is used to spawn a temporary material that is drawn on to the render target.
I do seem to have trouble getting the alpha to apply to the render target currently though, the screenshots for tattoos shows a non working solution. Before they didnt hold individual colors and then the render target was simply a mask and the color was set for all tattoos. Still working out the new system.

1723623020824.png

For the performance issue, i havent had any issues at all but i dont think i have close to 500 items. I also divide them into different scroll boxes for different body parts, which might help (like 100 per body part).

The search bar im definitely going to use, super helpful, thanks! :)

*edit*
Added the search bar, works perfectly and is simple yet elegant, thank you!
 
Last edited:
  • Red Heart
Reactions: Velomous

darkevilhum

Newbie
Sep 9, 2017
50
54
For makeup i simply use material parameters and switch between textures as alpha masks and set the color as another material parameter. Soft loading the textures and only saving/storing the Int value for the texture item also makes saving and loading easy.
View attachment 3930269
View attachment 3930273
View attachment 3930274

Tattoos is a lot more complicated since i wanted a dynamic system that allows any combination of tattoos.
Basically i have a render target per UV on the body set in the material.
This render target is used to get alpha and color values and set them in the skin shader.
View attachment 3930276

The logic is pretty much an array of possible tattoos populating a dropdown list. Each tattoo has a struct holding the data once its applied (texture index, color, UV offset/scale, intensity) and the struct is used to spawn a temporary material that is drawn on to the render target.
I do seem to have trouble getting the alpha to apply to the render target currently though, the screenshots for tattoos shows a non working solution. Before they didnt hold individual colors and then the render target was simply a mask and the color was set for all tattoos. Still working out the new system.

View attachment 3930278

For the performance issue, i havent had any issues at all but i dont think i have close to 500 items. I also divide them into different scroll boxes for different body parts, which might help (like 100 per body part).

The search bar im definitely going to use, super helpful, thanks! :)

*edit*
Added the search bar, works perfectly and is simple yet elegant, thank you!
That's a solid approach. I'm assuming when you set this up, you experimented with the size/resolution of your makeup masks? What did you find worked best for visuals whilst keeping the size low? Or did you keep the masks at the same res as the skin textures for a 1:1 look?
 

Naebats

New Member
Nov 19, 2022
3
0
Hey, everybody!
This is a very cool thread.
We are working on our game right now and we have a skin problem too.
For example, one character we are massaging back, legs, chest etc and we would really like to add realistic skin physics here.

We tried Chaos Flesh, but never got the good result, although we spent a lot of time.

I have seen many solutions in this thread that would work for us, but unfortunately we don't have people with experience who could implement this.

If anyone has time and willingness to help us with the implementation of skin physics, I would be glad to cooperate (!paid work!).
I would publish this post in the "Recruitment", but the topic is very specific, so I decided to address here directly.
 

RawDarkness

Newbie
Sep 20, 2021
75
148
That's a solid approach. I'm assuming when you set this up, you experimented with the size/resolution of your makeup masks? What did you find worked best for visuals whilst keeping the size low? Or did you keep the masks at the same res as the skin textures for a 1:1 look?
Currently i use 2k diffuse, 1k normal, 1k ORM for the face (genesis 8 UVs) and 1k makeup mask, i found it to be good enough to not notice the lower res, especially since my game is third person and the face rarely is visible in gameplay.
1723752076861.png
 

darkevilhum

Newbie
Sep 9, 2017
50
54
Hey, everybody!
This is a very cool thread.
We are working on our game right now and we have a skin problem too.
For example, one character we are massaging back, legs, chest etc and we would really like to add realistic skin physics here.

We tried Chaos Flesh, but never got the good result, although we spent a lot of time.

I have seen many solutions in this thread that would work for us, but unfortunately we don't have people with experience who could implement this.

If anyone has time and willingness to help us with the implementation of skin physics, I would be glad to cooperate (!paid work!).
I would publish this post in the "Recruitment", but the topic is very specific, so I decided to address here directly.
I'm sure someone would be willing to share a solution with you at some point, however everything is very experimental and not fully functional at the moment. We're trying to get something together that does it all and looks good at the same time. The solution to this is likely a combination of a few techniques and methods we've explored so far, it's just a matter of figuring out which ones mesh together the best and look good too.
 

Naebats

New Member
Nov 19, 2022
3
0
I'm sure someone would be willing to share a solution with you at some point, however everything is very experimental and not fully functional at the moment. We're trying to get something together that does it all and looks good at the same time. The solution to this is likely a combination of a few techniques and methods we've explored so far, it's just a matter of figuring out which ones mesh together the best and look good too.
Thanks for your comment.
I saw that no one has found the final solution yet.
But maybe someone would like to experiment on our character models and get paid for it.

We don't need full body physics. Small skin changes are needed only in certain places of the body (for cutscene). Problematic places we can hide by changing the camera angle or changing animations.

For example, the quality that is presented in your work https://f95zone.to/threads/how-can-...physics-in-unreal-engine.137663/post-13942985 is suitable for us, if it works on our characters. So, if you are personally interested, I would be glad to talk about the details of the work.
 

Velomous

Member
Jan 14, 2024
176
149
I decided to take advantage of the fact that I had a post on the first page and try to document this thread, so newcomers don't have to read the whole thing to find specific stuff they might be looking for (and so that we can find old stuff we posted more easily). Let me know if I missed anything or if there are any inaccuracies ;)

Thanks for your comment.
I saw that no one has found the final solution yet.
But maybe someone would like to experiment on our character models and get paid for it.

We don't need full body physics. Small skin changes are needed only in certain places of the body (for cutscene). Problematic places we can hide by changing the camera angle or changing animations.

For example, the quality that is presented in your work https://f95zone.to/threads/how-can-...physics-in-unreal-engine.137663/post-13942985 is suitable for us, if it works on our characters. So, if you are personally interested, I would be glad to talk about the details of the work.
I believe he posted the code for how this was done here. I'm sure you guys can figure it out if you're determined, although I understand (first hand :HideThePain:) how material blueprints can be intimidating. It's why I haven't yet implemented my own version of that code.

Edit: Made a new tutorial about how to pose skeletal meshes.
 
Last edited:
  • Red Heart
Reactions: darkevilhum