Skip to main content
GameDev.net gamedev.net
🔒 Locked

NV_float_buffer problem

Started by Leo_E_49 Apr 11, 2007 at 3:55 PM 0 replies 1k views
Original Post
Leo_E_49
Leo_E_49
This is a separate topic from my other query so I thought I should put it in a separate thread. I'm having problems using NV_float_buffer. When I use it to render a texture, it turns completely white, although I've checked and the GL_NV_float_buffer extension is supported by my hardware. Any ideas what the problem could be?

int IEGLGenerateRectTexture(	GLint nTextureID,
				GLint nTextureWidth,
				GLint nTextureHeight,
				GLubyte *pTexture,
				unsigned int nTextureMode )
{
	if( ex_bSupportRectangleTextures )
	{
		glBindTexture( GL_TEXTURE_RECTANGLE_ARB, nTextureID );
		
		if( ex_bSupportFloatingPointBuffers )
		{
			glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
		}
		else
		{
			glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
		}

		glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP );
		glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP );

		glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
		glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST );

		if( ex_bSupportFloatingPointBuffers )
		{
			glTexImage2D( GL_TEXTURE_RECTANGLE_ARB, 0, GL_FLOAT_RGBA32_NV, nTextureWidth, nTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, pTexture );
		}
		else
		{
			glTexImage2D( GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, nTextureWidth, nTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, pTexture );
		}	
		
		return 0;
	}

	return IEGLGenerate2DTexture(	nTextureID,
					nTextureWidth,
					nTextureHeight,
					pTexture,
					nTextureMode );
}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.