Crash when automatic shadows and multithreading are both enabled

Bug #1212752 reported by Tober
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

Panda3d version: 1.9.0 devel
OS: Windows 7 64 bit

I've set up shadows using light.setShadowCaster(), but when I turn on multithreading with threading-model Cull/Draw in the config, panda3d freezes up before it draws anything to the screen.

I've narrowed it down to a simple example. If both the commented first line and second line exist, it doesn't work for me.

from panda3d.core import loadPrcFileData
#First line
loadPrcFileData('', 'threading-model Cull/Draw')

from panda3d.core import *

from direct.showbase.ShowBase import ShowBase

class Engine(ShowBase):
      def __init__(self):

            model = loader.loadModel("models/environment")
            box = loader.loadModel("models/box")

            #Second line
            light.setShadowCaster(True, 1024, 1024)


            node = render.attachNewNode(light)


   = True
                  print "updating..."


Tags: threading
Revision history for this message
rdb (rdb) wrote :

Problem is that the shader generator calls GraphicsEngine::make_output on the draw thread even though it's only supposed to be called on the app thread.

Changed in panda3d:
status: New → Triaged
Revision history for this message
rdb (rdb) wrote :

I'm afraid there may not be an easy way to solve this problem right now. However, I have plans to change the architecture of buffers so that they can live in the scene graph; that would alleviate the need for them to be registered with the GraphicsEngine.

A terrible, terrible hack around this problem would be to set the threading model only after a few frames of rendering, after the shadow buffers have been created.

Moguri (mogurijin)
tags: added: threading
Revision history for this message
rdb (rdb) wrote :
Changed in panda3d:
assignee: nobody → rdb (rdb)
milestone: none → 1.10.0
status: Triaged → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.