andy

Vorticle Fluids implemented in PopcornFX

This is a really crude first approximation of a homebrew realtime fluid simulation using vorticles. The general idea is a sparse layer of particles are queried for position and orientation and used as centers of rotation to simulate turbulent fluids. Even this very simple first experiment is very promising.

No noises, fields or turbulence forces are used, the motion is all directly a result of particles interacting with a layer of vorticles, which I reveal in the latter portion of this video.

Simulation is entirely on the CPU and takes 18ms per frame for 21,000 particles. One nice thing about vorticle simulations is the motion does not change with the number of particles, meaning a simulation can be tuned while running very fast and then the simulation turned up for millions of particles to be rendered in After Effects etc. I look forward to seeing how fast this will run when entirely on the GPU.

Apologies for the tiny video… this is just a screen capture.

Fibonacci emitter module in Unreal Niagara

I created a number of custom emitters for Niagara which I have yet to release to the public. (I wish there was a nice way to package up and share custom modules rather than having to share out entire project files.) These frames are illustrating the use of a fibonacci (or phyllotactic) sphere emitter which is tailor-made for dandelions…

Unreal Experiment

Just a quick test scene in Unreal. It has no home, so I decided to let it live here. The camera gear was modelled by me years ago for the Sketchup Film and Stage release, I was really gratified to discover that all of those models I made are still in use and part of the collection of .skp files at 3D Warehouse.

Propagation in PKFX

PopcornFX is a great tool for realtime applications in that it brings to developers a ready-to-integrate particle system which can be used to author sophisticated effects in a nodal/visual style akin to Houdini, ICE etc. I find it much more intuitive than Niagara while easily being as powerful, and it’s integration into After Effects brings those users a level of sophistication with particle effects they simply haven’t had access to before. That said, when I push the limits it understandably can’t chew through the millions of particles Houdini can handle.

For example in PKFX this frost-like propagation effect, which is admittedly computationally expensive, tops out in usefulness at about 50,000 particles. The in-editor framerates are still good (relatively speaking) at 220 ms, comfortable enough for cinematography work in After Effects for example. But when you push the number of particles up beyond that times go up exponentially. By 100k particles (for this particular task, which involves getting neighboring particle information) the editor becomes increasingly likely to crash.

But to be fair this kind of propagation effect is waaay beyond what most realtime engines are engineered to handle. Other effects in PopcornFX can get into the realm of millions of particles without too much trouble, which means those After Effects users have a system which lets them perform most particle effects they are likely to need extremely efficiently… and only need to go to a package like Houdini for the really intensive stuff.

And at the moment these computations are only on the CPU as PKFX is still implementing its GPU support. There is a lot of improvement on the near horizon for these kinds of intensive effects… we may see sph fluids and the like running realtime soon enough.

(It’s also worth mentioning that there is a LOT of room to optimize the effect as built, both with regular settings and as one of the PopcornFX devs points out massive increases in efficiency should be possible by only performing spatial queries on the particles changing values and depositing stable values into a static layer.)

It’s significant that those integrating PopcornFX into realtime tools get a system sophisticated enough that a comparison with Houdini is even possible.

In all, I’m pretty impressed with PKFX and as an effects guy would welcome jobs where it’s integrated into custom pipelines dealing with realtime media even over Niagara and certainly over Unity’s particle system. It is elegant to use without sacrificing power, and it’s universal nature means one day artists might be able to share and use particle assets across multiple engines and custom pipelines.

Newtonian Universe Simulation

I’ve been using PopcornFX a lot lately and have been using it as a playground to explore some simple physics simulation. For example Hooke’s law and compressible springs:

And it was pretty fun exploring Newton’s law of universal gravitation with a classic “orbit” simulation:

But then it occurred to me… PopcornFX is pretty efficient, why not scale up my basic simulation to handle not only a few orbiting bodies, but hundreds of thousands? While not correct to the universe we live in the result should look a bit like elliptical galaxies, right?

Let’s try it.

Ok then, here’s a screenshot of a sim of around 900k particles, running 30-50ms per frame. Too slow for game work but pretty fast for cinematics, and PKFX is integrated into After Effects so I really should try rendering out a movie.

In motion the effect is mesmerizing, with “galaxies” merging, splitting, devouring each other and for some reason periodically seeming to explode into rope-like strands. Nowhere near physically correct of course, but evocative of space imagery and very beautiful. 

Why no spiral galaxies? In the real world a lot more is going on, with gasses compressing and angular momentum preserved. This little simulation doesn’t account for more than the most basic, crude motion so, alas, the “galaxies” which form are elliptical only and rarely stable for very long.

Popcorn FX fractalFlame

Popcorn FX is capable of some pretty sophisticated particle effects. With a little effort one can get past the “usual” turbularized effects and push the limits a bit. Here’s a “fractal flame” look made by spawning, coloring and moving particles with layered noise fields. Given the number of particles used to give the soft look it’s not really something you could include in a game or application but was a fun way to explore some techniques which could be used for more efficient effects. You can get a similar look with much better performance using a vertex shader to distort a mesh and a fragment shader with an additive fresnel transparency, but again the point of the exercise was more an exploration of PopcornFX. That said, this does run in realtime with about 24 fps in the editor, pretty nice.

The free .fga vector fields work fine with PopcornFX

Be advised the scale of the vector fields in this pack should be around .01 or so. If your vector field appears odd, try tweaking the overall scale and magnitude of the fields. The orientation of the vector fields may also need to be adjusted, -90 on the x axis should do it. 

PKFX has a very nice vector field visualizer, but some fiddling around is probably going to be needed since each one of these vector fields was built for other purposes and on a different platform.

Once you get dialed in, however, these .fga vector fields are great.

NPR Final Touches

All the bells and whistles – Ambient Occlusion, Depth fading, Image Adjustment, etc. Highlights can now be dialated or eroded. Support for separate outlines of normals. Presets and clean menus. I think this shader is about done.

The shader allows for a pretty broad array of looks, from architectural sketches to classic toon shading. Below is an example of a more painterly rendering.