Hello,
I’m trying to implement a glow effect based on the basic glow effect tutorial. Here’s what I’m getting:
StandardError: Could not find appropriate DisplayRegion to filter.
Here’s the code that causes this error:
def highlightActor(self,actor):
if (base.win.getGsg().getSupportsBasicShaders() == 0):
print "Video driver reports that shaders are not supported."
return
filters = CommonFilters(base.win, base.camera)
filters.setBloom(blend=(0,0,0,1), desat=-0.5, intensity=3.0, size="small")
The error is launched from FilterManager.py (C:\Panda3D-1.6.0\direct\src\filter\FilterManager.py):
class FilterManager(DirectObject):
def __init__(self, win, cam, forcex=0, forcey=0):
""" The FilterManager constructor requires you to provide
a window which is rendering a scene, and the camera which is
used by that window to render the scene. These are henceforth
called the 'original window' and the 'original camera.' """
...
...
region = None
for i in range(win.getNumDisplayRegions()):
dr = win.getDisplayRegion(i)
drcam = dr.getCamera()
if (drcam == cam): region=dr
if (region == None):
self.notify.error('Could not find appropriate DisplayRegion to filter')
return False
From what I read in that file, the camera must be used in that window.
Hence I checked my code, and I’m using another camera:
######################################################
# This world uses the default camera base.camera or camera as it is aliased
# In order to get object picking we have to use this other camera.
#
######################################################
self.camera = base.makeCamera(base.win)
self.camera.node().copyLens(base.cam.node().getLens())
self.camera.node().setActive(0)
self.camera.reparentTo(self.headNodeOfWorld)
However, using this camera isn’t working either.
Any ideas? Thanks for helping!!!