mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
filter: Fix issue with cached CullResult persisting after cleanup
This can cause issues if a DR gets assigned an inactive camera - the old cull result will persist and be used for draw. Possibly we need to do this in set_camera. Reproduced by #1166
This commit is contained in:
parent
ea45ff691d
commit
1f84469cd9
@ -366,6 +366,8 @@ class FilterManager(DirectObject):
|
||||
self.camstate = self.caminit
|
||||
self.camera.node().setInitialState(self.caminit)
|
||||
self.region.setCamera(self.camera)
|
||||
if hasattr(self.region, 'clearCullResult'):
|
||||
self.region.clearCullResult()
|
||||
self.nextsort = self.win.getSort() - 1000
|
||||
self.basex = 0
|
||||
self.basey = 0
|
||||
|
@ -514,6 +514,15 @@ get_screenshot() {
|
||||
return tex;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void DisplayRegion::
|
||||
clear_cull_result() {
|
||||
CDCullWriter cdata_cull(_cycler_cull, true);
|
||||
cdata_cull->_cull_result = nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a special scene graph constructed to represent the results of the
|
||||
* last frame's cull operation.
|
||||
|
@ -160,6 +160,7 @@ PUBLISHED:
|
||||
bool get_screenshot(PNMImage &image);
|
||||
PT(Texture) get_screenshot();
|
||||
|
||||
void clear_cull_result();
|
||||
virtual PT(PandaNode) make_cull_result_graph();
|
||||
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user