diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 040e71ea8d..28297ba464 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -8303,6 +8303,10 @@ make_shadow_buffer(LightLensNode *light, Texture *tex, GraphicsOutput *host) { flags |= GraphicsPipe::BF_size_square; } + if (host != nullptr) { + host = host->get_host(); + } + CLP(GraphicsBuffer) *sbuffer = new CLP(GraphicsBuffer)(get_engine(), get_pipe(), light->get_name(), fbp, props, flags, this, host); sbuffer->add_render_texture(tex, GraphicsOutput::RTM_bind_or_copy, GraphicsOutput::RTP_depth); get_engine()->add_window(sbuffer, light->get_shadow_buffer_sort());