Hair surface subscene

Other Hair surface subscene

atani

Invaluable member
Featured Contributor
Messages
2,523
Reactions
2,348
Points
143
Website
atani12.gitlab.io
atani submitted a new resource:

Hair surface subscene - A collision surface for hair

Hair surface subscene
This is a subscene with 9 capsule atoms to use as a surface for hair collision.
It's a very simple subscene, easy to make, but sometimes these small things are neglected and likely there's many around that would find it useful, so here it is.​


What is this for?

If you ever positioned a person on a bed and watched the hair...

Read more about this resource...
 
I feel the need to point out that this isn't true. They are, admittedly, quite large; but you can resize them.
I had made some tests at some point and as I couldn't remember well the results I tried it just now:
Using a slate with a much smaller scale I noticed it doesn't react to the hair of the person, collision or not, but it does to the clothes. Was I testing on clothes at the time instead of hair? Maybe, I don't recall.

I'll remove the slate mention on the description, unless something odd was happening when I tried it moments ago? Can you try it out too?
 
Weird that it didn't work with the hair the person had when I tested 5 minutes ago. Here I go to try again with another hair.
 
Ok, tested again and slate works, but only if you move slowly the hair and some parts can still pass through it. On the other hand, capsules always collide and are much more stable.
I can add these findings but still suggest the capsules as the better option.
 
Mathematically, capsules are the second-to-fastest option (after sphere) for collision detection/response. Anything using flat surfaces/meshes like the slate would be more complicated and problematic. At some point I noticed that scaled slates seem to affect clothes even beyond their visible scale, so I am wondering (haven't tested) if the scale factor only impacts the visible part.
Just yesterday, I thought about writing a plugin that fills a cube atom (which would provide merely the outline/dimensions) automatically with capsule colliders, without them showing up in the scene atom list and with an option to quickly turn them all visible/invisible. Looks like there is "a market"...
 
The plane collider used by things like the Slate is problematic since it doesn't seem to have any limits at all, making it infinitely wide, while also having no checks for if something has passed to the other side, making it very prone to fast moving colliders passing right on through it, which is what originally made me think shrinking it worked.
But on closer observation I noticed that clothing would get stuck with parts under and over the plane, depending on when it had loaded into the environment.
One handy property of these shapes is that the collision systems are fully independent, so you can disable collision and tweak the scale to better match how things look, since the GPU colliders hair and clothing use will still collide.
I often use an invisible sphere parented into the body of Person atoms, for example, using it to push clothes that clip into the body out by increasing its scale for a second.
 
The slate atom infinity was mentioned by @DJ some time ago in Discord, pinging him to join the party. I don't recall the explanation or understand the technical side that much, so I just imprinted in myself the simplistic memorisation of "slate works but limited, capsule better, me Tarzan 🍌" 😄

Thank you all for sharing your knowledge on these matters 🙇‍♂️
 
I was discussing this topic a while back. Some hairs are worse then others in terms of complying with things that collide. In my Leatherface scene, I used a rescaled slate inside the table. The scene has to be started with collision on her off, or you might have a Chernobyl moment. The trick was to turn collision all the way up on the hair. When you load the scene, collision is off. You turn it on, then dial back the collision. I got the hair perfectly spread out on the table.
 
Slate is ok for floor collision. But if you try putting it on the bed for example, the collision will be independent of the slate size. So if you want something dangling from the bed's edge, it will collide as if slate is maximum size.
 
Mathematically, capsules are the second-to-fastest option (after sphere) for collision detection/response. Anything using flat surfaces/meshes like the slate would be more complicated and problematic. At some point I noticed that scaled slates seem to affect clothes even beyond their visible scale, so I am wondering (haven't tested) if the scale factor only impacts the visible part.
Just yesterday, I thought about writing a plugin that fills a cube atom (which would provide merely the outline/dimensions) automatically with capsule colliders, without them showing up in the scene atom list and with an option to quickly turn them all visible/invisible. Looks like there is "a market"...
But is it possible to just make cubes that collide with hair/clothing ? Capsules are all great but if it's something like a sheet, once it lands on a row of capsules it will become apparent that it iscolliding with a row of round objects and not with a plane, so for smooth surfaces it will look a bit odd.
But if we had a proper smooth plane surface collider without all the problems that slate brings, it would be absolutely amazing.
 
Did a bit more experimenting. To be clear, the shape in the screencap is a regular Capsule altered by a plugin and not an ISCapsule. Apparently, no matter the shape of the capsule itself, the collider for it will always be
1. Tied to it's scale on the X and Y axes.
2. Rescaling the object on the Z axis has no effect on the collider
3. Always cylindrical in shape.

1709829619953.png
1709829726773.png
Another thing I've learned, is that if you reverse the on the X axis so that the shape is basically inverted, it also inverts the the collider so it basically acts like a weak "Cloth Grabber" for hair

1709829975305.png
Mind you, that last effect looks super wonky live in VAM.
 
Edit. For anyone else that runs into this issue. Toggle on the targets with (T) -- then you can select each capsule individually to hide them.


How do we hide the capsule end materials? The collision is great, but the two purple capsules in the scene isn't ideal. 😅
 
Edit. For anyone else that runs into this issue. Toggle on the targets with (T) -- then you can select each capsule individually to hide them.


How do we hide the capsule end materials? The collision is great, but the two purple capsules in the scene isn't ideal. 😅
Stated in the description:
The capsules at the end are visible while the others in between are already set invisible (Materials > alpha adjust: -1) and set to "hidden" (atom control). When it's in place you can change the end capsules to invisible and hidden like show above.
 
Stated in the description:

Thanks! Great job with this cool tech you made btw =)

I love how the hair can react to other characters. IE: Female hair on guy's thigh reacts "realistically"

I wonder if this can be applied to clothing or fabric. Like bed sheets or something else ..
 
The problem with male atoms is that they don't have as many colliders as female atoms. Fortunately there's this plugin to create those collisions:
 
The problem with male atoms is that they don't have as many colliders as female atoms. Fortunately there's this plugin to create those collisions:

I just rotated the capsules to semi match the guy's thigh position. =)
 
Back
Top Bottom