Hi,
Thanks for your reply. Call stack is shown below:
Code: Select all
> OgreMain.dll!Ogre::ExceptionFactory::throwException(Ogre::Exception::ExceptionCodes code, int number, const std::string & desc, const std::string & src, const char * file, long line) Line 282 C++ Symbols loaded.
OgreMain.dll!Ogre::PixelUtil::unpackColour(float * r, float * g, float * b, float * a, Ogre::PixelFormat pf, const void * src) Line 997 C++ Symbols loaded.
OgreMain.dll!Ogre::PixelUtil::unpackColour(unsigned char * r, unsigned char * g, unsigned char * b, unsigned char * a, Ogre::PixelFormat pf, const void * src) Line 899 C++ Symbols loaded.
OgreMain.dll!Ogre::PixelUtil::convertForNormalMapping(const Ogre::PixelBox & src, const Ogre::PixelBox & dst) Line 1316 C++ Symbols loaded.
OgreMain.dll!Ogre::HlmsTextureManager::copyTextureToArray(const Ogre::Image & srcImage, Ogre::SharedPtr<Ogre::Texture> dst, unsigned short entryIdx, unsigned char srcBaseMip, bool isNormalMap) Line 215 C++ Symbols loaded.
OgreMain.dll!Ogre::HlmsTextureManager::createOrRetrieveTexture(const std::string & aliasName, const std::string & texName, Ogre::HlmsTextureManager::TextureMapType mapType, unsigned int uniqueSpecialId, Ogre::Image * imgSource) Line 717 C++ Symbols loaded.
OgreMain.dll!Ogre::HlmsTextureManager::createOrRetrieveTexture(const std::string & texName, Ogre::HlmsTextureManager::TextureMapType mapType) Line 398 C++ Symbols loaded.
openmw.exe!NiBtOgre::OgreMaterial::getOrCreateMaterial(const std::string & name) Line 491 C++ Symbols loaded.
openmw.exe!NiBtOgre::NiTriBasedGeom::getMaterial() Line 362 C++ Symbols loaded.
openmw.exe!NiBtOgre::NiTriBasedGeom::buildSubMesh(Ogre::v1::Mesh * mesh, NiBtOgre::BoundsFinder & bounds) Line 856 C++ Symbols loaded.
openmw.exe!NiBtOgre::NiNode::buildMesh(Ogre::v1::Mesh * mesh) Line 208 C++ Symbols loaded.
openmw.exe!NiBtOgre::NiMeshLoader::loadManualMesh(Ogre::v1::Mesh * pMesh, const NiBtOgre::NiMeshLoader::ModelBuildInfo & params) Line 156 C++ Symbols loaded.
openmw.exe!NiBtOgre::NiMeshLoader::loadResource(Ogre::Resource * res) Line 114 C++ Symbols loaded.
OgreMain.dll!Ogre::Resource::load(bool background) Line 212 C++ Symbols loaded.
OgreMain.dll!Ogre::v1::MeshManager::load(const std::string & filename, const std::string & groupName, Ogre::v1::HardwareBuffer::Usage vertexBufferUsage, Ogre::v1::HardwareBuffer::Usage indexBufferUsage, bool vertexBufferShadowed, bool indexBufferShadowed) Line 128 C++ Symbols loaded.
OgreMain.dll!Ogre::v1::EntityFactory::createInstanceImpl(unsigned int id, Ogre::ObjectMemoryManager * objectMemoryManager, Ogre::SceneManager * manager, const std::map<std::string,std::string,std::less<std::string>,Ogre::STLAllocator<std::pair<std::string const ,std::string>,Ogre::CategorisedAllocPolicy<0>>> * params) Line 2084 C++ Symbols loaded.
OgreMain.dll!Ogre::SceneManager::createMovableObject(const std::string & typeName, Ogre::ObjectMemoryManager * objectMemMgr, const std::map<std::string,std::string,std::less<std::string>,Ogre::STLAllocator<std::pair<std::string const ,std::string>,Ogre::CategorisedAllocPolicy<0>>> * params) Line 4811 C++ Symbols loaded.
OgreMain.dll!Ogre::SceneManager::createEntity(const std::string & meshName, const std::string & groupName, Ogre::SceneMemoryMgrTypes sceneType) Line 577 C++ Symbols loaded.
What I'm doing: I'm simply trying to use HlmsPbs without any modifications for now (because I can't get my head around creating my own) and I'm simply feeding in diffuse and normal textures. Something like this:
Code: Select all
Ogre::HlmsTextureManager::TextureLocation texLocation = hlmsTextureManager->
createOrRetrieveTexture(texName[NiTexturingProperty::Texture_Base], Ogre::HlmsTextureManager::TEXTURE_TYPE_DIFFUSE);
pbsDatablock->setTexture(Ogre::PBSM_DIFFUSE, texLocation.xIdx, texLocation.texture);
pbsDatablock->setTextureUvSource(Ogre::PBSM_DIFFUSE, 0); // FIXME: just a guess
Trying the same thing with TEXTURE_TYPE_NORMALS will result in the exception.
All this seems to be beyond my skillset, but I'll try to modify as per your suggestion and see how things go. (EDIT: the suggested code is based on Ogre 2.2 which will make things difficult since I'm still on Ogre 2.1)