A demonstration of my implementation of cloth running on the GPU. This is realtime; i.e., 300fps on GeForce 8400M GS. It uses the classic "ball and spring" model. It took all weekend to create.
This implementation is fairly simple, using only distance tensors. Angle tensors are currently broken, and I'm working to fix them. Kernel sizes are also broken/not supported. Presently, the cloth has no way of colliding with itself; and I don't know how I would go about doing that anyway.
The cloth is, however, fully wrappable; topographically closed objects can be created. The lighting is computed by comparing each point with it four orthogonal neighbors, and signing the result by the cross product of two of them. The cloth is computed using a position/restrained texture and a velocity texture. The textures are updated via ping-ponged FBOs and custom shaders.
This demo is presently in heavy beta, but it and the Python source will be made available on pygame.org when I release a new version of my OpenGL library. Look for it under "Geometrian".
Enjoy. Now, back to coding...
Really impressive, looks a bit weird at times but still impressive!
Chavtheworld 5 months ago
@Chavtheworld Thanks. The weirdness is due to numerical instability and self-interpenetration. The former can be mitigated with smaller timesteps (though, this video is somewhat old; my codebase is evolving beyond Eulerian integration). The latter is a hard problem in general. There are quite a few papers out there for how to fix this. I invented a method, which I call voxel projection, to attempt to deal with it.
GeometrianGL 5 months ago
.......do you ever go anywhere? at ALL?
FrannieFromOregon 2 years ago
Evidently, I've never been to visit Oregon.
GeometrianGL 2 years ago
This particular demo has 1600 vertices (40 squared), but the theoretical maximum size is much higher (like 4096 squared), as the implementation uses off-screen framebuffer objects. Note that to render triangle strips, more vertices must be rendered.
GeometrianGL 2 years ago