Ejemplo n.º 1
0
            /// <summary>
            /// Execute the render commands to blit the camera background texture.
            /// </summary>
            /// <param name="context">The render context for executing the render commands.</param>
            /// <param name="renderingData">Additional rendering data about the current state of rendering.</param>
            public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
            {
                var cmd = CommandBufferPool.Get(k_CustomRenderPassName);

                ARCameraBackground.AddOpenGLES3ResetStateCommand(cmd);
                cmd.SetInvertCulling(m_InvertCulling);
                Blit(cmd, m_Texture, m_ColorTargetIdentifier, m_Material);
                context.ExecuteCommandBuffer(cmd);

                CommandBufferPool.Release(cmd);
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Execute the commands to render the camera background.
            /// </summary>
            /// <param name="context">The render context for executing the render commands.</param>
            /// <param name="renderingData">Additional rendering data about the current state of rendering.</param>
            public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
            {
                var cmd = CommandBufferPool.Get(k_CustomRenderPassName);

                cmd.BeginSample(k_CustomRenderPassName);

                ARCameraBackground.AddOpenGLES3ResetStateCommand(cmd);
                cmd.SetInvertCulling(m_InvertCulling);

                cmd.SetViewProjectionMatrices(Matrix4x4.identity, k_BackgroundOrthoProjection);
                cmd.DrawMesh(m_BackgroundMesh, Matrix4x4.identity, m_BackgroundMaterial);
                cmd.SetViewProjectionMatrices(renderingData.cameraData.camera.worldToCameraMatrix,
                                              renderingData.cameraData.camera.projectionMatrix);

                cmd.EndSample(k_CustomRenderPassName);
                context.ExecuteCommandBuffer(cmd);

                CommandBufferPool.Release(cmd);
            }