Made some changes but this still isn't working out.
I am trying to places axes.mesh in the lower corner of my main render window (which I think is an RT for rendering target, not sure what RTT means). With the following configuration, my axes window is not showing up.
So I have two cameras setup and two workspaces in setupCompositor(). Each workspace has it's own camera and SceneManager.
Code: Select all
void GraphicsSystem::createCameras(void)
{
camera = sceneManager->createCamera("MainCamera");
camera->setPosition(Ogre::Vector3(0, 5, 15));
camera->lookAt(Ogre::Vector3(0, 0, 0));
camera->setNearClipDistance(0.2f);
camera->setFarClipDistance(1000.0f);
camera->setAutoAspectRatio(true);
axesCamera = axesSceneManager->createCamera("AxesCamera");
axesCamera->setPosition(Ogre::Vector3(0, 5, 15));
axesCamera->lookAt(Ogre::Vector3(0, 0, 0));
axesCamera->setNearClipDistance(0.2f);
axesCamera->setFarClipDistance(1000.0f);
axesCamera->setAutoAspectRatio(true);
}
void GraphicsSystem::setupCompositor(void)
{
Ogre::CompositorManager2 *compositorManager =
root->getCompositorManager2();
const Ogre::String mainWorkspaceName("MainWorkspace");
if (!compositorManager->hasWorkspaceDefinition(mainWorkspaceName)) {
compositorManager->createBasicWorkspaceDef(mainWorkspaceName,
mainBackgroundColor, Ogre::IdString());
}
workspaces->push_back(compositorManager->addWorkspace(sceneManager,
renderWindow->getTexture(), camera, mainWorkspaceName, true));
const Ogre::String axesWorkspaceName("AxesWorkspace");
if (!compositorManager->hasWorkspaceDefinition(axesWorkspaceName)) {
compositorManager->createBasicWorkspaceDef(axesWorkspaceName,
axesBackgroundColor, Ogre::IdString());
}
workspaces->push_back(compositorManager->addWorkspace(axesSceneManager,
renderWindow->getTexture(), axesCamera, axesWorkspaceName, true));
}
Then I have the following two scripts. My axes.compositor script.
Code: Select all
compositor_node AxesRenderingNode
{
in 0 rt_axesWindow
target rt_axesWindow
{
pass render_scene
{
viewport 0.0 0.0 0.3 0.3
rq_first 240
rq_last 241
}
}
out 0 rt_axesWindow
}
workspace AxesRenderingWorkspace
{
connect_output AxesRenderingNode 0
}
And my main.compositor script.
Code: Select all
compositor_node MainRenderingNode
{
in 0 rt_renderWindow
target rt_renderWindow
{
pass clear { }
pass render_scene
{
rq_first 0
rq_last 240
}
}
out 0 rt_renderWindow
}
workspace MainWorkspace
{
connect_output MainRenderingNode 0
}
The problem is that I don't see the axes window show up anywhere's. The main rendering window works just fine as expected.
Thoughts?