As a technical artist, I have worked with Maxscript for a while now and it has been an awesome way to automate repetitive and complex tasks in order to increase the productivity of 3d artists by keeping them focused in the important things. Technical artists make huge effort to keep artists away from boring technical aspects of a production.
However, while Maxscript is quick to learn and to create tools, its use is not suitable for the kind of job that needs high performance and complex calculations. If something like real time mesh deformer is what you need, 3d Max provides you with its lower level software development kit (SDK).
And this is what I wanted to get into to expand my capabilities in the tech art field. Although I have been working with games for a while, the experiments I have been doing with 3d Max SDK are definitely more suitable for VFX on movies production.
Continuing with my first experiments with 3d Max SDK, in this post I will show some of my progress and publish some more details behind my plugin to be. Please have a look at the following video which contains a compilation of my progress.
Low performance with high poly meshes was one of the problems I faced when creating my CPU version of the plugin. At that point I thought of using fancier octree algorithms to reduce the plugin computation time or caching the mesh deformation but, very curious I am, I chose going another way instead. I decided to use the code I had at that point and try to adapt it to use the power of GPU processing.
For that I worked with OpenCL framework – ATI version of Nvidia Cuda – which demands you to know about video cards architecture. Basically, the advantage of using GPU against CPU is that GPUs have dozens of stream processors – 1120 in my video card case, an ATI 6870 – while CPUs’ standard is something around 1, 2, 4 or 8*. Using all these computing units is not so trivial. It is needed to manage the parallelization of jobs sent to the GPU.
The OpenCL framework only gives support for basic computations though and things like ‘ray intersect mesh’ functions given for free in the 3d Max SDK had to be written in OpenCL (C like) language**.
In the video above I present the result of my experiment where my plugin runs 10x faster in the GPU with higher poly meshes. The greater the number of computations to be made, the greater the difference becomes.