From 05fba9b3c83370f0034fa8cfc0695391bd29f4e5 Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Thu, 18 Sep 2008 01:05:45 +0000 Subject: [PATCH] Remove hard-coded texture format to allow different FBO formats. Use the internal format when creating FBOs to allow different FBO formats. --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 62eb2399b5..3b9f49007e 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -417,7 +417,7 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta } } } else { - tex->set_format(Texture::F_rgba); +// tex->set_format(Texture::F_rgba); TextureContext *tc = tex->prepare_now(glgsg->get_prepared_objects(), glgsg); nassertv(tc != (TextureContext *)NULL); CLP(TextureContext) *gtc = DCAST(CLP(TextureContext), tc); @@ -490,7 +490,10 @@ bind_slot(bool rb_resize, Texture **attach, RenderTexturePlane slot, GLenum atta GL_RENDERBUFFER_EXT, rb); } } else { - glgsg->_glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_RGBA8_EXT, + GLenum internal_format; + + internal_format = glgsg -> get_internal_image_format(tex); + glgsg->_glRenderbufferStorage(GL_RENDERBUFFER_EXT, internal_format, _rb_size_x, _rb_size_y); glgsg->_glBindRenderbuffer(GL_RENDERBUFFER_EXT, 0); glgsg->_glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, attachpoint,