v1::Entity *ogreEntity = sceneManager->createEntity(SceneManager::PT_SPHERE);
Crashes with no output to log, when root is initialized, window created...
loading .mesh is right, is when creating a prefab that crashes.
Any idea?
v1::Entity *ogreEntity = sceneManager->createEntity(SceneManager::PT_SPHERE);
Crashes with no output to log, when root is initialized, window created...
loading .mesh is right, is when creating a prefab that crashes.
Any idea?
Hi!
Do you have a callstack when the crash happened?
Code: Select all
1 Ogre::Hlms::getDefaultDatablock() const 0x5555556c3db4
2 Ogre::Renderable::setMaterialName(std::string const&, std::string const&) 0x555555774462
3 Ogre::v1::Entity::buildSubEntityList(Ogre::SharedPtr<Ogre::v1::Mesh>&, std::vector<Ogre::v1::SubEntity, Ogre::STLAllocator<Ogre::v1::SubEntity, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0>>> *, std::vector<std::string, Ogre::STLAllocator<std::string, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0>>> *) 0x55555593c863
4 Ogre::v1::Entity::_initialise(bool) 0x55555593cc2f
5 Ogre::v1::Entity::Entity(unsigned int, Ogre::ObjectMemoryManager *, Ogre::SceneManager *, Ogre::SharedPtr<Ogre::v1::Mesh> const&) 0x55555593dba5
6 Ogre::v1::EntityFactory::createInstanceImpl(unsigned int, Ogre::ObjectMemoryManager *, Ogre::SceneManager *, Ogre::StdMap<std::string, std::string, std::less<std::string>, Ogre::STLAllocator<std::pair<std::string const, std::string>, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0>>> const *) 0x55555593ddc0
7 Ogre::SceneManager::createMovableObject(std::string const&, Ogre::ObjectMemoryManager *, Ogre::StdMap<std::string, std::string, std::less<std::string>, Ogre::STLAllocator<std::pair<std::string const, std::string>, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0>>> const *) 0x5555557b378b
8 Ogre::SceneManager::createEntity(std::string const&, std::string const&, Ogre::SceneMemoryMgrTypes) 0x5555557b20dc
9 Ogre::SceneManager::createEntity(Ogre::SceneManager::PrefabType, Ogre::SceneMemoryMgrTypes) 0x5555557a42e1
10 MainApplication::setupScene mainapplication.cpp 119 0x5555555fbfdb
11 MainApplication::init mainapplication.cpp 63 0x5555555fb66a
12 main main.cpp 9 0x5555555fb00c
The last step seems setting the default material to the sphere, but no one is defined.
How do i define the default material? (i am using the unlit shader lib)
It looks like you're calling createEntity() before HlmsPbs is setup.
If you don't use HlmsPbs, you can call HlmsManager::useDefaultDatablockFrom to use a different Hlms that's already set.
mngHlms->useDefaultDatablockFrom(hlmsUnlit->getType());
This avoids the crash.
Thanks.