Problem with Shadow Casters and DirectX

Hi!

When adding a DirectionalLight or SpotLight and setting it to be a shadow caster, I get an DX9 exception (works fine in OpenGL). If I don’t call setShadowCaster, the problem goes away. Am I missing some vital config value in the config file?

Greatful for any help!

BR // Astrogee

self.dlight = self.render.attachNewNode(DirectionalLight('dlight'))
self.dlight.node().setColor(VBase4(0.3, 0.3, 0.3, 0.5))
self.dlight.node().setShadowCaster(True)
self.dlight.node().getLens().setFilmSize( 50, 50 ); 
self.dlight.node().getLens().setNearFar( -10.0, 50.0 );
self.dlight.setHpr(45, -45, 0)
self.render.setLight(self.dlight)

Config file:

load-display pandadx9
win-origin 20 20
win-size 1280 800
fullscreen #f

Console output

Known pipe types:
  wdxGraphicsPipe9
(all display modules loaded.)
Assertion failed: _d3d_format != D3DFMT_UNKNOWN at line 237 of c:\panda3d-1.7.0\panda\src\dxgsg9\dxTextureContext9.cxx
:display:gsg:dxgsg9(error): Unable to re-create texture dlight
Assertion failed: _d3d_format != D3DFMT_UNKNOWN at line 237 of c:\panda3d-1.7.0\panda\src\dxgsg9\dxTextureContext9.cxx
:display:gsg:dxgsg9(error): Unable to re-create texture dlight
Assertion failed: _d3d_format != D3DFMT_UNKNOWN at line 237 of c:\panda3d-1.7.0\panda\src\dxgsg9\dxTextureContext9.cxx
:display:gsg:dxgsg9(error): Unable to re-create texture dlight
Assertion failed: _d3d_format != D3DFMT_UNKNOWN at line 237 of c:\panda3d-1.7.0\panda\src\dxgsg9\dxTextureContext9.cxx
:display:gsg:dxgsg9(error): Unable to re-create texture dlight
:display:gsg:dxgsg9(error): SetRenderTarget  at (c:\panda3d-1.7.0\panda\src\dxgsg9\wdxGraphicsBuffer9.cxx:477), hr=D3DERR_INVALIDCALL: Invalid call

c:\panda3d-1.7.0\panda\src\dxgsg9\wdxGraphicsBuffer9.cxx 477
:display:gsg:dxgsg9(error): SetRenderTarget  at (c:\panda3d-1.7.0\panda\src\dxgsg9\wdxGraphicsBuffer9.cxx:477), hr=D3DERR_INVALIDCALL: Invalid call

c:\panda3d-1.7.0\panda\src\dxgsg9\wdxGraphicsBuffer9.cxx 477
Traceback (most recent call last):
  File "C:\Panda3D-1.7.0\direct\showbase\ShowBase.py", line 1678, in __igLoop
    self.graphicsEngine.renderFrame()
AssertionError: _d3d_format != D3DFMT_UNKNOWN at line 237 of c:\panda3d-1.7.0\panda\src\dxgsg9\dxTextureContext9.cxx
:task(error): Exception occurred in PythonTask igLoop
Traceback (most recent call last):
  File "C:\Projects\fungus\panda\tests\src\collision_test.py", line 99, in <module>
    app.run()
  File "C:\Panda3D-1.7.0\direct\showbase\ShowBase.py", line 2531, in run
    self.taskMgr.run()
  File "C:\Panda3D-1.7.0\direct\task\Task.py", line 496, in run
    self.step()
  File "C:\Panda3D-1.7.0\direct\task\Task.py", line 454, in step
    self.mgr.poll()
  File "C:\Panda3D-1.7.0\direct\showbase\ShowBase.py", line 1678, in __igLoop
    self.graphicsEngine.renderFrame()
AssertionError: _d3d_format != D3DFMT_UNKNOWN at line 237 of c:\panda3d-1.7.0\panda\src\dxgsg9\dxTextureContext9.cxx

Well if you want to use the shader generator, you should use OGL. Its not just the automated shadows that will give you problems…

I’m not dead set on using DX, I was just under the impression that Panda handles DX and OGL equally(almost). Anyway, I’ll stick to OGL then.

Thanks