Hello, I’ve a problem with setCartoonInk on OSX. I’ve a MacMini (the graphic card is a nVidia 9400M).
When I run the cartoon example provided with Panda, sometimes I get the correct visualization (number 1), but sometimes (yes, sometimes, it happens apparently randomly) I get the visualization number 2 (I report both for comparison):
These are the logs:
(1: the execution that works)
DirectStart: Starting the game.
Known pipe types:
osxGraphicsPipe
(all display modules loaded.)
Thu Jul 15 19:34:26 Mac-mini-di-.local ppython[203] <Error>: kCGErrorIllegalArgument: CGSCopyRegion : Null pointer
Thu Jul 15 19:34:26 Mac-mini-di-.local ppython[203] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Thu Jul 15 19:34:49 Mac-mini-di-.local ppython[203] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 25
Thu Jul 15 19:34:49 Mac-mini-di-.local ppython[203] <Error>: kCGErrorIllegalArgument: CGSRemoveSurface: Invalid window 0x19
(2: the execution that doesn’t work)
DirectStart: Starting the game.
Known pipe types:
osxGraphicsPipe
(all display modules loaded.)
Thu Jul 15 19:33:46 Mac-mini-di-.local ppython[197] <Error>: kCGErrorIllegalArgument: CGSCopyRegion : Null pointer
Thu Jul 15 19:33:46 Mac-mini-di-.local ppython[197] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
:display:gsg:glgsg(error): Could not load Cg fragment program:created-shader (arbfp1 Error on line 2: unrecognised option (hint: 'ATI_draw_buffers'))
:display:gsg:glgsg(error): at 384 of panda/src/glstuff/glShaderContext_src.cxx : GL error 1282
Thu Jul 15 19:34:24 Mac-mini-di-.local ppython[197] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 18
Thu Jul 15 19:34:24 Mac-mini-di-.local ppython[197] <Error>: kCGErrorIllegalArgument: CGSRemoveSurface: Invalid window 0x12
I tried to make the problem reproducible (really the process was the reverse: I saw the problem in my application, and trying to isolate it I fell in the example problem), and I built an example that reproduce the problem with more likelihood (with the cartoon example it happens rarely, but with the following it happens almost at every execution). The problem seems related: it produces same error messages and it happens only with setCartoonInk.
I have this program (here the files needed):
def setupCartoonInk():
from direct.filter.CommonFilters import CommonFilters
if CommonFilters( base.win, base.cam ).setCartoonInk( separation = 1 ) == False:
print( 'Video card not powerful enough to do image postprocessing.' )
def setupCubes():
from panda3d.core import TextureStage
for i in range( 5 ):
for j in range( 5 ):
box = loader.loadModel( 'cube' )
box.setPos( i * 2.5, j * 2.5, 0 )
box.reparentTo( render )
box.setShaderAuto()
ts = TextureStage( 'ts' )
box.setTexture( ts, loader.loadTexture( 'texture.jpg' ) )
def setAmbientLight():
from pandac.PandaModules import AmbientLight
alight = AmbientLight( 'alight' )
alight.setColor( ( .7, .7, .7, 1 ) )
render.setLight( render.attachNewNode( alight ) )
import direct.directbase.DirectStart
base.camera.setPos( 5, -8, 18 )
base.camera.lookAt( 5, 4, 0 )
base.disableMouse()
setupCartoonInk()
setupCubes()
setAmbientLight()
run()
In Windows and Linux (both tested), every time I launch it I obtain this (expected) behaviour.
But, when I run on Mac, I obtain a different behaviour at every execution. These are three consecutive executions:
As you can see, I obtain (pseudorandomly) some black cubes. This is the log of the last execution:
DirectStart: Starting the game.
Known pipe types:
osxGraphicsPipe
(all display modules loaded.)
Thu Jul 15 19:05:37 Mac-mini-di-.local ppython[802] <Error>: kCGErrorIllegalArgument: CGSCopyRegion : Null pointer
Thu Jul 15 19:05:37 Mac-mini-di-.local ppython[802] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
:display:gsg:glgsg(error): Could not load Cg fragment program:created-shader (arbfp1 Error on line 2: unrecognised option (hint: 'ATI_draw_buffers'))
:display:gsg:glgsg(error): at 384 of panda/src/glstuff/glShaderContext_src.cxx : GL error 1282
:display:gsg:glgsg(error): Could not load Cg fragment program:created-shader (arbfp1 Error on line 2: unrecognised option (hint: 'ATI_draw_buffers'))
:display:gsg:glgsg(error): at 384 of panda/src/glstuff/glShaderContext_src.cxx : GL error 1282
How can I get rid off these black cubes? Very thanks!