Page 1 of 1
2.0 Compositor Pink/Magenta window
Posted: Thu Sep 26, 2019 1:08 am
by libolt
Okay so I have added the compositor to my project as follows:
Code: Select all
const Ogre::IdString workspaceName( "MyOwnWorkspace" );
Ogre::CompositorManager2 *compositorManager = RERoot->getCompositorManager2();
if( !compositorManager->hasWorkspaceDefinition( workspaceName ) )
compositorManager->createBasicWorkspaceDef( workspaceName, Ogre::ColourValue( 0.6f, 0.0f, 0.6f ) );
compositorManager->addWorkspace( mSceneMgr.get(), mWindow.get(), mCamera.get(), workspaceName, true );
I adapted this from what I found in the compositor docuementaiton. Now all I get is a pink/magenta filled window. I'm guessing that there is more that needs to be done to set this up?
Re: 2.0 Compositor Pink/Magenta window
Posted: Thu Sep 26, 2019 1:25 am
by xrgo
that's the color you set as the clear color (Ogre::ColourValue( 0.6f, 0.0f, 0.6f ))
this means that the workspace its actually working, but you wont see anything else unless you put some geometry in front of the camera
Re: 2.0 Compositor Pink/Magenta window
Posted: Thu Sep 26, 2019 9:51 pm
by libolt
xrgo,
Thanks for the information. So I have attempted to add a node that has a model attached to the Compositor as follows but still only get the pink/magenta screen nothing else.
Code: Select all
activeNode = gameE->getRenderE()->createNode(activeModel, activeNodeName); // creates node
sharedPtr<Ogre::CompositorManager2> compositorManagerr = gameE->getRenderE()->getCompositorManager();
compositorManagerr->addNodeDefinition(activeNodeName);
gameE->getRenderE()->setCompositorManager(compositorManagerr);
ABIIT.second->getComponent()->setNode(activeNode); // saves node to current instance
ABIIT.second->getComponent()->getNode()->setPosition(0.8f,-5.0f,352.0f);
Is this the correct way to attach a node to the compositor?
Re: 2.0 Compositor Pink/Magenta window
Posted: Fri Sep 27, 2019 12:20 am
by xrgo
the createBasicWorkspaceDef should be enough for rendering, what I meant is that you need to load some geometry (a .mesh file) and attach it to a Ogre::SceneNode and put it in front of the camera, I have this sample code for 2.1
https://www.dropbox.com/s/st9ccu2qn5ux6 ... e.zip?dl=0, for 2.0 just omit the Hlms stuffs and set materials alla 1.X way
unless you're trying to make something special?.. the Compositor in 2.0+ is very powerful, you can control every aspect of how you render
Re: 2.0 Compositor Pink/Magenta window
Posted: Fri Sep 27, 2019 8:01 am
by libolt
xrgo,
I have to apologize. I didn't paste everything I was doing in my code. I actually load a .mesh using my old 1.x method. All I posted was the create node code that is still based on 1.x with what I thought was needed for 2.0 and the compositor.
Thank you for the example code. I have downloaded it and will take a look at it when I have time and hopefully figure out what I am doing wrong. Hopefully I can get my test code to render in 2.0 relatively soon and then move onto 2.1. I plan to migrate to doing things the 2.x way as well. I don't have a ton of meshes/materials that need to be loaded.
Thanks again