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

darkevilhum

Newbie
Sep 9, 2017
77
78
I have worked it out, I basically did what the naughty sandbox dev did, but I did it better.

View attachment 3692863

And unlike certain devs I'm not afraid to share my discoveries, in the name of porn! (Or rather I'm just not afraid of the competition, in fact the whole reason i'm here trying to make my own game is that the competition has managed to leave me consistently disappointed and I've had just about enough of it)


  1. Make a pawn, create a skeletal mesh component for ur model, sset the skeletal mesh component as root (this isn't a hard requirement it's just how i'm doing it)
  2. Create a physics asset to set constraints for the ragdoll, this also gives you control over collisions. Make sure all bones are set to 'simulate' and not 'kinematic', if they are set to kinematic you get no physics, you can abuse this by for instance setting the pelvis to kinematic to disable gravity for the model (if you're using character blueprint instead of pawn blueprint u will have to put kinematic on pelvis to keep the model within the capsule), or setting everything to kinematic to completely disable ragdoll and physics but keep collisions working.
  3. In your skeletal mesh component, go to the physics asset override setting and configure it to use the physics asset you've modified. Congrats, you now have a working ragdoll with working physics, but the problem is it's a ragdoll, it just collapses, so we solve that next.
  4. Improve your physics asset by configuring the self collision properly (in the physics asset if you click on a colider, every collider it can collide with turns blue, every collider it cannot collide with turns gray. you can set the collider to collide with everything, then disable collision between it and colliders it shouldn't collide with (usually the colliders immediately next to it should have collision disabled, e.g. hand and forearm shouldn't collide, thigh and pelvis shouldn't collide, and so on)
  5. Set up a physical animation profile in your physics assset, select all the bones except any jigglebones ur using (e.g. boob butt jigle bones and thigh twist, things like that, don't select those) and assign them to the physical animation profile, then for all these bones as a starting point configure the physical animation profile like this:
    View attachment 3692652
    Then try to simulate, and what should happen is that your model now instead of ragdolling is mostly rigid, sticking to the preview animation, but it still falls over and is affected by physics.
  6. Apply the physical animation profile in your blueprint. View attachment 3692661 And congratulations, now you have a model that is affected by physics, completely rigid and sticks to the animation, 1 remaining problem is it won't stay uprgith and falls over unless the pose is realistically stable enough to keep it standing.
  7. To solve that final problem, the simplest solition is to force the skeletal mesh to maintain it's upright rotation. View attachment 3692665

And now you're basically done, your model will now be affected by physics and will try to maintain it's animation pose and natural orientation the pose expects, but it reacts properly to physics, it creates an effect extremely similar to cascadeur's autophysics. The last step then is to just tweak everything until you're satisfied. But do note that the higher orientation strength is set, the less the model is affected by physics, meaning that if you set it evrey high it'll be like your model is in low gravity, but it's very useful since you can tweak it on a per bone basis so you can have full control over how rigid or loose parts of the model are, after about 10 minutes of tweaking the gif up top is how it looks on my end. Granted you may notice i did mess up the ragdoll constraints a lil bit, but it's a pretty good result imo.

This video is a good watch too, it teaches you basically everything I just said you gotta do, and shows some examples of practical uses of this feature in other games.

I just noticed that in your demo gif, you are grabbing your characters ragdoll at random joints and dragging them around. Did you code that up to work in PIE? I know you can do that with ALT+Click in the actual physics asset to test but I didn't think that was available when actually playing in PIE mode?
 

razfaz

Member
Mar 24, 2021
171
195
Sorry, I forgot someting regarding the Nanite SkelMeshes:

If You build Your Unreal Engine 5.5 from Sauce You have to add the following setting to Your Project Config/DefaultEngine.ini File to have access to the Nanite Settings:

[/Script/Engine.RendererSettings]
r.Nanite.AllowSkinnedMeshes=1

1717320483177.png

1717322517709.png
 
Last edited:

Velomous

Member
Jan 14, 2024
265
227
I just noticed that in your demo gif, you are grabbing your characters ragdoll at random joints and dragging them around. Did you code that up to work in PIE? I know you can do that with ALT+Click in the actual physics asset to test but I didn't think that was available when actually playing in PIE mode?
What is pie? play in editor? If so then yes.

I can show you the code I used to do this,fair warning though it is pretty barebones (everything is working fine but the dragging portion is kinda shitty). But it workswell enough for testing shit.

24-06-14.png
And here is the click trace function, it very accurately detects what you clicked on.

24-06-15.png

Here's a video of someone who talks very slow doing a more elaborate version where the drag is better, I was just a bit lazy.


Edit: Thought to add afterwards, this is how i enable the cursor to show.
24-06-16.png
I'm in a camera bp which is why i use viewing player controller but you can also just use player controller 0 for this.

To get the show mouse cursor variable setting on right lcick you may have to disable context sensitivity in the right click menu.
 
Last edited:

darkevilhum

Newbie
Sep 9, 2017
77
78
What is pie? play in editor? If so then yes.

I can show you the code I used to do this,fair warning though it is pretty barebones (everything is working fine but the dragging portion is kinda shitty). But it workswell enough for testing shit.

View attachment 3696946
And here is the click trace function, it very accurately detects what you clicked on.

View attachment 3696951

Here's a video of someone who talks very slow doing a more elaborate version where the drag is better, I was just a bit lazy.


Edit: Thought to add afterwards, this is how i enable the cursor to show.
View attachment 3697063
I'm in a camera bp which is why i use viewing player controller but you can also just use player controller 0 for this.

To get the show mouse cursor variable setting on right lcick you may have to disable context sensitivity in the right click menu.
Thanks for sharing, yeah play in editor. That's a pretty handy blueprint for testing. Testing in the physics asset is a bit limited.
 
  • Like
Reactions: Velomous

darkevilhum

Newbie
Sep 9, 2017
77
78
As I'm pretty much stuck on the seam issue, I thought I'd mess around with sine waves for that sort of fleshy/ripple esque effect. I think if we trigger that whenever there is a physics hit from other colliders on the skin and plug in the hit normal/hit velocity (translate the velocity into some sort of force/scalar) then this will really add to the effect. The results so far are pretty good I think, maybe a bit too "watery". I'll need to work in a "firmness" scale or something.

Force value 1
impact1.gif

Force value 2
impact2.gif

2 from a different angle
impact3.gif

Making the effect in the material was pretty easy, the real challenge will be actually doing the math to translate a physics hit (hit normal/position/velocity) into the material to the correct location on the mesh (im going to try and use world projection instead of UVs to avoid seams for this effect as the effect doesn't last very long per impact).

I'll just be attacking it in different ways until something works as I don't have much clue as to what I'm doing when it comes to the more meatier shader stuff.

As the effect itself is sort of "working" I'll share the blueprint in case anyone wants to mess around with it (You can copy the blueprint code at the bottom and paste directly into UE)

The texture sample I'm using is just a 128 circle gradient I put together in photoshop
SmoothCircleMask.png
 
Last edited:

Velomous

Member
Jan 14, 2024
265
227
As I'm pretty much stuck on the seam issue
If I can get it set up to the same point you did (I haven't tried yet, been focusing on other aspects, currently on my agenda is figuring out penetration. But if there's anything missing please let me have it) I would be down to help troubleshoot it. Also, it seems like the seam occurs on the border where the next bone would begin, maybe the method you're using doesn't account for adjacent bones and needs to be adjusted for this?

My first idea is that you talked about using world transform, maybe you need to use relative transform.

You quite nailed the flesh ripple effect though! It's about on par with the naughty sandbox dev one, i think he just tweaked it a little further.
 
Last edited:
  • Like
Reactions: TheExordick

darkevilhum

Newbie
Sep 9, 2017
77
78
If I can get it set up to the same point you did (I haven't tried yet, been focusing on other aspects, currently on my agenda is figuring out penetration. But if there's anything missing please let me have it) I would be down to help troubleshoot it. Also, it seems like the seam occurs on the border where the next bone would begin, maybe the method you're using doesn't account for adjacent bones and needs to be adjusted for this?

My first idea is that you talked about using world transform, maybe you need to use relative transform.

You quite nailed the flesh ripple effect though! It's about on par with the naughty sandbox dev one, i think he just tweaked it a little further.
I won't say no to any help!

I don't think I can easily share my original demo of "touching" the skin as it relies on this plugin from the marketplace ( ) I use this to get the "Hit UVs" when using a line/sphere trace at a skeletal mesh.
I was then using those UVs in the material to determine where the touch effect should occur, I think thats why the seams occur, if you touch on the edge of a meshes UV seam, it only affects the surface on the side of the UV that you're on.

The same effect could be re-written to instead use a relative transform projection like you said using the "Pre Skinned Local Position" node in the shader but I haven't tested that yet, it's a bit of a math intensive method.
Only other solution I know of is where you stitch the different UVs of a mesh using a large UV atlas or something but that would require possibly custom code/nodes or something else, (out side of my UE expertise).

The ripples you should be able to get setup with a quick copy paste of that material blueprint code I linked. I'm currently testing out methods of hitting the skin with a physics sphere and then somehow translating that hit info into the shader to accurately display the ripple on that spot. Will post here if I succeed :p
 

Velomous

Member
Jan 14, 2024
265
227
I won't say no to any help!

I don't think I can easily share my original demo of "touching" the skin as it relies on this plugin from the marketplace ( )
Well this IS a piracy site :sneaky: and there is a UE asset upload section. But with things like that I think it might be just as fun to find out alternate ways to do what the plugin does or a way to do it without the plugin as well. I have noticed that A LOT of the marketplace stuff is just crap I could do myself with 5 minutes in blueprints. Some of it is that but with a few hours of further refinement on top of it. This doesn't lookl ike such an asset though, this looks legitimately useful.

I'm gonna play with the flesh ripples soon and then I'll be trying to make the genitals actually work, then i'll try messing with the softbody shader, what I'm currently doing is just setting up a better testing environment for testing all this stuff we're working on.
 
  • Like
Reactions: darkevilhum

Velomous

Member
Jan 14, 2024
265
227
i'm trying to work out the flesh ripple, but I've never actually worked with material bps before so i have basically no idea what I'm doing :cool:

I got stuck on this part.

24-06-18.png

What is that named reroute actually meant to be? Is it supposed to be that plugin?

output.gif

I was able to get this far just basically guessing, but the obvious problem is that it'sconstantly pulsating over the entire body instead of reacting to impacts on the impacted site.
 
Last edited:

darkevilhum

Newbie
Sep 9, 2017
77
78
i'm trying to work out the flesh ripple, but I've never actually worked with material bps before so i have basically no idea what I'm doing :cool:

I got stuck on this part.

View attachment 3701152

What is that named reroute actually meant to be? Is it supposed to be that plugin?

View attachment 3701350

I was able to get this far just basically guessing, but the obvious problem is that it'sconstantly pulsating over the entire body instead of reacting to impacts on the impacted site.
Ah gotcha, named reroutes are a thing I only learned a few days ago myself haha. They are basically like reroute nodes in normal bp but you give them names and then you can use them elsewhere without an actual line/connection. It looks like that one didn't copy over correctly for some reason though. Oh that's my fault, I didn't include that bit in the linked bp sorry.

This is the missing bit

The missing bit was some temporary world projection I was testing to see the visual in a better way on the mesh rather than it affecting the entire mesh as you're seeing.

I've updated my original link as well to the full blueprint to not lead anyone astray ha, I missed that bit because I thought it was junk doh
 
Last edited:

Velomous

Member
Jan 14, 2024
265
227
This is the missing bit
Yeah with that it looks closer to the effect in your gif, still had some problems, like if i plug in the add node at the end to the wpo it comically balloons up the skin:
You don't have permission to view the spoiler content. Log in or register now.

If I skip the add node and just use the multiply node next to it directly instead the skin looks normal again. anyhow there's still the problem that the effect is just pulsating at seemingly random places on the skin and doesn't seem to really react to hits, I take it you didn't work out that bit yet then? I imagine we'll have to use to do that, or possibly would be better. But you're right, the tricky part will be translating world position or relative position to UV position will probably be tricky. to do it. I believe it's got some performance issues, but it's a start. (what the other link was based on).

output.gif

As u can see tho my testing environment is getting better. Still got some things i wanna do to improve it though.
 
Last edited:

darkevilhum

Newbie
Sep 9, 2017
77
78
Yeah with that it looks closer to the effect in your gif, still had some problems, like if i plug in the add node at the end to the wpo it comically balloons up the skin:
You don't have permission to view the spoiler content. Log in or register now.

If I skip the add node and just use the multiply node next to it directly instead the skin looks normal again. anyhow there's still the problem that the effect is just pulsating at seemingly random places on the skin and doesn't seem to really react to hits, I take it you didn't work out that bit yet then? I imagine we'll have to use to do that, or possibly would be better. But you're right, the tricky part will be translating world position or relative position to UV position will probably be tricky. to do it. I believe it's got some performance issues, but it's a start. (what the other link was based on).

View attachment 3703898

As u can see tho my testing environment is getting better. Still got some things i wanna do to improve it though.
Haha I had that same ballooning effect at some point, pretty terrifying on her face. Yep exactly what you said, I spent the better part of today scratching my head and trying to figure out a solution to the hit location problem. The dynamic mesh painting link is similar to the method I've been experimenting with. I feel like I'm pretty close to figuring it out but I'm burnt out today ><. The link you posted seems interesting as I haven't come across that specific one, I was using this and this
 
Last edited:

darkevilhum

Newbie
Sep 9, 2017
77
78
Made a lot of progress today. That link was very helpful for implementing a SceneCapture based solution (not ideal due to the performance/awkwardness of it but..). Getting pretty close now, thought I'd share this hilarious result while I was testing to trigger the soft skin.

Lmao2.gif

Pretty sure that's not what we want LOL.. maybe :sneaky:
 

Velomous

Member
Jan 14, 2024
265
227
Figured to drop in and say what i've worked on since i've been quiet a while. It just hasn't gotten particularly exciting on my end.

I implemented an imo pretty great freecam (My measuring stick was the ue editor freecam and the vam freecam, i tried to beat them both and i feel like i did), and well, the ability to pick up a dildo and thrust it with mouse clicks.
output.gif

a lot of time went into just fine tuning the camera. Next up on my plans is making the dildo line up with nearby holes and adding a paddle like darkevilhum had above, and other similar things. You know how it is, some days you implement 10 new features and it all goes perfect, some days you spend 3 polishing just the one that won't obey. And sometimes the editor just doesn't like whatever you're doing and self destructs.

Once I have the proper tools and control over those tools to do the actual testing, i'll return to the subject of flesh ripples and softbody.

Edit: I found , which looks like exactly what we want, it's a clickbait video but according to the first comment this was actually achieved using physics assets alone. The motherfucker doesn't say anything more than that so we're no closer to learning HOW it's done with physics assets, just that it CAN be done with physics assets :cry:
 
Last edited:

darkevilhum

Newbie
Sep 9, 2017
77
78
Figured to drop in and say what i've worked on since i've been quiet a while. It just hasn't gotten particularly exciting on my end.

I implemented an imo pretty great freecam (My measuring stick was the ue editor freecam and the vam freecam, i tried to beat them both and i feel like i did), and well, the ability to pick up a dildo and thrust it with mouse clicks.
View attachment 3710247

a lot of time went into just fine tuning the camera. Next up on my plans is making the dildo line up with nearby holes and adding a paddle like darkevilhum had above, and other similar things. You know how it is, some days you implement 10 new features and it all goes perfect, some days you spend 3 polishing just the one that won't obey. And sometimes the editor just doesn't like whatever you're doing and self destructs.

Once I have the proper tools and control over those tools to do the actual testing, i'll return to the subject of flesh ripples and softbody.

Edit: I found , which looks like exactly what we want, it's a clickbait video but according to the first comment this was actually achieved using physics assets alone. The motherfucker doesn't say anything more than that so we're no closer to learning HOW it's done with physics assets, just that it CAN be done with physics assets :cry:
I haven't even started looking at penetration yet but I'm hoping to do it through a combination of physics asset collisions + morphs.

I was getting pretty stuck on the soft body aspect yesterday, I went over the NaughtySandbox devs discord and bits once more as I was hitting a wall and I think I realised that he's relying a lot more on Physics Asset spring based bounce (similar to what's in that mouth video) than I originally thought. There is defo a shader ripple effect but it's on top of what is likely the multi bone approach.

In other words, his character must be rigged up with multiple bones per "jiggle area". It's a technique a few people have used to "fake" really soft body physics in the Skyrim modding scene where one guy weighted close to 100+ bones to the breasts and ass which had a pretty ridiculous result considering it's just bones and springs. (See here for skyrim example: )

I probably won't get around to testing that combo approach any time soon as I'm not doing character work for my project yet, waiting on some tech so relying on placeholder daz assets. But I did manage to get the shader pretty fleshed out and sorted and combined it with my default physics asset jiggle and the result is... decent with some considerations.

soft1.gif
soft2.gif
soft3.gif

The size/intensity and such are all controllable and probably need refining, right now I'm just calculating a "force" lazily from the impacting object and passing it to the shader.

Considerations:
  • So this character I'm testing with is a Level 2 sub div'd daz character (80k verts/150k triangles). And as you might be able to tell, it's not enough density on the mesh to make this effect look as good as it could/should. I reckon one level up from that will probably be ideal, but that would depend on your project/goals tbh.
  • This solution is currently dependant on a plugin: I tried to make the whole solution vanilla but unfortunately, there is no functional way in UE5 to get the traced/hit "material" on a skeletal mesh, or specifically the index of the material hit. This plugin solves that issue but adds some complexity to the triggering of the effect.
  • Triggering the effect is best done via trace directly at the mesh. When I tried plugging in the data from a collision hit like with the sphere gif, the hits don't always register.
  • Performance. This needs testing and refining which I'll be doing soon. At the moment it's using a 1k render target for every material on the character that can support the soft body effect (face/torso/legs). I'm hoping I can reduce this drastically without really impacting the effect visuals much.
  • UE doesn't seem to like the way I'm using the scene capture component to unwrap and write masks either as you can tell from that warning spam lol. Needs investigation.
  • From the gifs, you probably saw me click her back resulting in a soft reaction. That doesn't really make sense. The best solution for this I think would be to vertex color paint the characters mesh in your 3D software of choice. Using one color channel as a sort of mask where you paint on 0 for no softness and 1 for max softness. This could then be plugged into the shader as a mask at the end of the stack. (I haven't done this yet, I cba opening my Daz mesh in blender and dealing with that import/export nightmare right now).
I forgot to mention but I also updated the shader to use the ripple mask to procedurally create a normal map. And in the following gif, there is no WPO/Vertex displacement, just a normal map effect. Which surprisingly looks better given my meshes lack of polys. With just the normal, it actually looks deceptively similar to the NS devs videos. Hmm, I could bump the strength on the normal up too.

soft4.gif
 
Last edited:

razfaz

Member
Mar 24, 2021
171
195
Some impressive stuff, very cool!
Wish we would have more of such creative exchanges, experimenting around and just have some fun with the framework, here and|or elsewhere.

It's very refreshing.
 
Last edited:
  • Like
Reactions: darkevilhum

razfaz

Member
Mar 24, 2021
171
195
Yeah with that it looks closer to the effect in your gif, still had some problems, like if i plug in the add node at the end to the wpo it comically balloons up the skin:
You don't have permission to view the spoiler content. Log in or register now.

If I skip the add node and just use the multiply node next to it directly instead the skin looks normal again. anyhow there's still the problem that the effect is just pulsating at seemingly random places on the skin and doesn't seem to really react to hits, I take it you didn't work out that bit yet then? I imagine we'll have to use to do that, or possibly would be better. But you're right, the tricky part will be translating world position or relative position to UV position will probably be tricky. to do it. I believe it's got some performance issues, but it's a start. (what the other link was based on).

View attachment 3703898

As u can see tho my testing environment is getting better. Still got some things i wanna do to improve it though.
Do me a favor and set credible anatomical human limits to the bones angle|rotation joints of Your Skeleton.
Without that, I may get nightmares because of the unnatural behavior of the extremities, while physics try to do its job ;)

 
Last edited:

Velomous

Member
Jan 14, 2024
265
227
Do me a favor and set credible anatomical human limits to the bones angle|rotation joints of Your Skeleton.

Without that, I may get nightmares because of the unnatural behavior of the extremities, while physics try to do its job ;)
I already have actually, it was just pretty low priority at the time but i did it when i was testing some PA based collision stuff cuz i didn't really like it either. I was just having some trouble with understanding how to set the limits, the problem was i had to change the direction and the rotation and not just the rotation, i hadn't noticed that little arrow yet.


I haven't even started looking at penetration yet but I'm hoping to do it through a combination of physics asset collisions + morphs.

I was getting pretty stuck on the soft body aspect yesterday, I went over the NaughtySandbox devs discord and bits once more as I was hitting a wall and I think I realised that he's relying a lot more on Physics Asset spring based bounce (similar to what's in that mouth video) than I originally thought. There is defo a shader ripple effect but it's on top of what is likely the multi bone approach.

In other words, his character must be rigged up with multiple bones per "jiggle area". It's a technique a few people have used to "fake" really soft body physics in the Skyrim modding scene where one guy weighted close to 100+ bones to the breasts and ass which had a pretty ridiculous result considering it's just bones and springs. (See here for skyrim example: )

I probably won't get around to testing that combo approach any time soon as I'm not doing character work for my project yet, waiting on some tech so relying on placeholder daz assets. But I did manage to get the shader pretty fleshed out and sorted and combined it with my default physics asset jiggle and the result is... decent with some considerations.

The size/intensity and such are all controllable and probably need refining, right now I'm just calculating a "force" lazily from the impacting object and passing it to the shader.

Considerations:
  • So this character I'm testing with is a Level 2 sub div'd daz character (80k verts/150k triangles). And as you might be able to tell, it's not enough density on the mesh to make this effect look as good as it could/should. I reckon one level up from that will probably be ideal, but that would depend on your project/goals tbh.
  • This solution is currently dependant on a plugin: I tried to make the whole solution vanilla but unfortunately, there is no functional way in UE5 to get the traced/hit "material" on a skeletal mesh, or specifically the index of the material hit. This plugin solves that issue but adds some complexity to the triggering of the effect.
  • Triggering the effect is best done via trace directly at the mesh. When I tried plugging in the data from a collision hit like with the sphere gif, the hits don't always register.
  • Performance. This needs testing and refining which I'll be doing soon. At the moment it's using a 1k render target for every material on the character that can support the soft body effect (face/torso/legs). I'm hoping I can reduce this drastically without really impacting the effect visuals much.
  • UE doesn't seem to like the way I'm using the scene capture component to unwrap and write masks either as you can tell from that warning spam lol. Needs investigation.
  • From the gifs, you probably saw me click her back resulting in a soft reaction. That doesn't really make sense. The best solution for this I think would be to vertex color paint the characters mesh in your 3D software of choice. Using one color channel as a sort of mask where you paint on 0 for no softness and 1 for max softness. This could then be plugged into the shader as a mask at the end of the stack. (I haven't done this yet, I cba opening my Daz mesh in blender and dealing with that import/export nightmare right now).
I forgot to mention but I also updated the shader to use the ripple mask to procedurally create a normal map. And in the following gif, there is no WPO/Vertex displacement, just a normal map effect. Which surprisingly looks better given my meshes lack of polys. With just the normal, it actually looks deceptively similar to the NS devs videos. Hmm, I could bump the strength on the normal up too.
Impressive Stuff. Are you sure you couldn't use this in the vanilla engine to get the traced hit? it seems like it's exactly what you'd need:

Yeah i've been getting stuck on softbody as well, it's interesting if he used spring bones, ur saying he did this?

But if so how did he handle collisiosn? I don't think you can do that via physics asset, it starts lagging kinda quickly if you're adding that many colliders. I have an idea for how to use physics asset for penetrations, but I doubt it's gonna look good though.

Anyhow after researching both penetration and softbody here's a summary of what i found, most of it is a recap for this thread:

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

And what hasn't been very well covered or spelled out in this thread yet, physics asset, the normal way of doing collisions for skeletal meshes is too limited to create the kinds of accurate collisions that are needed for softbody to look convincing, which is where the real softbody methods described in the summary come in, since part of the softbody simulation is handling those collisions. The real softbody solutions all have one thing in common though, they are expensive. The fake ones have the opposite in commn, they're inexpensive, but they are very limited when it comes to collisions.

The shader approach is probably the best way as it's a middle-ground between real and fake softbody (let's call it a very convincing fake that should also be able to handle collisions depending on how you do it).

If you're skilled enough at manipulating physics asset, you CAN add colliders for the vagina and lips and such, but they will
  • Not be very accurate, physics asset is geared towards simple collision shapes, and although auto convex can actually be done (when you create the physics asset) it just doesn't seem like it'd be very viable in actual use and honestly probably wouldn't be any better than delicately placed simple colliders.
  • Lag like crazy if you add too many colliders, which means to keep it optimized you need to minimize the number of colliders which means less accurate collisions and probably multiple physics assets to switch between based on conditions (so you only have necessary colliders active when they are actually necessary)
  • Penetrating objects would always have to face the issue of needing to pass through certain colliders, for instance if you've got a penis penetrating a vagina, it'd get stuck on the pelvis collider (i don't think even auto convex can fix this; I could be wrong though cuz i didn't test it particularly thoroughly). The only method i've thought of to deal with this would be setting the actual collision between the character and the object to overlap instead of block, and then manipulate the colliders with logic instead of the actual collision system. There's proably a better way this is just my first thought.
it's very tricky too, because lets say there's a way we can make it so that certain colliders/models can ignore certain colliders in a phsical asset (i'm not sure if this is possible but if it is it would be a very important tool) we'd need to be able to switch it based on conditions, e.g. lets say a penis collider should not collide with the pelvis collider, but it should only do that when it's in the vagina, if it's not in the vagina we would still want it to not clip through the pelvis.

But then once we have disabled the pelvis collider for the penis, now what? the penis will just clip through the pelvis after going in the vagina, and for instance in naughty sandbox there's some mehs deformation/bulging based on where the penetrating object is which we'd ideally want to recreate somehow.

Overall this is proving to be extremely complicated, and the more time i spend on this the more i understand why there's a dearth of good 3d hentai games. Plenty of people have found ways to do this, but none of them seem to feel like sharing their methods, some of them even seem to guard them, like they don't want anybody else to be able to do what they've done. Smh, they're failed degenerates, if they were true degenerates they'd share it all in the name of more, higher quality porn.
 
Last edited:
  • Like
Reactions: razfaz

darkevilhum

Newbie
Sep 9, 2017
77
78
I already have actually, it was just pretty low priority at the time but i did it when i was testing some PA based collision stuff cuz i didn't really like it either. I was just having some trouble with understanding how to set the limits, the problem was i had to change the direction and the rotation and not just the rotation, i hadn't noticed that little arrow yet.




Impressive Stuff. Are you sure you couldn't use this in the vanilla engine to get the traced hit? it seems like it's exactly what you'd need:
Unfortunately no, the FindCollisionUV node only supports static meshes. I did some research on this a while back and people complained about it/requested it as a feature but epic said it's as designed because they don't allow traces against skeletal mesh geometry, but rather the physics assets collisions and therefore you wouldn't get an accurate UV result. Ofcourse, some people took issue with that and so we have market place plugins that pull this off with C++ approximations using the vertex position. (Hence my need for that plugin).

Though, I will point out, the soft body solution I'm working on does not need UV data on trace. It just needs to know which material on the mesh was hit, and you only need this if your mesh has multiple materials. Otherwise you could get by without that plugin.

Yeah i've been getting stuck on softbody as well, it's interesting if he used spring bones, ur saying he did this?

But if so how did he handle collisiosn? I don't think you can do that via physics asset, it starts lagging kinda quickly if you're adding that many colliders. I have an idea for how to use physics asset for penetrations, but I doubt it's gonna look good though.


Yep, exactly that with a combination of a shader ripple effect. I haven't had any lag issues with my character yet and she's got atleast 30 sphere/capsule colliders so far, all with collision enabled. I plan on replacing the capsules with spheres for more accuracy in the long run which will likely push that number up to 60-80. I wouldn't expect this to cause lag though, even Unity can handle this pretty easily on a ragdoll and it's not as performant as UE in my experience. Now, if you have multiple characters with a similar setup in the scene at once, you will likely hit a CPU bottle neck for sure. So it depends on your use case.

Anyhow after researching both penetration and softbody here's a summary of what i found, most of it is a recap for this thread:

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

And what hasn't been very well covered or spelled out in this thread yet, physics asset, the normal way of doing collisions for skeletal meshes is too limited to create the kinds of accurate collisions that are needed for softbody to look convincing, which is where the real softbody methods described in the summary come in, since part of the softbody simulation is handling those collisions. The real softbody solutions all have one thing in common though, they are expensive. The fake ones have the opposite in commn, they're inexpensive, but they are very limited when it comes to collisions.


You mention that physics asset collisions arn't very accurate and I've kind of noticed this myself. Generally speaking though, in a game engine if you use spheres for example and lots of them, to as accurately as possible, block out your ragdoll. It should be quite accurate. This is something I need to investigate further/test.

The shader approach is probably the best way as it's a middle-ground between real and fake softbody (let's call it a very convincing fake that should also be able to handle collisions depending on how you do it).

If you're skilled enough at manipulating physics asset, you CAN add colliders for the vagina and lips and such, but they will

  • Not be very accurate, physics asset is geared towards simple collision shapes, and although auto convex can actually be done (when you create the physics asset) it just doesn't seem like it'd be very viable in actual use and honestly probably wouldn't be any better than delicately placed simple colliders.
  • Lag like crazy if you add too many colliders, which means to keep it optimized you need to minimize the number of colliders which means less accurate collisions and probably multiple physics assets to switch between based on conditions (so you only have necessary colliders active when they are actually necessary)
  • Penetrating objects would always have to face the issue of needing to pass through certain colliders, for instance if you've got a penis penetrating a vagina, it'd get stuck on the pelvis collider (i don't think even auto convex can fix this; I could be wrong though cuz i didn't test it particularly thoroughly). The only method i've thought of to deal with this would be setting the actual collision between the character and the object to overlap instead of block, and then manipulate the colliders with logic instead of the actual collision system. There's proably a better way this is just my first thought.
it's very tricky too, because lets say there's a way we can make it so that certain colliders/models can ignore certain colliders in a phsical asset (i'm not sure if this is possible but if it is it would be a very important tool) we'd need to be able to switch it based on conditions, e.g. lets say a penis collider should not collide with the pelvis collider, but it should only do that when it's in the vagina, if it's not in the vagina we would still want it to not clip through the pelvis.

But then once we have disabled the pelvis collider for the penis, now what? the penis will just clip through the pelvis after going in the vagina, and for instance in naughty sandbox there's some mehs deformation/bulging based on where the penetrating object is which we'd ideally want to recreate somehow.

Overall this is proving to be extremely complicated, and the more time i spend on this the more i understand why there's a dearth of good 3d hentai games. Plenty of people have found ways to do this, but none of them seem to feel like sharing their methods, some of them even seem to guard them, like they don't want anybody else to be able to do what they've done. Smh, they're failed degenerates, if they were true degenerates they'd share it all in the name of more, higher quality porn.


Hm, I can't think of a solution to the penetration problem off the top of my head. I've only been using UE5 for a few months now.
I had this all working in Unity though. The solution I used there was: For penetration I was using ragdoll collisions (spheres in the penis, and a tube made of small capsules in the vagina/mouth/anus).
Each orifice had a small sphere collider in the center to detect entry and then I use some math to calculate how long the penetrator is and therefore how deep it is, and output a 0-1 scale. I would then plugin that scale into a morph to open the receiving orifice and also scale an animation which increases the "hole" made by the colliders. I don't know if that will be plausible in UE. Will have to see.
I agree with you on the last part, sharing their solutions would just help us all grow. It's ironically dumb too, they don't share anything and then never get anywhere because they burn out or giveup. (I replied in the quote above btw, as you mentioned quite a few things :p )
 
  • Like
  • Red Heart
Reactions: razfaz and Velomous

Velomous

Member
Jan 14, 2024
265
227
I agree with you on the last part, sharing their solutions would just help us all grow. It's ironically dumb too, they don't share anything and then never get anywhere because they burn out or giveup. (I replied in the quote above btw, as you mentioned quite a few things :p )
I haven't been using UE very long either so I'm in the same boat. And yeah 30 or 40 colliders is no big deal, but we were talking about potentially hudnreds of colliders remember? You can do this test: Create a new physics asset, use these settings:
24-06-34.png
You should now have sphere colliders for most bones in the body, somewhere in the range of 100 colliders, it should still perform pretty ok (until u hit the simulate button, then it lags a lot!) then, but these are just the normal bones, you were talking about making spring bones all over the character's body with their own unique colliders, so it's safe to say that's a couple hundred more colliders.

So try again with these settings:
24-06-35.png

This should give you the same amount of colliders, but a roughly 5x higher number of primitives, so this is at least for me roughly the equivalent of having 500 spheres. If you tweak these values a bit you can actually get the colliders to very closely match the character's body, but once you get to that point your editor might straight up die because it'll be so laggy.

So that's what I meant about performance limitations. Also you have to consider that you'll probably rarely have only 1 actor active at a time, which means if you have 100 spheres, and 500 spheres would make you lag uncontrollably, then you could only have up to 4 characters active at a time with each character dropping performance by that much more (it might not be quite that simple, maybe it's optimized to run each character on different threads when it can or something I don't really know, but you get the idea).

And that's also where the issues with accuracy come in. If you want to use colliders and have any sort of performance you'll limit yourself to simple shapes like spheres and capsules as far as I can tell, because convex shapes that conform properly to your mesh are orders of magnitude more expensive (500 convex primitives didn't even cover half the mesh but 100 spheres covered all of it more or less in quite a lot of detail)

So if you want it to be accurate, like softbody-like detect exactly where on the mesh an object is pushing and deform it accordingly with a spring bone with each bone having a sphere collider for the surface (this actually seems like a good way to make the mesh deform from the inside if the penis collides with the body on the inside come to think of it), You're gonna need a lot of spheres, and the more accurate you want it to be, the more spheres and spring bones you're going to need to do it.

The other part of the accuracy problem is that you can only attach colliders to bones, so say for instance you have a vagina, and you have a bone for the left and right labia, only one each, you can put a capsule on each bone but it will not look very convincing, it's gonna be pretty janky, because it's not actually softbody, see? So to make it look convincing you would instead need to have a lot of bones each with individual colliders...

Which means that to have the kind of accuracy we're aiming for, you need to modify the mesh a lot by adding a moutnain of bones to it, and you're gonna need at minimum hundreds of colliders which is not gonna be conducive to performance. So you can make it really accurate at an extreme performance cost, or you can make it perform well with shitty accuracy.

It's a very unideal solution, i suppose it could work though.
 
Last edited:
  • Like
Reactions: razfaz