Clear() private method

private Clear ( ) : void
return void
Example #1
0
        public static void InitializeEncoder(IntPtr callback, IntPtr track)
        {
            _command.IssuePluginEventAndData(callback, (int)VideoStreamRenderEventId.Initialize, track);

            Graphics.ExecuteCommandBuffer(_command);
            _command.Clear();
        }
    private RenderTexture RenderPreview(Noesis.View view, int width, int height)
    {
        try
        {
            if (CanRender() && view != null)
            {
                view.SetSize(width, height);
                view.Update(0.0f);

                RenderTexture rt = RenderTexture.GetTemporary(width, height, 24, RenderTextureFormat.Default, RenderTextureReadWrite.Default, 8);

                _commands.Clear();
                NoesisRenderer.RenderOffscreen(view, _commands);
                _commands.SetRenderTarget(rt);
                _commands.ClearRenderTarget(true, true, UnityEngine.Color.clear, 0.0f);
                NoesisRenderer.RenderOnscreen(view, false, _commands);
                Graphics.ExecuteCommandBuffer(_commands);

                RenderTexture.ReleaseTemporary(rt);

                return(rt);
            }
        }
        catch (System.Exception e)
        {
            UnityEngine.Debug.LogException(e);
        }

        return(null);
    }
Example #3
0
    private void CreatePreviewView()
    {
        try
        {
            NoesisXaml       xaml = (NoesisXaml)target;
            FrameworkElement root = xaml.Load() as FrameworkElement;
            _viewPreview = Noesis.GUI.CreateView(root);
            _viewPreview.SetFlags(IsGL() ? 0 : RenderFlags.FlipY);

            NoesisRenderer.RegisterView(_viewPreview, _commands);
            Graphics.ExecuteCommandBuffer(_commands);
            _commands.Clear();
        }
        catch (System.Exception e)
        {
            UnityEngine.Debug.LogException(e);
        }
    }
Example #4
0
 public static void UpdateRendererTexture(IntPtr callback, Texture texture, uint rendererId)
 {
     if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D12)
     {
         throw new NotSupportedException(
                   "CommandBuffer.IssuePluginCustomTextureUpdateV2 method is Direct3D12 is not supported ");
     }
     _command.IssuePluginCustomTextureUpdateV2(callback, texture, rendererId);
     Graphics.ExecuteCommandBuffer(_command);
     _command.Clear();
 }
 static public int Clear(IntPtr l)
 {
     try {
         UnityEngine.Rendering.CommandBuffer self = (UnityEngine.Rendering.CommandBuffer)checkSelf(l);
         self.Clear();
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int Clear(IntPtr l)
 {
     try {
         UnityEngine.Rendering.CommandBuffer self = (UnityEngine.Rendering.CommandBuffer)checkSelf(l);
         self.Clear();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #7
0
        public static void UpdateRendererTexture(IntPtr callback, Texture texture, uint rendererId)
        {
#if !UNITY_2020_1_OR_NEWER
            if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D12)
            {
                throw new NotSupportedException(
                          "CommandBuffer.IssuePluginCustomTextureUpdateV2 method is not supported " +
                          "when using Direct3D12 on Unity2019 or older.");
            }
#endif
            _command.IssuePluginCustomTextureUpdateV2(callback, texture, rendererId);
            Graphics.ExecuteCommandBuffer(_command);
            _command.Clear();
        }
    private void CreateView()
    {
        try
        {
            FrameworkElement root = GetRoot();
            _view = Noesis.GUI.CreateView(root);
            _view.SetFlags(IsGL() ? 0 : RenderFlags.FlipY);

            _commands.Clear();
            NoesisRenderer.RegisterView(_view, _commands);
            Graphics.ExecuteCommandBuffer(_commands);
        }
        catch (System.Exception e)
        {
            UnityEngine.Debug.LogException(e);
        }
    }
Example #9
0
 // trackId で受信した映像を texutre にレンダリングする
 public void RenderTrackToTexture(uint trackId, UnityEngine.Texture texture)
 {
     commandBuffer.IssuePluginCustomTextureUpdateV2(sora_get_texture_update_callback(), texture, trackId);
     UnityEngine.Graphics.ExecuteCommandBuffer(commandBuffer);
     commandBuffer.Clear();
 }
Example #10
0
 public static void UpdateRendererTexture(IntPtr callback, Texture texture, uint rendererId)
 {
     _command.IssuePluginCustomTextureUpdateV2(callback, texture, rendererId);
     Graphics.ExecuteCommandBuffer(_command);
     _command.Clear();
 }