animate1978 / MB-Lab

MB-Lab is a character creation tool for Blender 4.0 and above, based off ManuelBastioniLAB
Other
1.83k stars 315 forks source link

Procedural Wrinkling For Deformations Concept + .blend Project #228

Open torridgristle opened 4 years ago

torridgristle commented 4 years ago

I've been trying implement wrinkles on deformations without using drivers like most people seem to suggest in Google results, and so far this is my best result.

The gist of it is that the original pointiness of the mesh in a resting state is rendered to a texture and then the live rendering of pointiness of the mesh is subtracted from this texture. As the result goes positive the horizontal wrinkles fade in, then as it reaches zero they fade out, then as it goes negative the vertical wrinkles fade in, etc for stronger wrinkles. For smaller wrinkles like normal skin texture it'd blend between the two directions with unchanged resting at 0.5 mixing them together evenly until the skin stretches or squishes and accentuates one and removes the other. Or it's the other way around, I don't quite remember but it's a quick check in the materials itself.

The real issue that I've mostly solved is a lack of accuracy in the baked pointiness texture. 16-bit just isn't good enough and results in banding. Since it's mostly going to be very close to 0.5 I've resorted to companding the output of the pointiness shader by subtracting 0.5 to center it on 0, absoluting it, performing 1-(1-x)^10 or so, restoring the sign via multiplying with the output of -0.5 divided by absolute, and adding 0.5. Then this companding is also done to the live pointiness value, or it could be de-companded if that's wanted. I don't have strict values for anything, it's really just a loose concept.

Here's a .blend with a Suzanne rigged to twist with an armature and some horizontal and vertical "wrinkles". DeformationMasking-1.zip

The material has two outputs, one mixes between horizontal and vertical with unchanged resting at 50% each, another just adds them together based on -1 to 0 being one direction and 0 to 1 being another.

The idea was inspired by this paper, which does things with a lot more complication which may not be possible in a Cycles material. http://vgl.ict.usc.edu/Research/SkinStretch/skinstretch_SIG15p.pdf

ez-set commented 4 years ago

This is pretty cool.