Page 1 of 1

crash when enabled shadows

Posted: Thu Dec 03, 2009 2:21 pm
by Beauty
I updated my project from Ogre 1.4.3 to Ogre 1.6.4.
Unfortunately there is still the problem that the application crashes in special situations when shadows are enabled.

When I enable shadows, the logfile get this entry:
Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
Later when the crash happens, this exception will be written to the logfile:
OGRE EXCEPTION(3:RenderingAPIException): Error beginning frame :Invalid call in D3D9RenderSystem::_beginFrame at ..\src\OgreD3D9RenderSystem.cpp (line 2686)
The exception is thrown by

Code: Select all

root.RenderOneFrame()
Without use of shadows I never had such problems.
Generally my applications works with shadows.
The crash happens only when the camera is moving. By this it reaches special positions/orientations inside of my scene(s).
When I set this (ramdom?) positions/orientations again, I always get the exception.
Maybe this happens in context to meshes, its shadows and viewport constellation.

Remember - the exception only happens with enabled shadows.
In the forums I searched for spot_shadow_fade.png and also for RenderingAPIException, but found no answer.
Does somebody has an idea?

I use the Mogre wrapper, but I think it's related to the Ogre library.

Re: crash when enabled shadows

Posted: Thu Dec 03, 2009 6:18 pm
by syd
not sure your problem is related to the one I'm thinking about,
here is a thread that may interest you: http://www.ogre3d.org/forums/viewtopic. ... t&start=25

MattStevens wrote:Hello everyone,
I had exactly the same assert than Eugen, related to shadow camera, and I found the reason. In my case, it was because the shadow camera created by Ogre had a FOV bigger than 180 degree, causing the left/right/top and bottom value to be reversed (like 313 for left, and -313 for right), thus asserting in the AABB setExtent function.

It happened because of the line 105 in OgreShadowCameraSetup.cpp

Code: Select all
// set FOV slightly larger than the spotlight range to ensure coverage
texCam->setFOVy(light->getSpotlightOuterAngle()*1.2);


In my case, my spotlight had an Outer Angle of 175 degree, so I just lowered it a bit and it fixed the assert.

- Matt Stevens

Re: crash when enabled shadows

Posted: Mon Dec 13, 2010 11:53 pm
by Beauty
Thanks for your answer, although I didn't follow this problem anymore.
(I just disabled shadows, which is also well for my scientific application.)

Today I read a new post in the Mogre forum related to this problem.
So the bug is still inside of Ogre 1.7.1.

So I write this tiny post, to keep the problem in mind.
Maybe there will be a bugfix one day :wink:

Re: crash when enabled shadows

Posted: Fri Dec 24, 2010 3:15 am
by jblovloss
Have you tried setting your shadow buffer to a higher value with SceneManager::setShadowIndexBufferSize? I think you usually get an error specific to that problem but worth throwing it out there since that's the one place that shadows have broken for me so far.

Re: crash when enabled shadows

Posted: Sun Dec 26, 2010 2:53 pm
by Beauty
Thanks for your good hint.
I quoted them in 2 related topics of the Mogre forum and hope there will be feedback.
http://www.ogre3d.org/addonforums/viewt ... 659#p77659
http://www.ogre3d.org/addonforums/viewt ... 658#p77658

Anyway - if such crashes happens (e.g. by a too mall ShadowIndexBufferSize),
it would be great if there would be a related message in the ogre.log file.
Maybe somebody can put this improvement suggestion to the Ogre bug tracker?