Re: Porting Gorilla
Posted: Wed Feb 04, 2015 11:26 pm
what rendersystem do you use? just to be sure. font 40 exists in your gorilla file?
Support and community hang-out spot for Ogre3D
https://forums.ogre3d.org/
Code: Select all
Ogre::CompositorManager2* compositorManager = ogreRoot->getCompositorManager2();
compositorManager->createBasicWorkspaceDef("Basic Workspace", Ogre::ColourValue::Black);
compositorManager->addWorkspace(sceneManager, renderWindow, camera, "Basic Workspace", true);
silverback->createScreen(sceneManager, renderWindow, "uiatlas"); // Pass the Ogre::RenderWindow here Code: Select all
compositor_node mainRenderNode
{
texture mrt target_width target_height PF_R8G8B8 PF_R8G8B8
target mrt
{
pass clear
{
colour_value 0 0 0 1
}
pass render_scene
{
//shadows ShadowNode
rq_first 0
rq_last max
}
}
out 0 mrt
}
compositor_node FinalCompositionNode
{
in 0 finalRender
in 1 toRenderWindow
target toRenderWindow
{
pass clear
{
}
pass render_quad
{
material ByPassMat //just copy eveything
input 0 finalRender
}
}
}
workspace Workspace
{
connect mainRenderNode 0 FinalCompositionNode 0
connect_output FinalCompositionNode 1
}Code: Select all
void Screen::renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& repeatThisInvocation)
{
if(queueGroupId == Ogre::RENDER_QUEUE_OVERLAY && mRenderSystem->_getViewport() == mViewport->getViewport(1) && mRenderSystem->_getViewport()->getOverlaysEnabled()){
if(mIsVisible && mLayers.size()){
renderOnce();
}
}
}Code: Select all
void Screen::renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& repeatThisInvocation)
{
if(queueGroupId == Ogre::RENDER_QUEUE_OVERLAY && mRenderSystem->_getViewport()->getOverlaysEnabled()){
if(mIsVisible && mLayers.size()){
renderOnce();
}
}
}
Obv it was a signal from aliens ... Jodie Foster and Matt McConaughey have been dispatched to your house to debate the scientific and religious implications respectively. John Hurt is standing by from orbit!xrgo wrote:its fixed now, I just re-estructured my project files/folders and now works again, I dont know why that happpend :S
c6burns wrote:Obv it was a signal from aliens ... Jodie Foster and Matt McConaughey have been dispatched to your house to debate the scientific and religious implications respectively. John Hurt is standing by from orbit!xrgo wrote:its fixed now, I just re-estructured my project files/folders and now works again, I dont know why that happpend :S
new in 2.1:pass->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
Code: Select all
d2Material = Ogre::MaterialManager::getSingletonPtr()->create("Gorilla2D", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Ogre::Pass* pass = d2Material->getTechnique(0)->getPass(0);
Ogre::HlmsBlendblock transparent;
Ogre::Pass::_getBlendFlags(Ogre::SceneBlendType::SBT_TRANSPARENT_ALPHA,
transparent.mSourceBlendFactor,
transparent.mDestBlendFactor);
pass->setBlendblock(transparent);
Ogre::TextureUnitState* texUnit = pass->createTextureUnitState();
texUnit->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP);
texUnit->setTextureFiltering(Ogre::FO_NONE, Ogre::FO_NONE, Ogre::FO_NONE);I guess youre lacking of:Thyrion wrote:The bitmapfonts still having the black background.
Code: Select all
Ogre::Pass::_getBlendFlags(Ogre::SBT_TRANSPARENT_ALPHA,
transparent.mSourceBlendFactorAlpha,
transparent.mDestBlendFactorAlpha);what code? i thought i did that in my last postCan you share your code?
ahaha yes, but in 2.1 I cant see anything on my screen yet, I thought you made something different for 2.1Thyrion wrote:what code? i thought i did that in my last postCan you share your code?
i just used the code from the mygui port from scrawl.ahaha yes, but in 2.1 I cant see anything on my screen yet, I thought you made something different for 2.1
Code: Select all
Ogre::IdString OgreCompositorPassProvider::mPassId = Ogre::IdString("MYGUI");
MyGUIPass::MyGUIPass(const Ogre::CompositorPassDef *definition, const Ogre::CompositorChannel &target,
Ogre::CompositorNode *parentNode, GraphicsManager& graphicsMgr)
: Ogre::CompositorPass(definition, target, parentNode) ,m_GraphicsManager(graphicsMgr)
{}
void MyGUIPass::execute(const Ogre::Camera *lodCameraconst)
{
//here i call the gorilla renderonce method from the screen .. had to make it public
//m_GraphicsManager.getGUIRenderer()._t_update();
}
m_compositorManager->setCompositorPassProvider(mPassProvider.get());
//--->>> added this pass to the CompositorTargetDef like in mygui
// For the MyGUI pass
targetDef->addPass(Ogre::PASS_CUSTOM, OgreCompositorPassProvider::mPassId);Code: Select all
Ogre::MaterialPtr TextureAtlas::createOrGet2DMasterMaterial()Code: Select all
Ogre::HlmsManager *hlmsManager = Ogre::Root::getSingletonPtr()->getHlmsManager();
Ogre::HlmsTextureManager *hlmsTextureManager = hlmsManager->getTextureManager();
Ogre::HlmsBlendblock blendBlock;
Ogre::HlmsMacroblock macroBlock;
macroBlock.mDepthWrite = false;
blendBlock.setBlendType(Ogre::SBT_TRANSPARENT_ALPHA,Ogre::SBT_TRANSPARENT_ALPHA);
Ogre::String datablockName = "transparentMatTest";
Ogre::HlmsPbsDatablock *datablock = static_cast<Ogre::HlmsPbsDatablock*>(
hlmsPbs->createDatablock( datablockName,
datablockName,
macroBlock,
blendBlock,
Ogre::HlmsParamVec() ) );
Ogre::HlmsTextureManager::TextureLocation texLocation = hlmsTextureManager->createOrRetrieveTexture( "textureWithAlpha.png", Ogre::HlmsTextureManager::TEXTURE_TYPE_DIFFUSE );
datablock->setTexture( Ogre::PBSM_DIFFUSE, texLocation.xIdx, texLocation.texture );
item->setDatablock(datablock);nope. i have no cluedid you solve the transparency issue?
I don't know why is not working with you.Thyrion wrote:nope. i have no cluedid you solve the transparency issue?i think it's just not ready ?...
You want to look for Font::loadImpl()Thyrion wrote:Thx for the answer. At least i know now it should work.
Will try it again tonight. Maybe i find the solution in the Font.cpp file.
Code: Select all
mSceneMgr->_setPass(mPass);
mRenderSystem->_render(mRenderOp);Code: Select all
mSceneMgr->_setPass(mPass);
mRenderSystem->_setHlmsBlendblock(mPass->getBlendblock());
mRenderSystem->_render(mRenderOp);