Monday, February 16, 2009

Smoothed Particle Hydrodynamics on the GPU

I've been working together with Neil Osbourne on a GPU version of my SPH code. He tried a number of things and managed to get a significant speedup. He presented his results at the iVEC eResearch Forum 2009. Main lessons learnt were to keep the number of CUDA threads approx equal to the number of hardware processors, not to do memory optimizations too early on, and ofcourse, to do shared memory optimizations later on.

Never managed to get a hashed grid going within the time we had, but it was still a cool project. With a bit more effort it should find it's way into PAL or Bullet.

Saturday, February 14, 2009

New stuff

So I finially get my internet access back after loosing it for almost a week. Yay.

Did a quick look around to see whats new online, there is a "next-gen" open source COLLADA import/export plug in being developed for MAX and Maya . Sony is involved in the development again.

Whilst on the topic of Sony, apparently Intel is developing the next GPU for the PS4, so no doubt this will be larrabee based. Intel seems to be driving this hard, and since they have about 40% of the GPU market this could get interesting. Especially now that nVidia is picking up x86 engineers as well apparently. So perhaps the new GPU standard will be x86 based GPU's similar to Larabee. AMD/ATI, Intel already have the know-how and nVidia seem to be acquiring it. Why anyone wants to do this is still beyond me.. x86 is cluttered enough as it is...

Monday, February 09, 2009

Blender Physics Links

More on links..

you might want to make things look nicer, or at least have something to indicate the difference between convex/meshed objects and 'physics objects', you can make things look nice by applying a material, and going into the edit mode (after, view,select,object) you should see a mode selector. Then select mesh->faces->set smooth. Press ctrl-alt-numpad0 to realign a camera for rendering. Set the background color in the shading section in the materials mode. F12 to render, F3 to save the render.

You can set link's pivots and axis's. A hinge rotates about its own X axis. The Axyz are set in degrees.

Using generic constrains is a bit funny, if you want a constraint to be active, you need to click on it. (eg LinMinX) and that will stop it from allowing movement (if min and max == 0), otherwise type in the value you want to have constrainted.

For the time being, you can get a great chapter on blenders game physics here:
http://www.cs.brandeis.edu/~tim/Classes/Spr09/usem2c/readings/Ch6.pdf

Unfortunately the COLLADA constraints continue to be plauged by issues, you can't export them as individually enabled/disabled, and the only physics engine that supports the COLLADA link format is Bullet.

Forces/controllers don't export to COLLADA either, so that is all lost too. *sigh*

Blender

Blender has to be one of the hardest packages to use. I don't know why they defy convention and don't let you select objects by CLICKING ON THEM. Although recent versions fix this somewhat by defaulting to object-mode and letting you right click to select. *sigh*.

Using blender for physics is somewhat convenient due to how closely blender follows the physics&COLLADA conventions.

Beginer notes: hold MMB to rotate view, scroll to zoom, shift MMB to pan. on a selected object, "s" will scale, "r" will rotate. ALT-r will clear rotation. translate things by clicking on the relevant axis.
(You can press 'N' to get the transform properties and type in locations. handy!)

To create a physical object, select it (object mode, right click ;)) , go to the logic pannel (F4) make it an dynamic actor, and rigid body.


To create the correct physics shape, select 'Bounds' and change to (eg: box/sphere/convex)

Press 'p' to preview. (ESC to exit the preview)

To add a material, swap to shading mode (F5)
In link to object, delete anything you might see (eg: MA.Material.001) and now you can create your own materials. In the material tab, press the DYN button so you can set friction and restitution.

(you may wish to create another object before trying links, eg: add->mesh->sphere)
To add a physics link or rigid body constraint switch to object mode (F7).
To create a link press the add constraint button and choose Rigid Body Constraint, then choose type (eg: Ball) and which object you are connecting to (eg: "toObject:Cube"). P to preview your swinging cube!


Some tutorial links:
getting started with blender physics & COLLADA.
some info on controllers and physics materials
basics of controllers
global/local forces and more on controllers

Game hardware stats

It's always usefull to know the hardware stats of the big wide world for your next game.
The steam survey is usefull for top-end or "hard-core" "gamer" PC's
Whereas the unity stats tell you more about the casual market.

I'm suprised that so many people have DX10 capable GPU's.

Thursday, February 05, 2009

Global Game Jam

The global game jam was on the weekend, and I spent the days there making a game Zeppelin Escape.
There isn't much time in 48 hours, and we were learning Unity, and trying to avoid the beta bugs, so it was an interesting experience. We couldn't figure out how to get Unity's collision code going so I wrote it again from scratch, as well as doing the "AI" for the enemies, movement system, and 'designing' level 2 & 3.

There were about 25 people there and all round a great time was had. Highly recommended.

Wednesday, January 28, 2009

First post in 3 or so years

I had a talk with Simon Wittber the other day, and he convinced me to start a blog. Then I remembered I already have one, and managed to recover the account and password. Hurrah.

I'll probably try and back-blog many of the things that have happened since I left for TUM, I've been there and back, and also at UniBW and ECU, now Transmin. Worked on great projects involving autonomous vehicles in the grand challenge and robot manipulators in space and augemented environments in germany. Back home, I've been working on genetic algorithms, physics simulations, automotive simulators, fluid dynamics, CUDA and GPU's, computer vision, immersive training simulators, cryptography, and 20 meter robots. Fun! (Oh yeah, and the thesis. *sigh*)

The reason I wanted to post was to collect some thoughts on an Eulerian based fluid simulation I'm currently working on (2d) for PAL.

Found a great link that explains Euluers equations:
http://galileo.phys.virginia.edu/classes/311/notes/fluids1/fluids11/node10.html

I'm basically following an algmated approach based from buoyancy equations and shallow wave equations.
Reference material:
  • Physics Based Animation (Kenny Erleben's book) (which gave me the idea of trying simple wave equations)
  • Fast Water Animation Using the Wave Equation with Damping by Y. Nishidate and G. P. Nikishkov (which is actually just an 'academicerized' version of the standard water drop demo effect of the mid 90's, and Jeff Lander's implementation thereof (good website btw)
  • Stable Fluids by Jos Stam (just for reference/background material)
    and
  • Hardware Accelerated Real-Time Fluid Surface Simulation by Hellstrandh and Bystrom. (for how to apply the water changes coupled to rigid bodies, a nice diagram in there)

    My approach is just the good old 2d ripple effect with buoyancy coloums by raycasting the surface of rigid bodies.. anyway more on that some other time.

    I hope to blog more regularly now. :)

    Global game jam soon.
  •