Vertex programs and resourcemanager

Problems building or running the engine, queries about how to use features etc.
Post Reply
AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary
Contact:

Vertex programs and resourcemanager

Post by AssiDragon »

Alright, I think I need your help in this one. :)

I was looking around OGRE, and was toying around the resourcemanager. I did a test where I load a new scene, with these steps:

-call mScManager->clearScene
-ResourceGroupManager::getSingleton().destroyResourceGroup("Map");
-reload the exactly same resource paths from a .cfg file, using the code ripped from OGRE demos
-ResourceGroupManager::getSingleton().initialiseResourceGroup("Map");
-mScManager->setWorldGeometry("terrain.cfg");
-put back the entities that were there before clearing the scene

The group "Map" is nothing more than these directories:

Code: Select all

FileSystem=../../../Media/models
FileSystem=../../../Media/overlays
FileSystem=../../../Media/particle
FileSystem=../../../Media/materials/textures
FileSystem=../../../Media/materials/programs
FileSystem=../../../Media/materials/scripts
The problem is when I do this, this explained code piece runs through without errors, and when OGRE tries to render the next frame it runs into an error, around setting GPU parameters.

Callstack:

Code: Select all

>	OgreMain_d.dll!Ogre::GpuProgramParameters::setConstant(unsigned int index=9, const float * val=0x154a118c, unsigned int count=0)  Line 221 + 0x3	C++
 	OgreMain_d.dll!Ogre::GpuProgramParameters::setConstant(unsigned int index=8, const Ogre::Vector4 & vec={...})  Line 154	C++
 	OgreMain_d.dll!Ogre::FloatGpuParameterControllerValue::setValue(float val=0.26562008)  Line 192	C++
 	OgreMain_d.dll!Ogre::Controller<float>::update()  Line 211 + 0x81	C++
 	OgreMain_d.dll!Ogre::ControllerManager::updateAllControllers()  Line 71	C++
 	OgreMain_d.dll!Ogre::SceneManager::_renderScene(Ogre::Camera * camera=0x062d10a8, Ogre::Viewport * vp=0x0641d0a8, bool includeOverlays=true)  Line 810	C++
 	Plugin_OctreeSceneManager.dll!Ogre::TerrainSceneManager::_renderScene(Ogre::Camera * cam=0x062d10a8, Ogre::Viewport * vp=0x0641d0a8, bool includeOverlays=true)  Line 479 + 0x17	C++
 	OgreMain_d.dll!Ogre::Camera::_renderScene(Ogre::Viewport * vp=0x0641d0a8, bool includeOverlays=true)  Line 390 + 0x2a	C++
 	OgreMain_d.dll!Ogre::Viewport::update()  Line 187	C++
 	OgreMain_d.dll!Ogre::RenderTarget::update()  Line 108	C++
 	OgreMain_d.dll!Ogre::RenderWindow::update()  Line 67	C++
 	OgreMain_d.dll!Ogre::RenderSystem::_updateAllRenderTargets()  Line 96 + 0x24	C++
 	OgreMain_d.dll!Ogre::Root::_updateAllRenderTargets()  Line 849 + 0x18	C++
 	OgreMain_d.dll!Ogre::Root::renderOneFrame()  Line 639	C++
 	OgreMain_d.dll!Ogre::Root::startRendering()  Line 625 + 0x8	C++
 	SBS.exe!GameMain::go()  Line 97 + 0xe	C++
 	SBS.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * __formal=0x00000000, char * strCmdLine=0x00142428, HINSTANCE__ * __formal=0x00000000)  Line 15 + 0xd	C++
 	SBS.exe!WinMainCRTStartup()  Line 390 + 0x39	C
 	kernel32.dll!7c816d4f() 	
 	kernel32.dll!7c8399f3() 	
I use the OGRE SDK release from the site. Any idea what could I be doing wrong? :)

EDIT: commenting out the programs directory and leaving out any material with vertex or fragment programs fixes it. This seems rather strange as my code uses none of those anyway!
Hope is the first step on the road to disappointment.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

I think this is the automatic frame time GPU parameter binding that for some reason is still bound to an old program which used to use it. Needs more investigation.
AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary
Contact:

Post by AssiDragon »

Oh, okay.

I know this might sound stupid, but why is it using it in the first place? I certainly didn't use any material that any vertex program... :/

PS - sorry about the other thread, I thought I might make a bug report in the appropiate thread. Don't ask me was it seemed logical... :? sorry about it.
Hope is the first step on the road to disappointment.
AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary
Contact:

Post by AssiDragon »

Aaaalright, I am now not sure if it was a problem with OGRE or my own stupidity.

I added

Code: Select all

ControllerManager::getSingleton().clearControllers();
to the scene destroying function, and since there is no controllervalue to update the old shader with, it doesn't get called and doesnt crash OGRE. I'm not sure if this is designed this way and I didn't note, or still a problem though. =)
Hope is the first step on the road to disappointment.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

AssiDragon wrote:I know this might sound stupid, but why is it using it in the first place? I certainly didn't use any material that any vertex program... :/
If you have any scripts on the resource path which mention the 'time' auto parameter. We have some in the standard distribution.

I have this on my list to ponder but I'm glad you have a solution.
Post Reply