Pedro Leite

words – an empty shell, a lack of meaning

OpenStereo Release 1.0.0

Again, I’m releasing OpenStereo. But today is a different day. I’ve done the first commit to OpenStereo google code site :D
And the best part: OpenStereo now features autotools support! Hooray!

Now, it’s only a matter of:
svn copy \ \
-m "OpenStereo release 1.0.0."

And voilá, a tag was created! :D
Also, uploading the tar.gz resulted from make distcheck

This release contains only official support for Linux. Support for Windows will come in sequence.


January 3, 2008 Posted by | development, google, linux, me, open source, openstereo, release, windows | 2 Comments

Something is wrong…

My OpenStereo CUDA plugin did not directly benefit from a huge performance improve. Worst, with a 512×512 texture, his best fps rate was around 20, when compiled in release mode, running over a GeForce 8800 GTX. Even the one that uses shaders and Render-To-Texture have outperformed the CUDA plugin (around 300fps in a GeForce 7900 GTX!!!).

Perhaps that implementation isn’t the best one… I think that memory access could be improved, by using shared memory, but this is something to analyze.

October 31, 2007 Posted by | cuda, development, master degree, nvidia, opengl, openstereo | Leave a comment

OpenStereo Plugin using CUDA

Of course I wouldn’t let OpenStereo apart from my CUDA studies. I’ve implemented an OpenStereo plugin that uses CUDA to do the fusion process. Below is the preliminary kernel code:

#include <stdlib.h>
#include <stdio.h>
#include <math.h>

#define BLOCK_SIZE 16

__global__ void fuse_images(float* left_tex, float* right_tex, float* stereo_tex,
float* matrix_left, float* matrix_right, int width, int height) {
int ix = __mul24(blockIdx.x, BLOCK_SIZE) + threadIdx.x;
int iy = __mul24(blockIdx.y, BLOCK_SIZE) + threadIdx.y;
int i = 0, j = 0, k = 0;
float c = 0.0f;

if (ix >= width || iy >= height)

// rows
for (; i < 3; i++) {
// columns
k = (ix + __mul24(iy, width)) * 3;
for (j = 0; j < 3; j++) {
c += matrix_left[j + __mul24(3, i)] * left_tex[k + j];
c += matrix_right[j + __mul24(3, i)] * right_tex[k + j];
stereo_tex[k + i] = c;
c = 0.0f;

That function runs on the device (GPU) while the host side does the OpenGL stuff, besides calling the kernel code. A call to that function is done this way:

// executes the kernel
fuse_images<<< grid, threads >>>(cuda_left_tex, cuda_right_tex, cuda_stereo_tex,
getCudaMatrixFromMethod(method, isLeft), getCudaMatrixFromMethod(method, !isLeft), width, height);

I need to test this plugin in a CUDA device, since its emulation is working almost perfectly.
P.S.: Yeah, posting source code in wordpress sucks =/

October 30, 2007 Posted by | cuda, development, open source, opengl, openstereo, stereoscopy | 1 Comment

GLUCo Window Manager

By this time I am committing an initial working on linux (I didn’t try to compile it on Windows yet) code of the window manager. It contains some bugs that I’ll try to fix later. But at least you can have the feeling of multiple windows!

You can grab the source code at the GLUCo repository here.

July 28, 2007 Posted by | development, gluco, linux, open source, opengl | Leave a comment

GLUCo Progress

So, I already started to work on GLUCo and I’m getting things pretty well defined. I’m using old ideas of mine to make a window manager over glut, where the developer can create as many windows he/she needs. To write such manager, I’ll use the Glib library for data types an algorithms. Of course I won’t use the full support that Glib can give, so I am thinking whether use Glib is or is not a good idea. The immediate impact could be: C++ applications don’t need Glib for algorithms, since they have STL. Anyway, I’ll use Glib and later decide its fate.

July 27, 2007 Posted by | development, gluco, linux, opengl, portable, windows | Leave a comment

GLUCo Project

I know that NeHe provides a interface to picture loading or even a GLaux replacement. Also a simple base code or a more complete one (currently in beta). But they’re not so portable, so you need to adjust the code to fit your platform. With this problems in mind, I just realized that I could write a simple base code, unifying the development for Windows and Linux (I currently don’t have an MacOS). I pretend to use multi-platform libraries such as DevIL (a.k.a. OpenIL) to image loading, freeglut for windowing and keyboard/mouse input, and OpenGL for graphics, of course. This means another open source project of my own is emerging on the road: GLUCo (OpenGL Unified Code).

Consequently, the porting marathon will be “interrupted” (well, I’ll use GLUCo to continue the marathon in a more cleaner and portable way) to favor this simple-yet-powerful base code. Oh and I almost forgot, GLUCo will be written in C, so C and C++ applications can easily integrate it.

July 26, 2007 Posted by | development, gluco, linux, nehe, open source, opengl, windows | Leave a comment

NeHe’s Lessons

Suddenly this will of port every single lesson at NeHe’s site to OpenStereo (compiling under Linux and Windows) took me. Comparing the results obtained against the original ones can lead me to fix some undiscovered bugs in OpenStereo. So, let the porting marathon begin!

P.S.: Obviously, I’ll contact the team to release the ported source code.

July 26, 2007 Posted by | development, linux, nehe, open source, opengl, openstereo, stereoscopy, windows | Leave a comment