UnityEngine.Rendering.CommandBuffer.ClearRenderTarget C# (CSharp) Method

ClearRenderTarget() private method

private ClearRenderTarget ( bool clearDepth, bool clearColor, System.Color backgroundColor ) : void
clearDepth bool
clearColor bool
backgroundColor System.Color
return void
        public void ClearRenderTarget(bool clearDepth, bool clearColor, Color backgroundColor)
        {
            float depth = 1f;
            INTERNAL_CALL_ClearRenderTarget(this, clearDepth, clearColor, ref backgroundColor, depth);
        }

Same methods

CommandBuffer::ClearRenderTarget ( bool clearDepth, bool clearColor, System.Color backgroundColor, [ depth ) : void

Usage Example

コード例 #1
0
    private RenderTexture RenderPreview(Noesis.View view, int width, int height)
    {
        try
        {
            if (CanRender() && view != null && view.Content != null)
            {
                NoesisRenderer.SetRenderSettings();

                view.SetSize(width, height);
                view.Update(0.0f);

                FlushMetalEncoder(_commands);
                NoesisRenderer.RenderOffscreen(view, _commands);

                RenderTexture rt = RenderTexture.GetTemporary(width, height, 24, RenderTextureFormat.Default, RenderTextureReadWrite.Default, 8);
                _commands.SetRenderTarget(rt);
                _commands.ClearRenderTarget(true, true, UnityEngine.Color.clear, 0.0f);
                NoesisRenderer.RenderOnscreen(view, false, _commands);

                Graphics.ExecuteCommandBuffer(_commands);
                _commands.Clear();
                GL.InvalidateState();

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

        return(null);
    }
All Usage Examples Of UnityEngine.Rendering.CommandBuffer::ClearRenderTarget