XXX4Fans
colortwist from patreon
colortwist

patreon


Deterministic cloth sliding algorithm via 2D UV space transformations

Before I start rambling about technical stuff here, I should probably note that this really shouldn't be taken as a sign that I'm working on swimsuit stuff again... This idea has been on my mind for ages now, and it's applicable to a wide variety of different situations- so while swimsuit stuff is still my backup plan if I can't come up with anything better, I'm still exploring some other subjects for the near future instead.

Anyways...

This has always kinda been one of those weird "holy grail" things that I've always wanted to try and figure out, but have never quite been able to due to a lack of proper tools. The last time I tried something like this was back in October of 2019 with a spline based setup inside Cinema 4D, but that didn't quite work out because C4D lacked a bunch of other stuff that I needed to easily manipulate the geometry into the desired shape.

Sometime around 2020, I had another idea for accomplishing something similar, albeit using geometry projection and space transforms instead of an overly complicated spline based setup. Unfortunately I was in the middle of switching from Mac to PC back then and one of the things I decided to drop was C4D (precisely because of issues like this). I hadn't yet learned enough about Houdini, so I wrote the general idea down in a text document and promptly forgot about it for a year.

Recently I kinda wanted to try and do something "technical" in Houdini that was actually fetish related, so I figured... hey, why not take a shot at that thing that's been bothering me for years now?

This is more or less the result.

The general goal here was to create a system that:

It still needs some tweaking, but the core technique seems to be relatively sound. In essence, this setup tries to solve a huge limitation in computer graphics- namely that corrective morphs (or blend shapes) can only ever move vertices around *in a straight line*. Most of the time this isn't an issue, but if you're trying to do something like pulling down the front of a swimsuit as the model expands- you will quickly find out that the path your vertices need to follow is not in fact a straight line, but rather a complex curve.

This particular system tries to work around that by projecting one mesh onto another and transforming it into 2D space by way of a carefully crafted UV map. This process is performed on both the base mesh and any additional morph targets that need to shape the clothing in a size-independent manner. The actual morph blending then takes place entirely in 2D space (where the vertices are free to move in a straight line), at which point the results are re-projected back into 3D space to create the final mesh shape.

Essentially, this totally decouples the ability to slide cloth around on a virtual (hidden) surface from the actual size and shape of that surface. The morphs that slide the cloth around are performed in 2D where they can be easily represented by a simple blend shape, while the translation between 2D and 3D space takes care of all the mathematical complexity required to create effects like this.

The first GIF shows how the overall system works (with smooth viewport shading). The second GIF is a wireframe render from behind, which makes it possible to see how the strap geometry stretches out over the shoulders and down the back. The third GIF shows how the 3D morphs for the cloth sliding effects are represented in 2D (and subsequently morphed before being re-projected back into the scene as a 3D object).

I should probably note that there is no simulation going on in these scenes- it's all just totally deterministic rigging running in the background. Given a specific pose, body size, and set of morphs that control the cloth sliding- the output will always be exactly the same. This entire system is totally independent from time and requires no particle or cloth simulations to operate.

Deterministic cloth sliding algorithm via 2D UV space transformations Deterministic cloth sliding algorithm via 2D UV space transformations Deterministic cloth sliding algorithm via 2D UV space transformations Deterministic cloth sliding algorithm via 2D UV space transformations Deterministic cloth sliding algorithm via 2D UV space transformations

Comments

The behind the scenes stuff never ceases to amaze me - the complexity, the work, the sheer amount of maths needed. And here I thought you just mashed the 'inflate boobs' button a few dozen times

M

Very cool, thanks for the in-depth explanation!

krams


Related Creators