11-05-2007 23:00:17

I am trying to get LiSPCM shadows going as per the instructions in the ogre manual. As far as I can tell this should do the job:

shadSetup = ogre.LiSPSMShadowCameraSetup()
shadSetup.getShadowCamera (self.sceneManager,, self.viewport, self.defaultLight,

but I get this error:

self.sceneManager.setShadowCameraSetup(shadSetup)Boost.Python.ArgumentError: Python argument types in
SceneManager.setShadowCameraSetup(SceneManager, LiSPSMShadowCameraSetup)
did not match C++ signature:
setShadowCameraSetup(struct SceneManager_wrapper {lvalue}, class Ogre::SharedPtr<class Ogre::ShadowCameraSetup> shadowSetup)
setShadowCameraSetup(class Ogre::SceneManager {lvalue}, class Ogre::SharedPtr<class Ogre::ShadowCameraSetup> shadowSetup)

I tried casting shadSetup as a ogre.SharedPtr, but that does not work. I would be grateful for any help :)


12-05-2007 00:58:43

I'll look at this later today -- however possibly a bug in Python-Ogre..




12-05-2007 04:25:43

Can you add this as a ticket on the web site as it will require either a work around in Python-Ogre, or a patch to the Ogre3d Source (I think)..

I'm looking to do a new Windows binary snapshot next week so may be able to incorporate the fix into it..



12-05-2007 09:51:49

Sure thing, done :), thanks for looking into it.

would be fantastic to see this feature, some of the new shadow techniques look awesome.

I noticed there is a property called 'SceneManager.shadowCameraSetup' so I tried 'self.sceneManager.shadowCameraSetup = shadSetup', but to no avail either.


12-05-2007 14:29:03

Looks like I've resolved the issue although would appreciate a full test program if you'd like to submit one :)

The SVN has been updated (if you are building your own) and it will be in the next binary release..




12-05-2007 21:21:24

I'm not completely certain what the correct setup is to enable the shadow camera, if i get time i'll try building the svn version, but i may well have to hang on for the binary version.

i noticed the ShadowSetup.getShadowCamera( .. ) method in the ogre API ref, i'm confused on the last pointer to send to this function, which is a second camera, is this supposed to be a texture render target?

Also, according to the api docs, a call to getShadowCamera() should return the shadowcamera object, but in my script it seems to return null.

thanks for sorting it out so quickly :)


13-05-2007 04:45:49

The docs must be wrong as getShadowCamera is defined as 'void' (it has no return value) -- instead it modifies the texture camera that you pass to it..

The new snapshot is compiling and if testing goes well I'll post it later today so at least you'll have something to work with..



13-05-2007 12:18:24

Wow cool, am looking forward to it!

heres the part from the API reference I referred to:

virtual void Ogre::LiSPSMShadowCameraSetup::getShadowCamera ( const SceneManager * sm,
const Camera * cam,
const Viewport * vp,
const Light * light,
Camera * texCam
) const [virtual]

Returns a LiSPSM shadow camera.

Builds and returns a LiSPSM shadow camera. More information can be found on the webpage of the TU Wien:

So, does this in fact just initialise the LiSPSMShadowCameraSetup with a camera, rather than returning a new camera object? I can see now you mention it, it should just return void*, however the remarks say it returns a camera - bizarre.


13-05-2007 12:49:58

In fact it doesn't return a void *, it is defined to return void, so it returns nothing...

In looking at the source the it does all it's calcs and then modifies the texcam (the last argument you pass it)..

Hopefully have a demo or at least test program to go with the binary (building the installer now)



13-05-2007 13:10:47

sorry yes you're right! ( exposing my limited grasp of c++ there..)

Thanks for your time on this!


14-05-2007 05:31:33

You can try the snapshot version which at least seems to support ShadowCameras propoerly (although I don't have a test program written yet).

Also it has SimpleGUI which might be suitable for the tech demo.

Note, this is a snapshot version so may introduce new problems (it has very limited testing) :)



14-05-2007 09:18:45

Awesome again!, downloading now, will see if i can come up with a test prog today. SimpleGUI as well will be a bonus,

EDIT: Hmm, something appears broke somewhere with my code. Since downloading the snapshot, the techdemo (containing the shadowcamera code) crashes on startup with an unknown exception error. I'll try to debug it and see if i can get it running. All the demos seem to work fine, including simpleGUI.

DUH, sorry. Forgot to copy the new plugins into the project!

Well, I've tested the shadowCamera, but I don't think I am setting it up correctly. There is no error reported, but now the screen just turns completely grey, with nothing apparently going on. Will continue and see what I can come up with.


15-05-2007 00:30:24

I did some some simple testing with the Demo_Skeletal demo program (it already has shadows)..
self.CurrentShadowCameraSetup = ogre.LiSPSMShadowCameraSetup()
self.CurrentShadowCameraSetup.getShadowCamera (self.sceneManager,, self.viewport, light,
self.pPlaneEnt = sceneManager.createEntity( "plane", "Myplane" )

def __del__ ( self ):
del self.pPlaneEnt

And it modifies the camera settings so you have a birds eye view -- OK, so not useful but at least it shows it working...

Note the need to hold the plane and specifically delete it at close -- otherwise you get a crash on exit.




15-05-2007 09:16:35

Ah, yeah I had thought of trying that, but got too engrossed in the manual and wiki researching the shadowCamera system. It looks like, to do it properly, you need to provide specific materials for all models in the game which are supposed to use the shadow technique.

I also had a stab at converting the new shadows demo into python, am about a third of the way through, but I have probably made several mistakes already.