diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index 46b051cde0..4d8a1e27a1 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -275,12 +275,21 @@ add_render_texture(Texture *tex, RenderTextureMode mode, // Choose a default bitplane. if (plane == RTP_COUNT) { - if (tex->get_format() == Texture::F_depth_stencil) { + switch (tex->get_format()) { + case Texture::F_depth_stencil: plane = RTP_depth_stencil; - } else if (tex->get_format() == Texture::F_depth_component) { + break; + + case Texture::F_depth_component: + case Texture::F_depth_component16: + case Texture::F_depth_component24: + case Texture::F_depth_component32: plane = RTP_depth; - } else { + break; + + default: plane = RTP_color; + break; } } diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 45450ae98d..dce9cc7d89 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -6455,6 +6455,18 @@ framebuffer_copy_to_ram(Texture *tex, int view, int z, } break; + case Texture::F_depth_component16: + component_type = Texture::T_unsigned_short; + break; + + case Texture::F_depth_component24: + component_type = Texture::T_unsigned_int; + break; + + case Texture::F_depth_component32: + component_type = Texture::T_float; + break; + default: if (_current_properties->get_srgb_color()) { if (_current_properties->get_alpha_bits()) {