Edge blending - adding textures directly in the SPU

"Ken Falco" <[email protected]> Tue, 27 Mar 2007 01:16:33 +0200
Newsgroups gmane.comp.graphics.chromium.devel
Message-ID <000901c76ffc$cbd67620$1f00000a@utente33a473d2>
Hi everybody,
I am trying to make a 3 projectors wall screen and I found, if I am not
wrong, that the overlap_blending and overlap_levels  parameter of the
server are not good enough. They offer only one different value of
intensity between two tiles, not a smooth and linear relative
degradation. My idea is to add a smooth trasparent texture in the
overlap region directly in the render SPU.

First I added these lines in the function renderspu_SystemSwapBuffers(
WindowInfo *w, GLint flags ) in renderspu_glx.c:

	render_spu.self.Color3f(1, 1, 1);
	render_spu.self.Begin(GL_LINE_LOOP);
	render_spu.self.Vertex2i(0, 0);
	render_spu.self.Vertex2i(200, 200);
	render_spu.self.Vertex2i(400, 0);
	render_spu.self.Vertex2i(1, 1);
	render_spu.self.End();

It works, and it's easy, via some costum parameter or the
render_spu.window_title to switch between the displays.

Ok with lines, but with texture, I was not able.


After reading the "NeHe's OpenGL Tutorial Lesson 08"
(http://nehe.gamedev.net) I have added:

	GLuint texture[3]; 

to the top of the file and 2 functions: renderspu_loadBMP and
renderspu_loadGLTextures thas is:

	Bool renderspu_loadGLTextures(void)   
	{
	
    	GLboolean status;
	textureImage *texti;
    
    	status = 0;
     
    	texti = (textureImage *) malloc(sizeof(textureImage));


	if (renderspu_loadBMP("glass.bmp", texti))
    	{
        	status = 1;
        	render_spu.self.GenTextures(3, &texture[0]);
		render_spu.self.BindTexture(GL_TEXTURE_2D, texture[0]);
		render_spu.self.TexImage2D(GL_TEXTURE_2D, 0, 3,
texti->width, texti->height, 0,
            	GL_RGB, GL_UNSIGNED_BYTE, texti->data);

        ........... }
        }   

I call the renderspu_loadGLTextures function to generete the texture in
the set_borderless function in renderspu_config.c.

When I start Chromium , it reports a segmentation fault error just
before the call to the render_spu.self.GenTextures(3, &texture[0])
line. Using debug mode, the debugger can't go inside this function, as
if it's empty and it reports immediately the crash.

Hoping this issue is useful for many others Chromium users, I thank you
everybody for the help,

Mike


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV