I have been trying to complete Basic Tutorial 3 but all I get is a black screen. The source is pre-Bites so I just copied out the relevant code to the new method as used in tutorials 1 & 2. I also attached my camera and light to scene nodes (these are not used in the tutorial 3 source), and made the calls to setDirection and setPosition on the nodes instead of the objects themselves. I've tried various combinations here, moving those calls from object to node to both etc., but always just get a black screen as if there is no light and/or no camera?
All I see is a black screen, and there are some errors in my Ogre log (attached). I was getting this same error on tutroial 2 using v1.11.3 and D3D9 but 1.11.4 fixed it there. The terrain and textures loaded ok from what I can see in the log, but I could be missing something.
Code: Select all
Ogre::InvalidParametersException::InvalidParametersException: Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at C:\Projects\Ogre\Ogre\ogre-1.11.4\OgreMain\src\OgreGpuProgramParams.cpp (line 1661)
Code: Select all
Error: ScriptCompiler - invalid parameters in UnsharpMask.material(131): setting of constant failed
Code: Select all
Ogre::Vector3 lightdir(0.55, -0.3, 0.75);
lightdir.normalise();
Ogre::Light* light = mSceneMgr->createLight("TestLight");
light->setType(Ogre::Light::LT_DIRECTIONAL);
light->setDirection(lightdir);
light->setDiffuseColour(Ogre::ColourValue::White);
light->setSpecularColour(Ogre::ColourValue(0.4, 0.4, 0.4));
Code: Select all
SceneNode* lightNode = mScnMgr->getRootSceneNode()->createChildSceneNode();
Ogre::Light* light = mScnMgr->createLight("TestLight");
light->setType(Ogre::Light::LT_DIRECTIONAL);
light->setDiffuseColour(Ogre::ColourValue::White);
light->setSpecularColour(Ogre::ColourValue(0.4, 0.4, 0.4));
lightNode->setDirection(lightdir);
lightNode->attachObject(light);
Code: Select all
SceneNode* camNode = mScnMgr->getRootSceneNode()->createChildSceneNode();
Ogre::Camera* cam1 = mScnMgr->createCamera("Cam1");
cam1->lookAt(Ogre::Vector3(1963, 50, 1660));
cam1->setNearClipDistance(0.1);
camNode->attachObject(cam1);
camNode->setPosition(Ogre::Vector3(1683, 50, 2116));
Ogre Version: v1.11.4
Operating System: Windows 10 Enterprise 1803 (x64)
Render System: Direct3D9