crash when enabled shadows

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39
Contact:

crash when enabled shadows

Post 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.
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.
User avatar
syd
Gnome
Posts: 362
Joined: Thu May 01, 2008 1:55 am
Location: Paris, France

Re: crash when enabled shadows

Post 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
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39
Contact:

Re: crash when enabled shadows

Post 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:
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.
jblovloss
Halfling
Posts: 42
Joined: Sat Nov 07, 2009 6:59 am
Location: USA
Contact:

Re: crash when enabled shadows

Post 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.
Come visit me at Bit Bards: http://www.bitbards.com
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39
Contact:

Re: crash when enabled shadows

Post 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?
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.
Post Reply