Azure / azure-remote-rendering

SDK and samples for Azure Remote Rendering
MIT License
106 stars 38 forks source link

[Remote rendering problem] RemoteManagerStatic.StartupRemoteRendering not working #107

Closed whatthemehek closed 1 year ago

whatthemehek commented 1 year ago

When trying to create a custom remote rendering script, I am running into a odd crash. Referring to the RenderingSession documentation, I created an async function called InitRenderingSession, called on Start, using the example code as a basis:

async void InitRenderingSession()
    {
        RemoteRenderingInitialization init = new RemoteRenderingInitialization();
        Debug.Log("successful RRI");
        init.GraphicsApi = GraphicsApiType.SimD3D11;
        init.ConnectionType = ConnectionType.General;
        init.Right = Axis.X;
        init.Up = Axis.Y;
        init.Forward = Axis.Z;
        init.UnitsPerMeter = 1f;

        RemoteManagerStatic.StartupRemoteRendering(init);

        (...)

However, when I run my script, calling InitRenderingSession() in Start(), I receive the following error:

RRException: Could not initialize remote rendering.
Microsoft.Azure.RemoteRendering.RemoteManagerStatic.StartupRemoteRendering (Microsoft.Azure.RemoteRendering.RemoteRenderingInitialization managerInit) (at C:/Users/xxxx/xxxx/projectname/Library/PackageCache/com.microsoft.azure.remote-rendering@76edc76b5e3d/Runtime/Service/RemoteManagerStatic.cs:46)
CustomScript+<InitRenderingSession>d__8.MoveNext () (at Assets/RemoteRenderingCore/Scripts/CustomScript.cs:50)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) (at <695d1cc93cca45069c528c15c9fdd749>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <913bb12059fd4cef8da5cc94ad2f0933>:0)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()

Is there a step I am missing that is causing RemoteManagerStatic.StartupRemoteRendering to fail?

jloehr commented 1 year ago

Hi again, which documentation are you referring? Can you post a link?

From the posted Stacktrace, it looks like it's a Unity project. When using Unity, please stick to using the provided RemoteManagerUnity following the documentation: Set up Remote Rendering for Unity or Tutorial: Viewing a remotely rendered model. For ARR to work in Unity various set ups and hooks are required, which RemoteManagerUnity takes care of.

whatthemehek commented 1 year ago

Switched to RemoteManagerUnity, getting a different error so I am opening a new issue regarding that.