Exemplo n.º 1
0
 private void SetActiveRT(CommandBuffer command, RenderTargetIdentifier renderTargetIdentifier)
 {
     if (_activeRTI != _sourceRTI)
     {
         TempRTManager.Release(command, _activeRTI);
     }
     _activeRTI = renderTargetIdentifier;
 }
Exemplo n.º 2
0
 public void BlitBackToSource(CommandBuffer cmd)
 {
     if (_activeRTI == _sourceRTI)
     {
         return;
     }
     cmd.Blit(_activeRTI, _sourceRTI);
     TempRTManager.Release(cmd, _activeRTI);
     _activeRTI = _sourceRTI;
 }
Exemplo n.º 3
0
        public void BlitAndSwap(CommandBuffer cmd, Material material, int pass = 0)
        {
            var from = _activeRTI;
            RenderTargetIdentifier to;

            if (_activeRTI == _sourceRTI)
            {
                to = TempRTManager.Request(cmd, sourceRenderTextureDescriptor);
            }
            else
            {
                to = _sourceRTI;
            }
            if (material == null)
            {
                cmd.Blit(from, to);
            }
            else
            {
                cmd.Blit(from, to, material, pass);
            }
            SetActiveRT(cmd, to);
        }
Exemplo n.º 4
0
 public void ReleaseTemporaryRT(CommandBuffer command, RenderTargetIdentifier id)
 {
     TempRTManager.Release(command, id);
 }
Exemplo n.º 5
0
        public RenderTargetIdentifier GetTemporaryRT(CommandBuffer cmd, RenderTextureDescriptor descriptor, FilterMode filter = FilterMode.Point)
        {
            var id = TempRTManager.Request(cmd, descriptor, filter);

            return(id);
        }
Exemplo n.º 6
0
        public RenderTargetIdentifier GetTemporaryRT(CommandBuffer cmd)
        {
            var id = TempRTManager.Request(cmd, sourceRenderTextureDescriptor);

            return(id);
        }
Exemplo n.º 7
0
 internal void Release(CommandBuffer command)
 {
     TempRTManager.EndFrame();
 }