Example #1
0
    public AirXRServerMediaStream(int playerID, AirXRClientConfig config, int cameraCount)
    {
        currentFramebufferIndex = 0;
        _cameraCount            = cameraCount;

        _framebuffers = new RenderTexture[FramebufferCount * cameraCount];
        IntPtr[] framebuffers = new IntPtr[FramebufferCount * cameraCount];
        for (int f = 0; f < FramebufferCount; f++)
        {
            for (int t = 0; t < cameraCount; t++)
            {
                RenderTexture texture = new RenderTexture(config.videoWidth / cameraCount, config.videoHeight, 24);
                texture.antiAliasing     = 1;
                texture.autoGenerateMips = false;
                texture.useMipMap        = false;
                texture.filterMode       = FilterMode.Bilinear;
                texture.anisoLevel       = 0;
                texture.format           = RenderTextureFormat.ARGB32;
                texture.Create();

                _framebuffers[f * cameraCount + t] = texture;
                framebuffers[f * cameraCount + t]  = texture.GetNativeTexturePtr();
            }
        }

        AXRServerPlugin.RegisterFramebufferTextures(playerID, framebuffers, cameraCount, FramebufferCount);
    }