Browse Source

Added support AuxFloat in add_render_texture

Bei Yang 15 years ago
parent
commit
cec641bea1
1 changed files with 12 additions and 3 deletions
  1. 12 3
      panda/src/display/graphicsOutput.cxx

+ 12 - 3
panda/src/display/graphicsOutput.cxx

@@ -344,9 +344,18 @@ add_render_texture(Texture *tex, RenderTextureMode mode,
               (plane == RTP_aux_hrgba_3)) {
               (plane == RTP_aux_hrgba_3)) {
     tex->set_format(Texture::F_rgba16);
     tex->set_format(Texture::F_rgba16);
     tex->set_match_framebuffer_format(true);
     tex->set_match_framebuffer_format(true);
-  } else
-
-  {
+  } else if ((plane == RTP_aux_float_0)||
+              (plane == RTP_aux_float_1)||
+              (plane == RTP_aux_float_2)||
+              (plane == RTP_aux_float_3)) {
+	//defaults to rgba16 unless rgba32 is set. Since many older hardware doesn't
+	//support 32 or filtering on 32
+	tex->set_component_type(Texture::T_float);
+	if( tex->get_format() != Texture::F_rgba32 ){
+	  tex->set_format(Texture::F_rgba16);
+	}
+    tex->set_match_framebuffer_format(true);
+  } else {
     display_cat.error() <<
     display_cat.error() <<
       "add_render_texture: invalid bitplane specified.\n";
       "add_render_texture: invalid bitplane specified.\n";
     return;
     return;