>> Looking for the source code? Just go the next post here<<

I managed to have some time to put together the simulation i was talking about last week: roughly based on a “Flade” (now APE) demo of that time, it makes use of APE for the physics and Papervision3D for the rasterization process.
Actually, using PV3D for merely rasterizing polygons its obviously an ugly solution if you, like me, don’t need all the scene management and just need to stretch bitmaps around: the real reason behind that choice is simply i was curious to see (1) how PV3D performed in a similar situation and (2) how to be able to bind APE and PV3D together.
Anyway, just modelling and simulating the carpet wasn’t enough: the motion were great and performing quite well, but it was lacking completely the sense and taste of realism one would expect from such a scene and the particular type of motion one can interact with.
I started by adding a (really) fake shadow that i’m too lazy to change and, since then, i liked the idea and adding a reflection was the next logical step for that context: it was still lacking some motion “feeling” so i also tried to mimic a directional blur simply by programmatically reducing the amount of blur on the slowest x-y direction.

I stopped experimenting with the blur thing, but i think it could be somewhat enhanced: i was thinking about a 3×3 / 5×5 kernel convolution filter in order to enhance angular motion, but i really have no time to try this out… do you know if this has been already attempted before?
Anyway, beside having a carpet pinned in a void chamber, although funny and nice to interact with, the scene lighting and colors weren’t so exciting, so i decided to play with bitmaps and filters with realtime compositing and post-processing in mind, eventually ending up with a bloom-like filter that seems to be able to enhance the imagery quite well.

The UI will permit to adjust the values of the simulation, output, effects and post-processing: since the computations can be really heavy and stopping the VM from working, an automatic adjustment of the physics integration timestep is enabled by default and it will look green/red when working for you, meaning respectively it’s raising/lowering the timestep.

During the development i’ve tried different versions of the Flash Player and here are the results:

- 9.0.45 - 9.0.47: on my machine i got something like 50fps with the default settings, some glitches can occur when changing the “Simulation” tab’s settings and i rarely got a Flash Player crash;

- 9.0.60.120: i got 60/65fps with default settings, no glitches occurs while modifying “Simulation” values and no crashes directly correlated with this have occured. There is a really odd behavior of the Flash Player btw, where a vertical band on the left can be seen when playing with the carpet smashing it from right to left: the vertical band’s width seems to be related to the position of the carpet but i’m still investigating that; playing with the carpet on the vertical band DOES hang the Flash Player. Hope to be able to tell more info on that: in the meantime, turning off the post-processing will prevent the problems from happening.

As a final note, i highly recommend to install the latest beta of the Flash Player since the performance really got a boost.

Let me know how it works for you: also, i plan to release the source code for both the demo and my modified version of APE (to let it to work with a fixed timestep expressed in Hz) so i’ll update these pages pretty soon.