OpenCL – the battle, part III
The first two parts described hardware-companies and operating systems, programming languages and software-companies, written about half a year ago. Now we focus on what has driven NVIDIA and ATI/AMD for decades: games.
Disclaimer: this is an opinion-piece on the current market. We are strong supporters of OpenCL and all companies which support it too. Since our advise on specific hardware in a consult will be based on specific demands on the customer, we could advise differently than would be expected on the below article.
Computer games are cool; merely because you choose from so many different kinds. While Tetris will live forever, the latest games also have something to add: realistic physics simulation. And that’s what’s done by GPUs now. Nintendo has shown us that gameplay and good interaction are far more important than video-quality. The wow-factor for photo-realistic real-time rendering is not as it was years ago.
You might know the basics for falling objects: F = m*g (Force = Mass times Gravity-acceleration), and action = – reaction. If you drop some boxes, you can predict falling speed, interaction, rotation and possible change of centre of gravity from a still image as a human being. A computer has to do a lot more to detect collision, but the idea is very doable on a fast CPU. A very well-known open source library for these purposes is Bullet Physics. The nice thing comes, when there is more than just a few boxes, but thousands of them. Or when you walk through water or under a waterfall, see fire and smoke, break wood but bend metal, etc. The accelerometer of the iPod was a game-changer too in the demand for more realism in graphics. For an example of a “physics puzzle game” not using GPGPU see World of Goo (with free demo) – for the rest we talk more about high-end games. Of current game-ready systems PCs (Apple, Linux and Windows) have OpenCL support, Sony PlayStation 3 is now somewhat vague and the Xbox 360 has none.
The picture is from Crysis 3, which does not use OpenCL, as we know it.
What happened until now?
Currently the large game-developer studios are very interested in all techniques that can speed up development in game-extras that would eventually increase sales as a result. Electronic Arts and Activision-Blizzard are members of Khronos and active in the OpenCL group.
The market of games is a very important one for both NVIDIA and AMD, since gamers are willing to spend more money on high-end graphics cards. Now we have CUDA and OpenCL, the fight for the gamer continues. NVIDIA has bought the company behind PhysX, which accelerated physics calculations on special cards enormously, and adapted their technique to be used on NVIDIA cards. It brought them a unique point of sales and they mocked AMD in a funny way by bringing the news they were thinking about porting PhysX to OpenCL. They never did and everybody was aware you had to be with NVIDIA to have realistic situations in games. As a reaction AMD/ITI has started the Open Physics Initiative together with Pixelux end 2009, to pursue the creation of a complete and open OpenCL physics-engine. The last news about their progress was in march. The strange thing is that they had a physics-demo in 2006.
So where do we stand now?
I just show what is currently possible, but don’t explain the math behind it. If you want more information about the backgrounds, let me know and I can add some references. Under “liquids” there are two references which explain quite a bit more than you’ll see in the videos.
You might conclude that material properties of smoke, water, rubber, cloths, wood, concrete and metal seem to be a configuration on the same scales: adhesion (stickiness), cohesion (hardness, flexibility), breaking-point and weight. Still there are details for each material-simulation which covers for the years of research on them.
We talked about boring boxes, but below video shows primarily objects without the need to calculate rotation and need for more advanced collision-detection. In other words: points.
On the page of Pixelux you find movies on collisions. While you have the feeling they can get somewhat more realistic, it is more a matter on perfecting the material properties than the collision-model.
Another player in the field is Blender (proud to be Dutch), which now is working on their game-engine quite some time now.
Liquids & Smoke
Currently I have found implementations on OpenCL, but in CUDA there has been done quite some more research and the results are therefore better. So we just have to wait until the CUDA-code is translated to OpenCL. See below video, NVIDIA GPU Gems 1: “Chapter 38. Fast Fluid Dynamics Simulation on the GPU” and NVIDIA GPU Gems 3: “Chapter 30. Real-Time Simulation and Rendering of 3D Fluids”.
NVIDIA has some great demo on smoke:
While the basics are there (particles, cohesion, adhesion) I could find plugins for specific programs, but no OpenCL-implementation of smoke and liquids simulations in the open.
EIGIA has some demos on their PhysX-engine, which the below video is on of them. We can expect the same from the Open Physics Initiative, but we can know NVIDIA has these already.
In the following video, a tech demo of the Star Wars – The Force Unleashed, you see how it is used in a game. The technique is called “Digital Molecular Matter”, shortened to DMM and developed by Pixelux.
The first demo shown at several places was the OpenCL-cloth demo. It is the result of cooperating with Pixelux
You see it is quite realistic and they’ve advanced much. In the blog containing the Khronos OpenCL presentation, there is some nice background on cloths-calculations. There is said that optimising the kernel for specific hardware costs much time, so for the OpenCL implementation on NVIDIA there still has to be done a lot if they want a true open initiative. Think about this…
Other massive calculations
Not all is about falling, breaking and flowing. A natural feeling of the scene is also given by realistic imagery and actors.
ATI has shown they have in-house expertise on GPGPU-based AI.
More about this subject later in another blog-post.
Projection and ray-tracing
If there is one reason to keep developing faster GPUs then it’s real-time ray-tracing.
Blender can use LuxRender as a renderer, wich has now some GPU-support now. There is spoken of ray-traced gaming everywhere, but I’ve not seen it for real. Actually Intel has lots of demos of real-time ray tracing on a 8-core CPU, not GPU. NVIDIA has a products called OptiX, which is promising.
While possibilities seem to grow continuously, now that the graphics have reached a point an average desktop computer can produce them at such high qualities, also non-gamers find it awkward when we distinguish a pixel in full screen rendered animations on a 2010-pc. The good news is that with OpenCL games can be more fun for a low price and work on any graphics-card. The neutral news is that nothing changed: the game-developers make marginal profits and push the profits of NVIDIA and AMD. Obviously NVIDIA is the current winner by acquiring EIGIA; now most of the commercial products (and research projects) using physics simulation are focussing on the PhysX-engine and NVIDIA-products, leaving AMD in the dark:
Luckily AMD puts much effort in their Open Physics Initiative, but they need to hurry to stop more damage. And then market that product instead of waiting until it sells itself.
A side note: remember my claim OpenCL being the hidden power used in libraries? This is one fine example.