Sunday 28 November 2010

Clothing deformation

So I'm continuing working on completely random and meaningless stuff and I started thinking about the best way to animate clothing, and then started implementing what might just be the worst way possible.
I wanted to make a system where the clothes could have their own rig and their own animation, but could easily be linked to a chacter and follow his movements. Then I got a crazy idea that instead of just linking the rigs, I would skin the clothes dynamicly to a character; that way it would actually be possible to make a character visually undress or get dressed.

So I skinned the clothes to a simple rig, then I created a skinweight map for the character, and used that to find out what joint in the players rig to connect each vertex to based on their current position.
Getting this to work on the pants went well enough but it turned out that taking of a shirt is a lot more complicated. Obviously he had to raise his arms before I could animate the shirt, but the shirts animation had to be relative to the bind pose. The problem then was that if I raised the shoulders in the bindpose, somehow the animations got screwed and the shoulders looked slightly off when in their normal position. I tried a lot of different ways to transform betwen the different bindposes, but nothing really worked. In the end I used a very ugly compromise so the shirt uses the matrices based off the normal bindpose whenever it's in it's default position, but as soon as a it starts moving it uses the other bindpose.

I'd probably be able to make it look a bit better if the exporter supported scaling joints or if I make a more advanced rig for the shirt. Anyway heres the result. The clothing items has a simple animation when he takes them off; basicly just moving up or down and squeezing a bit, they are then dynamicly skinned to the character every frame (all in the vertex shader).



While it does look quite horrible and half broken; I still can't help feeling that it looks absolutly awesome somehow. And of course, with a system to animate people taking their clothes off, I'm one step closer to achieving my lifelong dream of creating the ultimate porno game...

Thursday 25 November 2010

Working like crazy on useless stuff

Life away from work agrees with me almost a bit too well. I've become completely engrossed in what I'm doing, to the point where I forget to eat and hardly leave the apartment; though I have now replenished my cookie-supply so food won't be a problem anymore.

I kind of feel that I ought to be working on some epic project, or at least a small one that I'll be able to show someday, but instead I keep doing a lot of completly random and useless things. I've been working mostly in maya lately; doing some animation, tried making a simple facial rig and modeled some random stuff. It's nothing that's really worth showing or that will be usefull in any real project, but it's relaxing yet fulfilling, which is exactly what I need right now.

It's been pretty much decided that I'll be returning to work in january now, so we'll have to see if I run out of random ideas before then and start working on something more substantial, or if I'll just relax and eat ice cream.

Thursday 18 November 2010

Therapeutic Coding

After a long period of rapidly increasing bitterness I have decided to take a time out from M&D. It feels weird to leave the other guys in the middle of everything but I need to focus on combating my bitterness. I have devised a strict plan comprised of lots of icecream, nougat and coding.

Yesterday I felt a sudden urge to play around with some rendering code again, so I booted up my old shooter project and started tinkering on some water effects. After a lot of experimentation and eventually some googling I think it's starting to look somewhat decent. It has reflections, refractions, waves and some dynamic ripples when you're moving around in it. The code is of course ugly as sin, but what the hell; I'm off from work now.



Now I just need to figure out a game concept with a pool of water (the water ripple system only works on a small, limited area right now).