Debug mode

RedSkull

22-03-2006 10:37:43

Hi, when I enable debug mode

mWorld->debug(true);

the application exit to desktop.

Is some other form to activate the debug mode?

Thx.

betajaen

22-03-2006 13:00:48

Yep, that's how you use the debug mode.

But are you using it after you create a scene or before? I fixed a bug a week or two ago if you launched the visual debugger before a scene was created it did not know what SceneManager to use hence calling random memory.

I expect the situation is the same with you, so just move mWorld->debug(true) after mScene = mWorld->createScene(...)

RedSkull

22-03-2006 16:00:39

It crashes when I use it after create a scene. Indeed, I've tried to put it in tutorial101 and happens the same.

// 1. Start up NxOgre and pass on Ogre Root and the SceneManager as arguments.
mWorld = new world(mRoot,mSceneMgr);

// 2. Create our scene, this is where the physics is simulated into.
//We can have more than one scene, but physics objects of one scene
//cannot interact with another scene.
nxOgre::scene* mScene = mWorld->createScene("Main");
mWorld->debug(true);

// 3. Better add some gravity.
mScene->hasGravity();

// 4. Let's add a floor.
//Floors have an infinite size so we don't have to worry about anything
//falling off!
mScene->hasFloor();

// 5. Create a simple cube at X:0, Y:10m , Z:0 with a size of 1 metre.
//Due the gravity it'll fall then come to a rest.
myCube = mScene->createBody("myCube","cube.1m.mesh",new cubeShape(1.0f),10.0f,Vector3(0,3.5,0));

betajaen

22-03-2006 16:20:04

Hmm...It might be related to the debugging system itself perhaps with creating the mesh itself.

Are you using Dagon? Also are you using NxOgre Preview 3 or the CVS?

[Edit]

With any of the demos, when you press F2 to enable debugging does it crash then?

RedSkull

22-03-2006 17:42:36

I'm using NxOgre Preview 3. In demo it happens something strange: when I press F2 doesn't happen anything. I have realized of which in the log file "Ogre.log" there are writings many errors, but do not seem to be related to the subject of debug.

The errors are:

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: GpuProgramParameters::getParamIndex
Description: Cannot find a parameter named view_position.
File: \OgreDev\Azathoth\OgreMain\src\OgreGpuProgram.cpp
Line: 586
Stack unwinding: <<beginning of stack>>
18:08:34: Error at line 18 of nature.cloud_dome.material: Invalid param_named_auto attribute - An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: GpuProgramParameters::getParamIndex
Description: Cannot find a parameter named view_position.
File: \OgreDev\Azathoth\OgreMain\src\OgreGpuProgram.cpp
Line: 586
Stack unwinding: <<beginning of stack>>
18:08:34: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: GpuProgramParameters::getParamIndex
Description: Cannot find a parameter named skyScale.
File: \OgreDev\Azathoth\OgreMain\src\OgreGpuProgram.cpp
Line: 586
Stack unwinding: <<beginning of stack>>
18:08:34: Error at line 18 of nature.cloud_dome.material: Invalid param_named attribute - An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: GpuProgramParameters::getParamIndex
Description: Cannot find a parameter named skyScale.
File: \OgreDev\Azathoth\OgreMain\src\OgreGpuProgram.cpp
Line: 586
Stack unwinding: <<beginning of stack>>
18:08:34: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: GpuProgramParameters::getParamIndex
Description: Cannot find a parameter named lightDir.
File: \OgreDev\Azathoth\OgreMain\src\OgreGpuProgram.cpp
Line: 586
Stack unwinding: <<beginning of stack>>
18:08:34: Error at line 38 of nature.cloud_dome.material: Invalid param_named attribute - An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: GpuProgramParameters::getParamIndex
Description: Cannot find a parameter named lightDir.
File: \OgreDev\Azathoth\OgreMain\src\OgreGpuProgram.cpp
Line: 586
Stack unwinding: <<beginning of stack>>
18:08:34: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: GpuProgramParameters::getParamIndex
Description: Cannot find a parameter named lightDir.
File: \OgreDev\Azathoth\OgreMain\src\OgreGpuProgram.cpp
Line: 586
Stack unwinding: <<beginning of stack>>
18:08:34: Error in material clo at line 68 of nature.cloud_dome.material: Invalid param_named_auto attribute - An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 7
Function: GpuProgramParameters::getParamIndex
Description: Cannot find a parameter named lightDir.
File: \OgreDev\Azathoth\OgreMain\src\OgreGpuProgram.cpp
Line: 586
Stack unwinding: <<beginning of stack>>


PD: my mature language is not english, so...sorry if my english is too poor.

betajaen

22-03-2006 21:42:47

Hmm, what version of Ogre are you using?

As for that log there, completely unrelated and there not errors as such (It's for the sky in the vehicle demo).


And your English is better than mine!

RedSkull

23-03-2006 07:54:40

I forgot it: I use OGRE 1.0.7 [Azathoth] version.

SFAOK

12-05-2006 15:43:23

Any updates with this? I've got exactly the same problem running Dagon, Preview 3 (non CVS) and PhysX v2.3.3 - when I press F2 in any of the tutorials, or switch debug mode on manually I get a crash.

SFAOK

12-05-2006 15:59:44

Ahh fixed it. What I did was change the material in nxOgre_debugNode.cpp to "Core/NodeMaterial".

Another person with a similar problem (although his didn't crash, just didn't show), simply changed the material file. Same thing I guess, although it didn't work for me (though I guess I might have made a mistake).

Toby

15-06-2006 23:01:35

Hello,
I have same problem. How to fixed it?
I understand that you recompile your NxOgre but what change exactly?
Else how to do otherwise?

magura

16-06-2006 02:18:29

you can either make sure youre using the nxogre supplied materials, or edit one of the material files so that it's referencing a different image, or change it in the code(nxOgre_debugNode.cpp) and rebuild.

magura

16-06-2006 02:25:13

material NxOgre.debugNode
{
technique
{
pass
{
lighting off
scene_blend add
depth_check off
depth_write off
cull_hardware none

texture_unit
{
texture axes.png
}
}
}
}


in a material file

and in the debugnode.cpp

if(!Ogre::MaterialManager::getSingleton().resourceExists("NxOgre.debugNode")) {

Ogre::MaterialPtr debugMat = static_cast<Ogre::Material*>(Ogre::MaterialManager::getSingleton().getByName("BaseWhiteNoLighting").get())->clone("NxOgre.debugNode");
Ogre::Pass* pass = new Ogre::Pass( debugMat->getBestTechnique(), 0 );
pass->setVertexColourTracking(Ogre::TVC_AMBIENT|Ogre::TVC_DIFFUSE);
pass->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
pass->setDepthWriteEnabled(true);

}

this->setMaterial("NxOgre.debugNode");


Just make sure that the code is referencing a material name that exists in a material definition...

EDIT: also make sure youve got axes.png there :)

NickM

25-07-2006 22:01:54

Thanks for this info, works like a dream :D