Porting Gorilla
- Thyrion
- Goblin
- Posts: 224
- Joined: Wed Jul 31, 2013 1:58 pm
- Location: germany
- x 8
Re: Porting Gorilla
what rendersystem do you use? just to be sure. font 40 exists in your gorilla file?
-
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
OgreGLRenderSystem
yes font 40 does exists =)
thank!
yes font 40 does exists =)
thank!
- Thyrion
- Goblin
- Posts: 224
- Joined: Wed Jul 31, 2013 1:58 pm
- Location: germany
- x 8
Re: Porting Gorilla
i am using directx 11 currently and it works.
i think november's version should work, because he showed a working example vid
but i didn't tried his version.
if i would have this problem, i would set a breakpoint in void Screen::renderQueueEnded( ... and would look if the caption is realy in the rendered layers.
i don't think there is a problem with opengl renderer, else november had said something?
tried to render a rectangle with background?
i think november's version should work, because he showed a working example vid
if i would have this problem, i would set a breakpoint in void Screen::renderQueueEnded( ... and would look if the caption is realy in the rendered layers.
i don't think there is a problem with opengl renderer, else november had said something?
tried to render a rectangle with background?
-
N0vember
- Gremlin
- Posts: 196
- Joined: Tue Jan 27, 2009 12:27 am
- x 24
Re: Porting Gorilla
Well Ogre 2.0 won't render anything if you didn't create a Workspace.
Did you set one up ? If not how was the viewport created ? That's the code I would look at.
Also you don't even have to bother with viewports if you're going to render to the whole screen, just pass the window RenderTarget to gorilla.
(Actually I'm thinking this may be the reason, if you did setup a Workspace, try replacing the viewport with the renderwindow itself to see if that makes a difference)
Example :
Did you set one up ? If not how was the viewport created ? That's the code I would look at.
Also you don't even have to bother with viewports if you're going to render to the whole screen, just pass the window RenderTarget to gorilla.
(Actually I'm thinking this may be the reason, if you did setup a Workspace, try replacing the viewport with the renderwindow itself to see if that makes a difference)
Example :
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 -
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
Thank you very much for your response!
It actually works now! (maybe has been working all the time) but... only when using "createBasicWorkspaceDef", the problem is that I am using a workspace defined in a script file, and I am adding it like this:
compositorManager->addWorkspace( sceneManager, renderWindow, mainCamera, "Workspace", true );
and I can see all my objects ok
this is my workspace:
I am doing some post process effects in between, they work, I just removed them for now to test
Thanks for everything!
It actually works now! (maybe has been working all the time) but... only when using "createBasicWorkspaceDef", the problem is that I am using a workspace defined in a script file, and I am adding it like this:
compositorManager->addWorkspace( sceneManager, renderWindow, mainCamera, "Workspace", true );
and I can see all my objects ok
this is my workspace:
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
}Thanks for everything!
-
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
Hi! I managed to make it work by changing this:
to this:
the bad thing is that I am getting post process effects on top of gorilla, maybe I have to create a different compositor pass or something. but its good enough for now since I am just using it for simple stuffs
thank you very much for the help!
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();
}
}
}thank you very much for the help!
-
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
WTF, I just updated ogre (hg pull && hg update v2-0-0RC1) build it again... and now my Gorilla stuffs looks like this xD

I made a sky, the sun and the moon are a texture in a plane, and when either of those appears on the screen those gorilla "letters" actually disappear

I made a sky, the sun and the moon are a texture in a plane, and when either of those appears on the screen those gorilla "letters" actually disappear
-
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
its fixed now, I just re-estructured my project files/folders and now works again, I dont know why that happpend :S
- c6burns
- Beholder
- Posts: 1512
- Joined: Fri Feb 22, 2013 4:44 am
- Location: Deep behind enemy lines
- x 139
Re: Porting Gorilla
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
- Klaim
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
- Contact:
-
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
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
-
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
Anyone got this working with Ogre 2.1?
I have the materials with shaders
I noticed that Screen::renderQueueEnded is not getting called
I have the materials with shaders
I noticed that Screen::renderQueueEnded is not getting called
- AlexeyKnyshev
- Goblin
- Posts: 213
- Joined: Sat May 26, 2012 10:37 am
- Location: Russia
- x 13
Re: Porting Gorilla
Please, create pull requests into git repository as soon as you have a progress in your development. Community is interested in Ogre 2.x port of Gorilla.
Regards, Alexey Knyshev
Regards, Alexey Knyshev
Voltage Engine - boost your ogre project with realtime physics and interactive scripting!
OgreBullet & CMake - easy to use bullet physics integration.
OgreBullet & CMake - easy to use bullet physics integration.
- Thyrion
- Goblin
- Posts: 224
- Joined: Wed Jul 31, 2013 1:58 pm
- Location: germany
- x 8
Re: Porting Gorilla
Shouldn't that make the 2d material transparent?
old from working 2.0:
The bitmapfonts still having the black background.
old from working 2.0:
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);- Attachments
-
- gorilla.png (3.01 KiB) Viewed 6366 times
-
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
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);Can you share your code?
- Thyrion
- Goblin
- Posts: 224
- Joined: Wed Jul 31, 2013 1:58 pm
- Location: germany
- x 8
Re: Porting Gorilla
what code? i thought i did that in my last postCan you share your code?
-
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
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?
Screen::renderQueueEnded its not being called =(
- Thyrion
- Goblin
- Posts: 224
- Joined: Wed Jul 31, 2013 1:58 pm
- Location: germany
- x 8
Re: Porting Gorilla
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
http://www.ogre3d.org/addonforums/viewt ... 17&t=30366
https://github.com/MyGUI/mygui/commit/8 ... f5574f934c
i picked out the compositorprovider.
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);in the function:
Code: Select all
Ogre::MaterialPtr TextureAtlas::createOrGet2DMasterMaterial()-
xrgo
- OGRE Expert User

- Posts: 1148
- Joined: Sat Jul 06, 2013 10:59 pm
- Location: Chile
- x 169
Re: Porting Gorilla
Thank you! did you solve the transparency issue?
I am having the same problem even with other materials, SBT_TRANSPARENT_ALPHA dont work, but SBT_ADD, SBT_MODULATE, etc they do.
I cant make transparent objects =(, I guess its the same issue you're having
This is my code, in this case pbs:
I am having the same problem even with other materials, SBT_TRANSPARENT_ALPHA dont work, but SBT_ADD, SBT_MODULATE, etc they do.
I cant make transparent objects =(, I guess its the same issue you're having
This is my code, in this case pbs:
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);- Thyrion
- Goblin
- Posts: 224
- Joined: Wed Jul 31, 2013 1:58 pm
- Location: germany
- x 8
Re: Porting Gorilla
nope. i have no cluedid you solve the transparency issue?
- dark_sylinc
- OGRE Team Member

- Posts: 5586
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1413
- Contact:
Re: Porting Gorilla
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 ?...
If transparent modes wouldn't be working, text rendering wouldn't work; and other UI code we have in an client engine wouldn't work either.
- Thyrion
- Goblin
- Posts: 224
- Joined: Wed Jul 31, 2013 1:58 pm
- Location: germany
- x 8
Re: Porting Gorilla
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.
Will try it again tonight. Maybe i find the solution in the Font.cpp file.
- dark_sylinc
- OGRE Team Member

- Posts: 5586
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1413
- Contact:
Re: Porting Gorilla
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.
Also load Samples\Media\packs\OgreCore.zip and checkout HlmsTranslator::translate (remember the old gui widgets before SampleBrowser took over?) to see how they are getting parsed. They work as well.
-
N0vember
- Gremlin
- Posts: 196
- Joined: Tue Jan 27, 2009 12:27 am
- x 24
Re: Porting Gorilla
YEEEES
I got it to work
So it seems... When manually rendering with a RenderOp. (Which is the way Gorilla draws stuff for now)
- The scene blend parameter specified in the v1 material script does nothing at all.
- Setting the blendblock on the v1 material doesn't actually do anything at all.
- But setting the blendblock manually on the rendersystem before calling _render works.
Mattias, would that be a bug ? I'm a bit lost here but it feels a bit like something in the old materials got broken and no one noticed because Hlms is the way forward.
Or is it a side-effect of drawing manually with a material which is just not supposed to work anymore ?
It's different from how the Overlay are drawn with transparency, because they use Hlms, and here we are not using Hlms at all.
The drawing code was like this :
Now to render with the material transparency you have to do like this :
Shouldn't that have been handled by SceneManager::_setPass or RenderSystem::_render ?
I got it to work
So it seems... When manually rendering with a RenderOp. (Which is the way Gorilla draws stuff for now)
- The scene blend parameter specified in the v1 material script does nothing at all.
- Setting the blendblock on the v1 material doesn't actually do anything at all.
- But setting the blendblock manually on the rendersystem before calling _render works.
Mattias, would that be a bug ? I'm a bit lost here but it feels a bit like something in the old materials got broken and no one noticed because Hlms is the way forward.
Or is it a side-effect of drawing manually with a material which is just not supposed to work anymore ?
It's different from how the Overlay are drawn with transparency, because they use Hlms, and here we are not using Hlms at all.
The drawing code was like this :
Code: Select all
mSceneMgr->_setPass(mPass);
mRenderSystem->_render(mRenderOp);Code: Select all
mSceneMgr->_setPass(mPass);
mRenderSystem->_setHlmsBlendblock(mPass->getBlendblock());
mRenderSystem->_render(mRenderOp);- Thyrion
- Goblin
- Posts: 224
- Joined: Wed Jul 31, 2013 1:58 pm
- Location: germany
- x 8
Re: Porting Gorilla
lol nice (Your're the man!
). It works realy ... just one line of code is needed O.o
Already startet to convert the v1 namespaces XD.
Already startet to convert the v1 namespaces XD.
- VertexElement -> VertexElement2
- RenderOperation-> VertexArrayObject
- HardwareBufferManager-> VaoManager