diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index 529a053d00..1f97ade9e7 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -359,6 +359,12 @@ add_render_texture(Texture *tex, RenderTextureMode mode, // If we're still planning on binding, indicate it in texture properly. tex->set_render_to_texture(true); } + else if ((plane == RTP_depth || plane == RTP_depth_stencil) && _fb_properties.get_depth_bits() == 0) { + // If we're not providing the depth buffer, we need something to copy from. + display_cat.error() + << "add_render_texture: can't copy depth from framebuffer without depth bits!\n"; + return; + } CDWriter cdata(_cycler, true); RenderTexture result;