BUG in saveCubeMap (1.5.0 and 1.5.1)

this is the bug:

base.saveCubeMap(‘test1#.png’)

yet saveSphereMap works … hmm i thought they used smiler methods.

error:

DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
:util(warning): Adjusting global clock's real time by 0.073521 seconds.
:util(warning): Adjusting global clock's real time by -0.507533 seconds.
Assertion failed: z < tex->get_z_size() at line 3619 of panda/src/glstuff/glGraphicsStateGuardian_src.cxx
Assertion failed: z < tex->get_z_size() at line 3619 of panda/src/glstuff/glGraphicsStateGuardian_src.cxx
Assertion failed: z < tex->get_z_size() at line 3619 of panda/src/glstuff/glGraphicsStateGuardian_src.cxx
Assertion failed: z < tex->get_z_size() at line 3619 of panda/src/glstuff/glGraphicsStateGuardian_src.cxx
Assertion failed: z < tex->get_z_size() at line 3619 of panda/src/glstuff/glGraphicsStateGuardian_src.cxx
Traceback (most recent call last):
  File "/p/pandaProjects/newbg/newbg.py", line 20, in <module>
    run()
  File "linuxroot/usr/share/panda3d/direct/src/showbase/ShowBase.py", line 2262, in run
  File "linuxroot/usr/share/panda3d/direct/src/task/Task.py", line 939, in run
  File "linuxroot/usr/share/panda3d/direct/src/task/Task.py", line 877, in step
  File "linuxroot/usr/share/panda3d/direct/src/task/Task.py", line 776, in __stepThroughList
  File "linuxroot/usr/share/panda3d/direct/src/task/Task.py", line 696, in __executeTask
  File "linuxroot/usr/share/panda3d/direct/src/showbase/EventManager.py", line 59, in eventLoopTask
  File "linuxroot/usr/share/panda3d/direct/src/showbase/EventManager.py", line 53, in doEvents
  File "linuxroot/usr/share/panda3d/direct/src/showbase/EventManager.py", line 119, in processEvent
  File "linuxroot/usr/share/panda3d/direct/src/showbase/Messenger.py", line 240, in send
  File "/p/pandaProjects/newbg/newbg.py", line 18, in <lambda>
    base.accept( 'space', lambda : base.saveCubeMap('test1#.png',size=1024))
  File "linuxroot/usr/share/panda3d/direct/src/showbase/ShowBase.py", line 1994, in saveCubeMap
AssertionError: z < tex->get_z_size() at line 3619 of panda/src/glstuff/glGraphicsStateGuardian_src.cxx

Cubemaps don’t work very well post-v1.4.2

They seem to specifically have problems if the shader generator is active in your script.

Josh said he’d get around to fixing it sometime but I’m pretty sure it hasn’t been fixed yet.

No i don’t have shader gen on… and I really need this feature back Josh please help me!

It looks like a low-level bug in glGraphicsStateGuardian.cxx. I’ll check in a fix for a future release, but in the meantime, you can work around it by adding these lines to ShowBase.py:

diff -u -r1.343 ShowBase.py
--- ShowBase.py 21 Apr 2008 19:14:52 -0000      1.343
+++ ShowBase.py 6 May 2008 15:25:25 -0000
@@ -1983,6 +1983,8 @@
         buffer = source.makeCubeMap(namePrefix, size, rig, cameraMask, 1)
         if buffer == None:
             raise StandardError, "Could not make cube map."
+        tex = buffer.getTexture()
+        tex.setupCubeMap()

         # Set the near and far planes from the default lens.
         lens = rig.find('**/+Camera').node().getLens()

David