Sasha7b9o
Hi.
Create texture and surface thus:
[code] Node* nodeCameraTarget = gScene->CreateChild(“CameraTarget”);
Camera* cameraTarget = nodeCameraTarget->CreateComponent();
cameraTarget->SetNearClip(1.0f);
cameraTarget->SetFarClip(radiusDetect);
SharedPtr<Texture2D> renderTexture = new Texture2D(gContext);
renderTexture->SetSize(SIZE_WINDOW_TARGET, SIZE_WINDOW_TARGET, D3DFMT_X8R8G8B8, Urho3D::TEXTURE_RENDERTARGET);
renderTexture->SetFilterMode(Urho3D::FILTER_DEFAULT);
SharedPtr<RenderSurface> renderSurface = renderTexture->GetRenderSurface();
SharedPtr<Viewport> viewport(new Viewport(gContext, gScene, cameraTarget));
renderSurface->SetViewport(0, viewport);
renderSurface->SetUpdateMode(Urho3D::SURFACE_UPDATEALWAYS);[/code]
In event E_POSTRENDERUPDATE call
contents buffer is 0xcd, 0xcd, 0xcd …
renderTexture It is stored separately, the image from it is planned to bring to UI.