Simulating Cloth in CG
monty writes: "Creating realistic clothing in games may not seem that difficult, but according to one of Intel's research programmers it turns out it is very difficult indeed. Intel senior technical marketing manager Dean Macri gave a presentation at the recent AGDC outlining the problems with simulating cloth, and some possible solutions. There is an online presentation (including downloadable source code and a fully configurable executable of the demonstration simulation) at The math is a bit intense, but the implications are that realistic cloth simulation remains out of reach for today's processors."
Monty found it on BigKid, but I couldn't ;)
The biggest problem with their approach is that you can't lightmap stuff that's been destroyed. In fact, if you watch the preview movie, you'll notice this right away. There's a scene where they blow up a tower. Watch as the lightmapping disappears just before it drops.
Problem isn't that creating dynamic worlds is hard; it's that lightmapping it is killer. Until we get processors capable of real-time dynamic lighting with hundreds of lights, or some other method of mimicking the effect on the fly, games are going to have the same visual flaws that you see here.
James
If I remember correcetly, there was a plugin for 3D Studio Max called Clothreyes. At this time, I can't remember who it was by. It did very good simulation, however.
For example, I managed to place a sphere on the ground, classifify a small plane as cloth, and the plugin allowed it to properly drape over the sphere.
Have a nice day, Rob---
Rob Flynn
---
Rob Flynn
Pidgin
You can improve the rendering of the hair on your newscaster by picking any color other than bright green. Optimize the little things first before you try more sophisticated hair rendering algorithms.
If tits were wings it'd be flying around.
Computers will be at least tens faster in 2005 and a hundred times faster by 2010. Remember the first photorealistic creature was the water monster in Abyss in 1989; people went goo-goo over 18 minutes of dinosaurs in Jurassic Park, and the past couple years have full feature length GC films. Just wait and see new wonders.
CG people don't get cold, so why should they need clothes? Clothing I just a technological anachronism when it comes to CG.
Now, if all the CG characters were naked you'd have a lot more hair to animate... So perhaps this isn't much of a solution.
-josh
..but the article is talking about real time cloth simulation, whereas the lobby seen in the Matrix is a chroma shot composited into live action.
As for games which implement it, Q3 definitely does; Soldier of Fortune and Elite Force do; I'm not so sure about Unreal Tournament, but the original Unreal (think old-school, like Unreal 206/208 on a 3dfx card) had a feature like that in GLide: whenever you walked right up to a metal crate, it would have an electroplated, galvanized texture. The stone doors in Chizra's temple had an etched look. Perhaps this was done with multi-texturing as opposed to bump mapping (it worked on the Voodoo 2, which I don't think supported bump mapping); either way, it died out as soon as Tim Sweeney screwed around with original Unreal (replacing the weapon sounds with those from the then upcoming UT, screwing around with Steve Polge's bot code, fixing Direct3D, etc.)
Therefore, why complicate the scene by adding extra polygons for texture when it could all be done via bump mapping? Dented cobblestones on the ground, cracked wood planks, rusting stone; it can all be enhanced by bump mapping.
"Ancillary does not mean you get to rule the world." --U.S. Circuit Judge Harry Edwards, speaking to the FCC's lawyer
Computer simutation of cloth is an old CG problem and very complex one. Simulation systems have been evolving for years (just get out your back issues of Computer Graphics World,) and nobody was even claiming to be near doing real-time simulation.
There are three forces at work: gravity, centrifugal forces and the tension of the cloth around objects against these forces. This is not trivial.
Only the force of gravity is predictable.
The rest are all solutions of simultaneous equations. The more realistic the simulation, the finer the division of the cloth area into matrixes of threads. The number of calculations goes up geometrically.
We're definitely not there yet.
MSBPodcast.com The opinions expressed here are my own. If you don't like 'em... Think up your own stuff.
How about virtual Strip Poker?
Currently, Volition is working on a first-person shooter game called Red Faction. The Geo-Mod engine features "real-time, arbitrary geometry modification" (you can blow up bridges and sniper towers, and they fall, completely unscripted! You can also fire the rocket launcher into the ground or at walls to create holes) and "Advanced physics simulation - supports falling geometry, particles and liquid" (you can blow holes in the ground next to a stream, and channel liquid into it!). This might be a control nightmare, but it looks promising. PC Gamer had a scoop on the game back in their August issue, but unfortunately, they don't archive on their website (at least for previews). I wouldn't expect to see this game released for another year; I foresee many control problems that may arise by having such a dynamic world created with everything unscripted.
"Ancillary does not mean you get to rule the world." --U.S. Circuit Judge Harry Edwards, speaking to the FCC's lawyer
I agree with you to a degree; reality is boring. Imagine a fighting game that, if your character took too much damage during a fight, required you to "play" through 2 months of game time recuperating in a hospital. More realistic, but less fun. Graphical realism, on the other hand, is something that generally doesn't alter the gameplay/fun factor (with exception of excessive polygon counts slowing down the rendering engine). Compare and contrast playing something like Quake 2 with and without a 3D accelerator; even if you "rigged" the fps count to balance things out a bit, there's just no getting around the more aesthetically pleasing visuals from the more "realistic" rendering.
As long as game designers don't go overboard ("If you do too many kicks, it causes a realistic physical simulation of a tear in your pants, which then drop to your ankles and make you fall flat on your face."), i don't think it'll be a problem.
"The question of whether a computer can think is no more interesting than that of whether a submarine can swim" -EWD
"Well, we'd like to cloth her more, but it's just so hard to simulate!"
But so very easy to stimulate.
Rendering realistic cloth movement might be tough, but the CG industry has already perfected rendering pure and unadulterated evil in humanoid form. Witness Jar-Jar Binks.
If you look carefully at Geri's clothing, you'll notice some odd quirks -- but I guess it's like watching a magician, you're not as impressionnable if you're a magician yourself. :-) Also keep in mind that in a motion picture production context, simulation is not your only resource; you actually have real people working for you :-). Sometimes you'll have small penetrations into the body or whatever, so you'll just pull a few vertices by hand or even load up the frames in photoshop to paint them...
As far as hair is concerned, Monsters inc (Pixar's next movie with Disney) doesn't show off any impressive animation. You can see stuff that's just as good, even better, in Mighty Joe Young (yes, most of the shots use a CG gorilla, complete with realistic-moving hair and all). The really challenging part about hair animation is the movement of long hair which interacts with itself. Otherwise, you just need to animate a few long chains (say, one per square inch), and interpolate the rest, and it looks fairly good.
What Robert says is partially true - the models for clothing are not yet perfect (same with hair, actually, same with many CG issues - you can generally tell CG smoke and water, for example). Modeling clothing and hair requires modeling both a "solid structure" (the body) beneath, and the "soft structure" on top (hair, actually, requires many structures to be modeled - lots of hairs - clothing requires several complex dynamical structures to be modeled). To accurately physically model the clothing dynamics, there are A LOT of variables, and a lot of constraints.
However, computational power IS a concern in terms of getting realistic hair and clothing into games. Pixar uses a VERY large render farm in making their films, and most of the top quality algorithms are optimized not for speed but for, well, quality. The best of what can be done now requires a lot of computational power. Not until a sufficiently realistic algorithm is completed, though, can one start to optimize it for less powerful computers (and, as with any imaging algorithm, sufficient is subjective - beauty is in the eye of the beholder...)
But, while these technical issues are certainly fascinating, fun to work on, and of great utility to the digital film industry - the question that hasn't been asked about gaming is: is that much realism actually necessary? (With necessary in the industry being defined as: does it make the game more fun, and thus more people will buy it?)
My experience in the gaming industry, and VR industry, indicates that the quality of the story, and of the action, outweighs the "realism" of the images. If the industry put more money into the creation of more compelling stories, more engaging games (including less repetition - which becomes harder to do if you need to cache hard-to-render scenes to use them over and over to save CPU time and/or money in up-front rendering basically cell-animation style), and better integration of network interaction into the game plot structure... I think the results would be more fruitful than better and better algorithms for hair and clothing.
I think researching cool rendering algorithms is fun, and should continue, but the gaming industry could also stand to invest some more money into better interaction design and better writers...
o/~ we are pissed, we are pissed, we have to resist... o/~ - ec8or
... that cloth was a pain in the ass to model/animate.
You see, this is just another excuse for the makers of Tomb Raider to keep Laura Croft in skimpy outfits...
"Well, we'd like to cloth her more, but it's just so hard to simulate!"
--
Feminism is the wild notion that women are human beings.
It may just be me, but like I said in the title, "Is this really an issue?" I look more for interesting game play, a good story, and decent graphics. Do I care that the clothing looks realistic? Not really. Do I care that the game obeys the laws of physics? To some extent, yes. But since I play a lot of fantasy and pseudo-fantasy games, those laws get broken a bit. Am I more interested in a good story within the game, motivation for why the characters are doing whatever they are doing in the game, and a good game engine.
I don't want reality in my games. That is what I am escaping from.
Eric Gearman
--
Atomic batteries to power! Turbines to speed!
...you should SEE what they can do in simulating cloth! I mean, those simulated corduroy pillow cases are making headlines.
Ceci n'est pas une sig.
Creating realistic clothing in games may not seem that difficult...The math is a bit intense, but the implications are that realistic cloth simulation remains out of reach for today's processors
Actually I would have assumed it would be very, very difficult to realistically model clothing. I'd have assumed it would be very, very difficult to UNrealistically model clothing. I'm no CG designer (or physicist), but wouldn't it be similiar to realistically model fluid dynamics, only with a whole lot of weird variables thrown in?
--
Some packages, such as Lightwave and Maya, have real physics engines for animation. Realistic cloth simulation is not all that difficult... unless you have to do it real time. Maybe the NVIDIA GeForce 12 mega-hyper-championship-edition with it's Strategic Motivation Engine(TM) or the newly advertized PlayStation IX will have the power we all need to see realistic clothing on in Quake MXCCLIV, and this technology can also be applied to organic material simulation, so that the body parts flying, as one get gibbed, can be perfectly accurate and anatomically correct.
"Evil beware: I'm armed to the teeth and packing a hampster!"
Lex orandi, lex credendi.
At a conference a few weeks ago (Learning to Behave - TWLT17 in Twente), there was a speaker from University College Londen who talked about "Efficient Cloth Model for Dressing Animated Virtual People".
I couldn't find the whole article online, but a very rough overview is here.
The purpose of that research group at Intel is to find new ways to use up CPU time. Really. I've been down to visit that group. I do physically-based animation myself, so I'm familar with that crowd.
Cloth is hard to simulate because cloth has hard tension limits. This makes the numerical problem stiff, and you can't just integrate the springs and dampers explicitly. You have to either use a constraint solver or an implicit integrator, both of which are slow. This class of problem (integration of stiff systems of differential equations) takes more numerical work than it seems it should. Work continues on speeding it up.
Note well that this technique is in the process of being patented by Pixar. I have no idea how much they are trying to patent, when it may grant, and all of the other pertinent information. I do know that they make no mention of the patent in their Siggraph paper. thad
I love Mondays. On a Monday, anything is possible.
So far noone has really managed to simulate anything within a fraction of 'realism'. The number of variables that need to be taken into consideration is absolutely horrendous. The nearest we can get without throwing Cray computing power about is a vague approximation.
But...
Isn't a vague approximation enough? Take a recent computer game as an example, say Tekken Tag Tournament or Soul Caliber on the PS2 and Dreamcast respectively. Both these games look damn good. No doubt about that. They're by no means 'realistic', far from it in fact, but who cares? The games are fun. When did gaming take to being real? Its an escape isn't it? Maybe in the future games will look like the world around us, on that day I think I'll be going back to my SNES.
http://twitter.com/onion2k
Anyone can do it with enough time and CPU power... the problem is doing it realtime. An 64-CPU SGI wouldn't be able to do it even close to real time.
"Evil beware: I'm armed to the teeth and packing a hampster!"
Lex orandi, lex credendi.
Allow me to play the cynic for a moment...
So, Intel has studied the problem and determined the answer is "We need faster processors". Is anyone surprised?
It would seem difficult to buy a computer these days at less than 600MHz; that's an IMPRESSIVE amount of power. But when I go look at the store, there aren't games that need more than 300MHz. So there aren't games that need a new computer for the majority of gamers (faster frame rates, true, but not a convincing thing for most gamers). So I don't think the CPU power will be out there for this until games start requiring more CPU power incrementally. Also, TnL graphics take a bit of CPU load off, thereby improving things. But basically, I think games need to start demanding more CPU power. It's out there, so use it!
If you wish to have stretch and shear, then you don't need 8 virtual springs. 6 will suffice.
a---b
/ \ / \
f---x---c
\ / \ /
e---d
Bend can be added using another 3 springs, a-d, b-e, c-f. 9 springs rather than 12.
Remember that the trianglular lattice is used for most things anyway (see the wire frame pictures on the second page for an example).
Et voila, 25% faster!
FP
Also FatPhil on SoylentNews, id 863
What you should do is save valuable processor cycles by forgoing any clothes at all on female characters.
Ah, but games usally have male characters too. Do you want them all to be nekkid or clothed in spandex? I guess one could save processor cycles by putting them all in rigid body armor, but while that may be suitable for warrior characters and the like, it seems a bit odd on galactic emperors and high priests.
Realistic clothing may be neat eye candy in games - and that's a Good Thing - but it can't make up for poorly designed rules or a boring concept.
When working at the chemistry department of the University of Arizona, I ended up co-sysadminning a supercomputer called the Ardent Titan. Ardent seems to have disappeared.
The Titan's focus was graphics and vector-processing. A scalar processor loads one register with one value resulting from one operation. A vector processor loads n registers with n values resulting from one operation; think "ADD AX TO EACH REGISTER IN VX[]". Four CPUs in our model, but it supported far more.
One of the sample programs was a flag hanging on a flagpole. It was a 512x512 node swatch of cloth, and it was being animated at 30fps, if I recall. You could drag your mouse to adjust a wind source. As you moved the source, the flag would flap realistically.
I had my one-processor SGI (MIPS 4000 at 100MHz) handle the same basic simulation with 64x64 nodes, a few years later. Of course, the complexity of the simulation increases geometrically with the size of the swatch of free fabric, but it's not THAT terrible.
In essence, the simulator is just an MxN array of nodes, with springs between each node horizontally, vertically and diagonally. The two diagonals can be given opposing compression limits, to emulate the thread bias of cloth. Apply forces to all nodes, and minimize the energy on each node. Take another pass to apply forces of self-collision, where one part of the fabric tries to intersect another part.
[
The problem with clothing is that different fabrics "hang" differently. Apparently, this is a big issue in the clothing industry and determines why clothing designers choose different fabrics for different outfits: it isn't just how the fabric looks, but how it behaves. The computer has to emulate the performance of the cloth not just in terms of how it behaves at vertices and how it stretches, but also how it behaves along with gravity. If you look in "Geri's Game", notice how the clothing folds. The designers had to emulate not just the person's body, but the structure of clothing on top of that body (until now, clothing has always been animated along with the body). Don't even get me started on the problems of textures.
In essence, the problem is very, very difficult. It is not so much a question of computing power; we are still working on how exactly to model it in the first place.
Pixar's patent on scalar fields on subdivision surfaces has already been granted. This includes some of the techniques used in their cloth animation system (e.g. the "starch" scalar field applied over Geri's shirt to specify how malleable the cloth is over its surface).
Pixar has a history of software patents. Probably the most silly one is a patent they got during the 80s, and extended in the early 90s, on certain kinds of Monte Carlo integration. Oh, yes, and Pixar also claim an interface copyright on the RenderMan API and RIB protocol. They do NOT play nice with so-called "intellectual property".
Pixar would be one of the coolest companies in the world if Steve Jobs weren't in charge. :-)
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
Computer graphics is an exercise in modelling.
Practically every technique that is in use in graphics today (specifically, and particularly, in games), is a model, an approximation to the real world. Texture mapping, polygonal approximation, simplistic lighting models - all of these are convenient, efficient, and realistic looking models of real life.
What the story appears to say is "computers are far away from this particular model". Well, that's always going to be true, since the model can always get more realistic and detailed, up until the limits of understanding particle interaction in modern physics.
The presentation itself is very interesting, and also presents some models that are somewhat feasible for limited use in today's applications.
Henry
i don't do sigs. oops.
Alias/Wavefront has plugins for Maya that simulate hair/cloth, and has had them for quite some time. I've seen demos with hair/cloth turned on that are quite stunning. Unfortunatly I can't seem to find the link on their webpage Alias/Wavefront, but they have a demo movies section. In particular, watch Bingo and look at the small girl's dress. This is an old demo, but I think they used an early version of the cloth plugin to make it (which is why the dress looks a little plasticy).
I read the internet for the articles.
... but not necessarily in the sense you're thinking of. Allow me to explain by way of example:
When I saw the new Final Fantasy trailer, I was completely blown away. But it wasn't until I had watched the trailer a couple of times and explored the rest of the web site that I realized that one of the reasons was because the characters seemed to move so very realistically -- especially their clothes.
"Is this really an issue?" Yes, but in one of those subtle ways that is often hard to justify to the bean-counters. To me, the best special effects are the ones that don't call attention to themselves, but rather let the storyline continue. And that goes for movies and games. Since we are beginning to see more and more CG characters on the silver and game screens, any little bit towards realism is a step in the right direction.
In the attempt to escape from reality, are you really satisfied with blocky characters that jerk across the screen? Realistic cloth simulation in no way limits the possibility for "unrealistic" plot, action, character movements, etc. It only makes the characters themselves seem more realistic. If you really want to escape from "realistic" characters, go play on an old NES, or better yet an Atari. Their games have as much action, plot, and challenges as today's games -- but they don't look so realistic.
"I came here to kick ass and chew bubblegum. I'm all out of bubblegum." MSE USC APX AIA CSI CASp
There's so many people with computers and on the net who are interested in Pr0n these days, who's going to care about being able to generate fake clothing on characters? :-)