glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, Width, Height, 0, GL_RGBA, GL_FLOAT, NULL);
Any ideas what could be causing this? Even though I don't think it's enabled could it be something to do with the stencil buffer maybe?
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, Width, Height, 0, GL_RGBA, GL_FLOAT, NULL);
When I create a texture using GL_RGBA16F and bind it to my frame buffer it appears as though the polygons are semi transparent to each other when I render my scene to it. Here is how I create the texture:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, Width, Height, 0, GL_RGBA, GL_FLOAT, NULL);
Any ideas what could be causing this? Even though I don't think it's enabled could it be something to do with the stencil buffer maybe?
[quote name='SteveDeFacto' timestamp='1313218284' post='4848534']When I create a texture using GL_RGBA16F and bind it to my frame buffer it appears as though the polygons are semi transparent to each other when I render my scene to it. Here is how I create the texture:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, Width, Height, 0, GL_RGBA, GL_FLOAT, NULL);
Any ideas what could be causing this? Even though I don't think it's enabled could it be something to do with the stencil buffer maybe?
Out.color = max(float4(0.0, 0.0, 0.0, 1.0), Out.color);
glGenFramebuffers(1, &rendertarget->frameBuffer);
glBindFramebuffer(GL_FRAMEBUFFER, rendertarget->frameBuffer);
glGenRenderbuffers(1, &rendertarget->depthBuffer);
glBindRenderbuffer(GL_RENDERBUFFER, rendertarget->depthBuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, WindowRect.right - WindowRect.left, WindowRect.bottom - WindowRect.top);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rendertarget->depthBuffer);
glGenTextures(1, &rendertarget->BaseTexture);
glBindTexture(GL_TEXTURE_2D, rendertarget->BaseTexture);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, WindowRect.right - WindowRect.left, WindowRect.bottom - WindowRect.top, 0, GL_RGBA, GL_FLOAT, NULL);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rendertarget->BaseTexture, 0);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if(status != GL_FRAMEBUFFER_COMPLETE)
{
OutputDebugString( L"Unable to create frame buffer" );
}
Code I'm using to initialize the frame buffer and texture:
snip
[quote name='SteveDeFacto' timestamp='1313223994' post='4848551']
Code I'm using to initialize the frame buffer and texture:
snip