Search Unity

Unity engine as in-process dll

Discussion in 'Windows' started by benjicoh, Nov 16, 2017.

  1. benjicoh

    benjicoh

    Joined:
    Dec 21, 2014
    Posts:
    5
    We're looking into incorporating a rendering engine to our product, we're currently rendering 3D with native opengl.

    We looked into unity's set of features and we want to know if with enterprise edition we can have the following
    * Ability to run unity engine in-proc (from windows standalone PC) preferably by referencing dll(s)
    * Can single unity engine instance support rendering on multiple Win32 handles ?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Yes, these are doable. Different Unity editions don't come with different engine features, so it would be doable with any of them. They just have different licensing conditions and support packages:

    https://unity3d.com/legal/terms-of-service/software

    #1 got enabled with the most recent update of Unity 2017.2. We now ship the engine code in a DLL (UnityPlayer.dll) on Windows Standalone while the executable is a simple wrapper that calls into the DLL (we ship the source code for that small executable in the installer). You could replace the executable with your own and call into our code the same way.

    #2 is a little bit more tricky since we don't have direct support for that, however, you could render to a RenderTexture on the engine side, pass the D3D/OpenGL handle down to your native code and blit to the screen from there.
     
    benjicoh likes this.
  3. benjicoh

    benjicoh

    Joined:
    Dec 21, 2014
    Posts:
    5
    Thanks for the detailed answer