Posts Tagged ‘cuda’

2010 visual experiments

January 7th, 2011

Happy new year everyone!

2010 was a year full of visual experiments for me, I hope that you like what you see on this blog. In this post I’m making a little overview of all visual experiments created by me during this year. This is an opportunity to catch-up something you’ve missed! I’d like also to thanks some person that have been helping me too:

Visual experiments created in 2010:

During this year I have added some features to Ogre3D:

  • ArToolKitPlus: augmented reality marker-based system
  • Cuda: for beginner only (at least advanced user could grab some useful code)
  • OpenCL: for beginner only (at least advanced user could grab some useful code)
  • Html5 Canvas: implementation based on skia for graphics and V8 for javascript scripting
  • Kinect: this is a very hacky solution, I’ll improve it later

I also have learned GPGPU programming by myself while coding a partial GPUSurf implementation based on Nico Cornelis paper. But this implementation is not complete and I’m willing to rewrite it with a GPGPU framework based on OpenGL and CG only (not Ogre3D). With such a framework writing Sift/Surf detector should be easier and more efficient.

I have created some visual experiments related to Augmented Reality:

My outdoor 3D tracking algorithm for augmented reality needs an accurate point cloud: this is why I’m interested in structure from motion and I’ve created two SfM toolkit:

Posts published in 2010:

Share

Ogre::OpenCL and Ogre::Canvas

May 9th, 2010

This is a short post to show stuff I’m working on. After announcing Ogre::Cuda to the Ogre Community I have realized that OpenCL could interest more people… Although I never get a chance to play with OpenCL I have created another library very similar to Ogre::Cuda but this time for OpenCL. Ogre::OpenCL is still in a very experimental stage but you can grab it from my google code or get more information from the demo page. I’m also wondering if I could create another library that would help GPGPU in Ogre3D. Indeed GPGPU computation is not that easy to setup, you have to :

  • create RenderTarget texture
  • desactivate auto update on the render target
  • add a viewport with a camera
  • add a compositor to the viewport
  • add a listener to the compositor (optional)
  • manualy call update() to do the computation

That’s why I was thinking in creating a library to do all this things in a more user friendly manner, will see …

I also have decided to anounce Ogre::Canvas. This is my Html5 canvas API implementation for Ogre3D. In short, you get a Canvas context on which you can call standard 2D functions (lineTo, moveTo, fill, stroke, …) and once you want an update, the Canvas context is uploaded to an Ogre::Texture. Furthermore, I have implemented a Javascript binding using V8 that is identical to the Html5 Canvas specification. So the same javascript code used in browser can be executed by Ogre::Canvas (with minor tweaks). You’ll get more information on the demo page.

And I have finally managed to translate my resume in English.

Share

Cuda integration with Ogre3D

April 26th, 2010

If you already start to play with Cuda you know that graphic interop is not an easy task. Indeed you need to register graphic ressources using different methods accordings to the Ogre::RenderSytem (DX9, DX10, GL). As Ogre3D main objective is to hide DirectX and OpenGL “specificities”,  I have decided to create a tiny lib for Ogre3D to help registering and mapping ressources for Cuda. This tiny lib, named Ogre::Cuda, helps registering Ogre::Texture and Ogre::HardwareVertexBuffer for Cuda.

This video is just a very basic example showing an integration of two Cuda samples inside Ogre3D. The vertex buffer and the 2D texture cuda kernels are part of the Nvidia GPU Computing SDK.

This library is in beta stage, there is still room for improvement, but the base are settled for a cross-platform and cross-graphics API way to use Cuda thanks to Ogre3D.

Source code and binary demo available on the demo page.

Utilisation example :

Ogre::TexturePtr texture;
Ogre::Cuda::Root* mCudaRoot = Ogre::Cuda::Root::createRoot(renderWindow, renderSystem);
mCudaRoot->init();
Ogre::Cuda::Texture* mCudaTex;
mCudaTex = mCudaRoot->getTextureManager()->createTexture(texture);
//init
mCudaTex->registerForCudaUse();
//on each Cuda update
mCudaTex->map();
Ogre::Cuda::TextureDeviceHandle textureHandle;
textureHandle = mCudaTex->getDeviceHandle(0, 0);
cudaFunction(textureHandle->getPointer());
mCudaTex->update(textureHandle); //reflect changes to the Ogre::Texture
mCudaTex->unmap();
//shutdown
mCudaTex->unregister();
mCudaRoot->shutdown();
Share