Here below, how was the workflow in OGRE 2.1:
Code: Select all
// Create RTT texture
m_texture = TextureManager::getSingleton().createManual(m_nameInternal, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D,
viewInfo->Width, viewInfo->Height, 0, PF_BYTE_RGBA, TU_RENDERTARGET);
Code: Select all
// Assign depth/stencil buffer to RTT texture and bind them to Coherent GT view
const auto renderTarget = m_texture->getBuffer()->getRenderTarget();
Root::getSingleton().getRenderSystem()->setDepthBufferFor(renderTarget, true);
auto renderTargetNative = NativeRenderTarget{};
renderTargetNative.DepthStencilTexture = static_cast<D3D11DepthBuffer*>(renderTarget->getDepthBuffer())->getDepthStencilView(0);
renderTarget->getCustomAttribute("ID3D11RenderTargetView", &renderTargetNative.Texture);
m_viewRenderer = WebPageManager::getSingleton().renderer()->CreateViewRenderer(m_view, renderTargetNative, m_texture->getWidth(),
m_texture->getHeight(), 1);
Code: Select all
// Set RTT texture to overlay datablock
datablockUnlit->setTexture(0, 0, m_texture);
Code: Select all
// Between SceneManager::updateSceneGraph and Root::_updateAllRenderTargets ...
// Render UI to RTT texture
m_viewRenderer()->Paint();
Code: Select all
m_texture = Root::getSingleton().getRenderSystem()->getTextureGpuManager()->createTexture(m_nameInternal, GpuPageOutStrategy::Discard,
TextureFlags::RenderToTexture, TextureTypes::Type2D);
So far so good till now, but I'm a bit lost about how to convert the second block of code. Since there's a ID3D11RenderTargetView object in the field, I guess I have to deal with a RenderPassDescriptor. Am I right?
About RenderPassDescriptor, is not really clear to me (since there's no example...

