Black Screen of Death

wspnut

16-10-2006 02:45:40

BSoD...

Black screen of death this time. I tried to make a projcet (based on the tutorials supplied) but the system simply hangs on a black screen when it is loaded.

I created a new console application and mimiced the settings used in the 102 tutorial project. I even used the include files used in the tutorials.

The project compiled fine, however, after getting past the device configuration dialog, a black screen appears and the process runs my system at 99% CPU endlessly. (Escape doesn't exit either).

Here is the end of my ogre.log after that:


21:36:37: Mesh: Loading nx.floor.mesh.
21:36:37: Texture: nx.floor.png: Loading 1 faces(PF_A8B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
21:36:37: Texture: nx.floor.lm.png: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
21:36:37: Mesh: Loading nx.body.axis.mesh.
21:36:37: Texture: arrow1.png: Loading 1 faces(PF_A8B8G8R8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
21:36:37: Win32Input8: DirectInput Activation Starts
21:36:37: Win32Input8: Establishing keyboard input.
21:36:37: Win32Input8: Keyboard input established.
21:36:37: Win32Input8: Initializing mouse input in immediate mode.
21:36:37: Win32Input8: Mouse input in immediate mode initialized.
21:36:37: Win32Input8: DirectInput OK.
21:36:37: Texture: arrow.png: Loading 1 faces(PF_A8B8G8R8,32x32x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
21:36:37: WARNING: Mesh instance 'NxOgre.ErrorCube' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
21:36:37: Mesh: Loading Ball_Brass.mesh.
21:36:38: Texture: brass.jpg: Loading 1 faces(PF_B8G8R8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
21:36:38: Mesh: Loading L1_Floor.mesh.
21:36:38: 5




And here is my simple code:


#include "nxOgre.h"
#include "Ogre.h"
#include "tutorialSimples.h"
#include "mousePicker.h"

using namespace nxOgre;
using namespace Ogre;


class oBallz : public SimpleTutorial, public mousePicker {

public:

world *mWorld;
scene *mScene;

body *myBall;
body *L1_floor;

float timeSince;


void start()
{
mWorld = new world(mRoot);
mScene = mWorld->createScene("MainScene", mSceneMgr);

mScene->hasGravity();
mScene->hasFloor();

myBall = mScene->createBody(
"MyBall",
"Ball_Brass.mesh",
new sphereShape(0.5f), // Radius of 0.5 Meters
10.0f, // Density of 10
Vector3(0, 0, 50) // Center it, and let it drop outright
);

L1_floor = mScene->createStaticBody(
"L1Floor",
"L1_Floor.mesh",
new meshShape("L1_Floor.mesh", mScene),
Vector3(0, 0, 0)
);

pickerSetup(mSceneMgr, mCamera, mScene, mWindow->getWidth(), mWindow->getHeight());
}


void stop()
{
delete mWorld;
}


void newFrame(float _time)
{
checkSystemKeys(_time);
pickerFrame();

if (isKeyDown(Y))
myBall->addTorque(Ogre::Vector3(0, 150, 0));

if (isKeyDown(NEG_Y))
myBall->addTorque(Ogre::Vector3(0, -150, 0));

if (isKeyDown(X))
myBall->addTorque(Ogre::Vector3(150, 0, 0));

if (isKeyDown(NEG_X))
myBall->addTorque(Ogre::Vector3(-150, 0, 0));
}


void checkSystemKeys(float _time)
{
timeSince += _time;

if (isKeyDown(DEBUG_MODE) && timeSince >= 0.25f)
{
mWorld->showDebugOverlay(mCamera, mWindow);
mWorld->debug(mWorld->isDebugRendering() ^ 1);
timeSince = 0.0f;
}

if (isKeyDown(SCREENSHOT) && timeSince >= 0.25f)
{
mWindow->writeContentsToFile("screenshot." +
Ogre::StringConverter::toString(Ogre::Math::Floor(mRoot->getTimer()->getMilliseconds() / 1000)) + ".png");

timeSince = 0.0f;
}
}

void getTutorialSettings()
{
mTutorialName = "ohBalls";
mTutorialDescription = "This needs to be modified";
timeSince = 0.0f;
}

void prestart() { }

void prestop() { }

void mousePick(float x, float y)
{
if (getMouseButton() == MOUSE_PRIMARY)
mouseMoveOrGrab(x, y, true);
else
mouseMoveOrGrab(x, y, false);
}
};



int main(int argc, char *argv[])
{
SET_TERM_HANDLER;

try
{
oBallz* toRun = new oBallz();

toRun->Run();
toRun->Shutdown();

delete toRun;
}
catch (Ogre::Exception& e)
{
std::cerr << "An exception has occured: " << e.getFullDescription().c_str() << std::endl;
}

return 0;
}

NickM

16-10-2006 08:37:34

I too am getting the black screen of death but I'm getting it with every NxOgre tutorial that I try, they sort of run in OpenGL, here's a screen shot of tutorial 101 in OpenGL.....


...but in Direct3D my pc completely locks up and eventually reboots itself, here's the end of the Ogre.log that I get when I try to run tutorial 101 in Direct3D....

07:42:14: ***************************************
07:42:14: *** D3D9 : Subsystem Initialised OK ***
07:42:14: ***************************************
07:42:14: ResourceBackgroundQueue - threading disabled
07:42:14: Particle Renderer Type 'billboard' registered
07:42:14: Creating viewport on target 'NxOgre: NxTutorial Sandbox - Mmm, Sandwiches', rendering from camera 'MainCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
07:42:14: Viewport for camera 'MainCamera', actual dimensions L: 0 T: 0 W: 640 H: 480
07:42:14: Parsing scripts for resource group Autodetect
07:42:14: Finished parsing scripts for resource group Autodetect
07:42:14: Parsing scripts for resource group Bootstrap
07:42:14: Parsing script Ogre.fontdef
07:42:14: Finished parsing scripts for resource group Bootstrap
07:42:14: Parsing scripts for resource group General
07:42:14: Parsing script nx.floor.material
07:42:14: Parsing script arrows.material
07:42:14: Parsing script nx.shapes.material
07:42:14: Parsing script nx.stairs.material
07:42:14: Parsing script 312.material
07:42:14: Parsing script 313.material
07:42:14: Parsing script chair.material
07:42:14: Parsing script set.material
07:42:14: Parsing script instructions.material
07:42:14: Parsing script nx.bodyguide.material
07:42:14: Parsing script int.material
07:42:14: Parsing script nx.interior1.material
07:42:14: Finished parsing scripts for resource group General
07:42:14: Parsing scripts for resource group Internal
07:42:14: Finished parsing scripts for resource group Internal
07:42:14: WARNING: Stencil shadows were requested, but this device does not have a hardware stencil. Shadows disabled.
07:42:14: Mesh: Loading nx.floor.mesh.
07:42:14: Texture: nx.floor.png: Loading 1 faces(PF_A8B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,512x512x1.
07:42:14: Texture: nx.floor.lm.png: Loading 1 faces(PF_B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
07:42:14: Mesh: Loading nx.body.axis.mesh.
07:42:14: Texture: arrow1.png: Loading 1 faces(PF_A8B8G8R8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,256x256x1.
07:42:14: Win32Input8: DirectInput Activation Starts
07:42:14: Win32Input8: Establishing keyboard input.
07:42:14: Win32Input8: Keyboard input established.
07:42:14: Win32Input8: Initializing mouse input in immediate mode.
07:42:14: Win32Input8: Mouse input in immediate mode initialized.
07:42:14: Win32Input8: DirectInput OK.
07:42:14: Texture: arrow.png: Loading 1 faces(PF_A8B8G8R8,32x32x1) with hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,32x32x1.
07:42:14: WARNING: Mesh instance 'NxOgre.ErrorCube' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.


Unfortunately just before trying the new NxOgre I had to wipe my hardisk, so this means everything is a newer version than what I was running before ie: DirectX SDK, Ogre, etc. and that means I can't say that the problem lays with NxOgre as it could easily be something else. I'll keep investigating.

betajaen

16-10-2006 09:47:07

Right, this is more serious than I though.

Have any of you tried the fix:

Okay, fixed it. Well sort off. It's a nasty hack but works. It should make every tutorial except for sandbox and 101 to work properly again.

In mousePicker.h
There's almost two indetical classes in there, the fix should be applied to both of them.

Add to the variable list at the top:


bool f;


Add append this to the constructor code:

f = false;


Then go to the pickerFrame() method and insert this at the top:

if (!f) {
__cam->setPosition(10,10,10);
__cam->lookAt(0,0,0);
f = true;
}


wspnut

16-10-2006 21:03:11

I hadn't put that in because I didn't think that would cause that error. As soon as I get back from work I'll throw it in and tell you if everything turns out all fine and dandy :D

betajaen

16-10-2006 21:13:45

Aha, I didn't read your code properly.

Most likely it's not liking the static mesh you are using, possibly due to shared vertices's or some other thing PhysX does not like.

Try it without that body and see what happens, also if your floor is just a floor. You can use mScene->hasFloor, or even a groundShape.

wspnut

16-10-2006 22:22:09

I'll try it without the static body... but I am going to need static bodies in my game. Dunno why it'd be yelling at me about that one... It's a simple plane object made in 3ds max.

also if your floor is just a floor. You can use mScene->hasFloor, or even a groundShape.

As for that, the simple level designs will eventually have uneven/modified floors. I'm curious about this groundShape, however... I don't remember reading about that in any of the tutorials or in the book's draft.

betajaen

16-10-2006 23:30:37

The meshShapes are fine, they just can't have shared vertices. With it pausing like that must mean PhysX has a problem with the mesh.

groundShape won't be in the book as they are bran spanking new; Basically they are infinite floor planes. The mScene->hasFloor() method creates a static body for you with a groundFloor.

wspnut

17-10-2006 00:44:00

The meshShapes are fine, they just can't have shared vertices. With it pausing like that must mean PhysX has a problem with the mesh.

groundShape won't be in the book as they are bran spanking new; Basically they are infinite floor planes. The mScene->hasFloor() method creates a static body for you with a groundFloor.


How can I keep my models from having shared vertices? Any idea. I don't even know how to check...

I just exported it with oFusion and 3ds max.

betajaen

17-10-2006 09:37:30

I don't know oFusion or 3DSMax so I can't help you there.

But would you try this first:

mScene->createStaticBody(....... new meshShape("cube.1m.mesh") .....);

NickM

28-10-2006 11:37:06

I can't understand why but I've updated my graphics card drivers and now NxOgre works just fine, no more Black screen of death. :D
Why would the Ogre demo's and the PhysX demo's work ok but the NxOgre tutorials not? :?