The only things I can't seem to fix is that my text doesn't seem to have a transparent background. It just uses the normal background color.
And I haven't found where to disable the shadow casting from my text.
Additionally, the link to the zip on this page http://wiki.ogre3d.org/MovableText is broken. It says " Plugin disabled Plugin attach cannot be executed." (using FireFox), so I used the one from the mentioned thread instead.
The "on top" functionality also doesn't work properly for me, whether it's enabled or not... For some reason my floor is draw after the text.
The way the mOnTop is applied:
Code: Select all
HlmsMacroblock macroblockOptions;
macroblockOptions.mDepthCheck = !mOnTop;
macroblockOptions.mDepthWrite = mOnTop;
When on top is disabled it does do the depth check, but then never writes its own depth, causing it to be overwritten easily by anything that is drawn after (in my case my floor plane seems to be drawn later and so my text always gets obscured by the floor).
I don't need the on top functionality, so for me changing the code to
Code: Select all
HlmsMacroblock macroblockOptions;
macroblockOptions.mDepthCheck = true;
macroblockOptions.mDepthWrite = true;
While typing this I just noticed that the transparent background issue seems to only apply to the floor as well, as it seems the background is transparent to other objects. I can't see a reason why my floor is doing these weird things though. Floor plane code:
Code: Select all
auto const meshUid = QString("floorplane_%1_%2")
.arg((int) (d->m_desiredSettings->m_floorSize))
.arg((int) d->m_desiredSettings->m_tilesPerSide).toOgreString();
auto const floorUid = d->m_floorUid.toOgreString();
if (Ogre::v1::MeshManager::getSingleton().getByName(meshUid).isNull())
{
// create floor plane if it did not exist
Ogre::Plane plane(Ogre::Vector3::UNIT_Y, 0);
Ogre::v1::MeshPtr planeMeshV1 = Ogre::v1::MeshManager::getSingleton().createPlane(
meshUid,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
plane,
d->m_desiredSettings->m_floorSize, // width
d->m_desiredSettings->m_floorSize, // height
1, // xsegments
1, // ysegments
true, // normals
1, // numTexCoordSets
d->m_desiredSettings->m_tilesPerSide / 2, // U Tile
d->m_desiredSettings->m_tilesPerSide / 2, // V Tile
Ogre::Vector3::UNIT_Z, // This appears to a texture vector...
Ogre::v1::HardwareBuffer::HBU_STATIC_WRITE_ONLY,
Ogre::v1::HardwareBuffer::HBU_STATIC_WRITE_ONLY
);
Ogre::MeshPtr planeMesh = Ogre::MeshManager::getSingleton().createManual( meshUid + "_plane", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME );
planeMesh->importV1( planeMeshV1.get(), true, true, true );
}
if (d->m_floorEntity)
m_sceneManager->destroyEntity(d->m_floorEntity);
d->m_floorEntity = m_sceneManager->createEntity(meshUid);
d->m_floorEntity->setName(floorUid);
d->m_floorEntity->setQueryFlags(OgreQtWidget::NodeNotPickable);
d->m_floorEntity->setDatablockOrMaterialName("floor");
d->m_floorEntity->setCastShadows(true);
Ogre::Node* node = findChildNode(m_sceneManager->getRootSceneNode(), floorUid);
if (!node)
{
node = m_sceneManager->getRootSceneNode()->createChildSceneNode();
node->setName(d->m_floorUid.toOgreString());
}
auto snode = dynamic_cast<Ogre::SceneNode*>(node);
assert(snode);
snode->attachObject(d->m_floorEntity);
Code: Select all
hlms floor pbs
{
roughness 0.4
fresnel 1.33
detail_map0 floortile512.png
diffuse_map floortile512.png
alpha_from_textures false
}

