UrhoSharp performance slow?

Hello. I'm just getting started with UrhoSharp.SharpReality nugget package for a UWP app I'm running on Hololens. I've created a dead-simple application with a scene where I've defined a single node, namely a red sphere. When running on Hololens I manipulate the sphere by:

public override void OnGestureManipulationUpdated(Vector3 relativeHandPosition)
{
    base.OnGestureManipulationUpdated(relativeHandPosition);

    manipulatedHologram.Position += relativeHandPosition - previousHandPosition;
    previousHandPosition = relativeHandPosition;
}

This works and I can move the sphere around. Unfortunately the performance of the rendering is not very good. The sphere moves but with a high-frequency jitter (as if it's being rendered on the CPU). Whenever I manipulate holograms using Microsoft's built in hologram viewer app their motion when manipulated is buttery-smooth. What is the cause of this and how can I improve the visual experience?

Best Answer

Answers

  • utekaiutekai USMember ✭✭✭

    There are some samples with that same manipulation coded in, why not try one of those and see how it goes?

    You might also notice subtle but important differences between that working sample and your dead-simple code.

  • LKeeneLKeene Member ✭✭

    I've just tried the "HelloWorldAdvanced" example app and it too displays the same effect. Moving the earth node around shows high-frequency jitter whereas manipulating a UWP app window (or built-in hologram) is buttery smooth. Is this a limitation of UrhoSharp?

  • utekaiutekai USMember ✭✭✭

    People see differently. One person looked at an app, just last night, and talked about flicker and experienced mild motion sickness. No one else saw it or experienced it.

    You could turn on the DebugHud and see what your framerate is. I use code like this to show/toggle debughud.

    private void ShowHud(string text, bool show = true) //MONO only, shows up in right eye
            {
                monoDebugHud = monoDebugHud ?? new MonoDebugHud(this){AdditionalText = text,FpsOnly = false};
                if (show) monoDebugHud.Show(Color.Green, 50); else monoDebugHud.Hide();
            }
    
  • LKeeneLKeene Member ✭✭

    I'm getting 60fps which I suppose is normal. Strange how the result is not as good as I'd hoped.

  • LKeeneLKeene Member ✭✭

    Actions helped greatly. The following did the trick:

    MoveBy moveAction = new MoveBy(0.1f, displacementVector);
    myNode.RunActions(moveAction);
    
Sign In or Register to comment.