Exemple #1
0
        /// <summary>Copy a camera sized texture into the texture buffers.</summary>
        /// <param name="cmd">the command buffer to use for the copy.</param>
        /// <param name="aovBufferId">The id of the buffer to copy.</param>
        /// <param name="camera">The camera associated with the source texture.</param>
        /// <param name="source">The source texture to copy</param>
        /// <param name="targets">The target texture buffer.</param>
        internal void PushCameraTexture(
            CommandBuffer cmd,
            AOVBuffers aovBufferId,
            HDCamera camera,
            RTHandle source,
            List <RTHandle> targets
            )
        {
            if (!isValid)
            {
                return;
            }

            Assert.IsNotNull(m_RequestedAOVBuffers);
            Assert.IsNotNull(targets);

            var index = Array.IndexOf(m_RequestedAOVBuffers, aovBufferId);

            if (index == -1)
            {
                return;
            }

            HDUtils.BlitCameraTexture(cmd, source, targets[index]);
        }
Exemple #2
0
        internal void PushCameraTexture(
            RenderGraph renderGraph,
            AOVBuffers aovBufferId,
            HDCamera camera,
            TextureHandle source,
            List <RTHandle> targets
            )
        {
            if (!isValid || m_RequestedAOVBuffers == null)
            {
                return;
            }

            Assert.IsNotNull(m_RequestedAOVBuffers);
            Assert.IsNotNull(targets);

            var index = Array.IndexOf(m_RequestedAOVBuffers, aovBufferId);

            if (index == -1)
            {
                return;
            }

            using (var builder = renderGraph.AddRenderPass <PushCameraTexturePassData>("Push AOV Camera Texture", out var passData, ProfilingSampler.Get(HDProfileId.AOVOutput + (int)aovBufferId)))
            {
                passData.source = builder.ReadTexture(source);
                passData.target = targets[index];

                builder.SetRenderFunc(
                    (PushCameraTexturePassData data, RenderGraphContext ctx) =>
                {
                    HDUtils.BlitCameraTexture(ctx.cmd, data.source, data.target);
                });
            }
        }
Exemple #3
0
        /// <summary>Copy a camera sized texture into the texture buffers.</summary>
        /// <param name="cmd">the command buffer to use for the copy.</param>
        /// <param name="aovBufferId">The id of the buffer to copy.</param>
        /// <param name="camera">The camera associated with the source texture.</param>
        /// <param name="source">The source texture to copy</param>
        /// <param name="targets">The target texture buffer.</param>
        internal void PushCameraTexture(
            CommandBuffer cmd,
            AOVBuffers aovBufferId,
            HDCamera camera,
            RTHandle source,
            List <RTHandle> targets
            )
        {
            if (!isValid || m_RequestedAOVBuffers == null)
            {
                return;
            }

            Assert.IsNotNull(m_RequestedAOVBuffers);
            Assert.IsNotNull(targets);

            var index = Array.IndexOf(m_RequestedAOVBuffers, aovBufferId);

            if (index == -1)
            {
                return;
            }

            using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.AOVOutput + (int)aovBufferId)))
            {
                HDUtils.BlitCameraTexture(cmd, source, targets[index]);
            }
        }
    RTHandle RTAllocator(AOVBuffers bufferID)
    {
        if (bufferID == AOVBuffers.Color)
        {
            return(rtColor ?? (rtColor = RTHandles.Alloc(diffuse.width, diffuse.height, 1, DepthBits.None, GraphicsFormat.R8G8B8A8_SRGB)));
        }

        return(null);
    }
Exemple #5
0
        internal void PushCameraTexture(
            RenderGraph renderGraph,
            AOVBuffers aovBufferId,
            HDCamera camera,
            RenderGraphResource source,
            List <RTHandle> targets
            )
        {
            if (!isValid)
            {
                return;
            }

            Assert.IsNotNull(m_RequestedAOVBuffers);
            Assert.IsNotNull(targets);

            var index = Array.IndexOf(m_RequestedAOVBuffers, aovBufferId);

            if (index == -1)
            {
                return;
            }

            using (var builder = renderGraph.AddRenderPass <PushCameraTexturePassData>("Push AOV Camera Texture", out var passData))
            {
                passData.requestIndex = index;
                passData.source       = builder.ReadTexture(source);
                passData.targets      = targets;

                builder.SetRenderFunc(
                    (PushCameraTexturePassData data, RenderGraphContext ctx) =>
                {
                    HDUtils.BlitCameraTexture(ctx.cmd, ctx.resources.GetTexture(data.source), data.targets[data.requestIndex]);
                });
            }
        }
Exemple #6
0
 RTHandle RTAllocator(AOVBuffers bufferID)
 {
     return(_rt ?? (_rt = RTHandles.Alloc(_outputTexture.width, _outputTexture.height)));
 }