n91
When I am rendering scene to texture and displaying only UI elements, screen doesn’t seem to be cleared:
The simplified code (in C# via UrhoSharp) producing this is following:
Text helloText;
protected override void Start()
{
helloText = new Text();
helloText.SetFont(font: ResourceCache.GetFont("Fonts/Font.ttf"), size: 15);
UI.Root.AddChild(helloText);
var scene = new Scene();
scene.CreateComponent<Octree>();
var camera = scene.CreateChild("camera").CreateComponent<Camera>();
var tx = new Texture2D();
tx.SetSize(10, 10, Graphics.RGBFormat, TextureUsage.Rendertarget);
var rs = tx.RenderSurface;
rs.UpdateMode = RenderSurfaceUpdateMode.Updatealways;
rs.SetViewport(0, new Viewport(scene, camera, null));
}
protected override void OnUpdate(float timeStep)
{
helloText.Value = ((char)(DateTime.Now.Second % 4 + 'A')).ToString();
}
However when I the render surface part. The output is what I want:
What I am doing wrong? Is it a feature/bug of UrhoSharp/Urho3d?