public BasicPipeInstance(Color clearColor, ComputeShader mainShader, List <RenderPipelineConfigObject> allConfig)
        {
            m_clearColor = clearColor;
            m_mainShader = mainShader;
            m_allConfig  = allConfig;

            if (m_mainShader == null)
            {
                Debug.LogError("Main Shader is gone");
                return;
            }

            commands = new CommandBuffer {
                name = s_bufferName
            };

            m_secondaryRaysBuffer = new ComputeBuffer(16, RTRay.Stride);
            List <RTRay> secondaryRayPlaceholder = new List <RTRay>();

            for (int i = 0; i < 16; i++)
            {
                secondaryRayPlaceholder.Add(new RTRay());
            }
            m_secondaryRaysBuffer.SetData(secondaryRayPlaceholder);

            m_geometryInstanceBuffers = new SortedList <ISIdx, ComputeBuffer>();

            kIndex = mainShader.FindKernel("CSMain");

            m_config = m_allConfig[0];
        }
Exemple #2
0
        public BasicPipeInstance(Color clearColor, ComputeShader mainShader, List <RenderPipelineConfigObject> allConfig)
        {
            m_clearColor = clearColor;
            m_mainShader = mainShader;
            m_allConfig  = allConfig;

            commands = new CommandBuffer {
                name = s_bufferName
            };

            kIndex = mainShader.FindKernel("CSMain");

            m_config = m_allConfig[0];
            InitSceneParsing();
        }
        public BasicPipeInstance(Color clearColor, ComputeShader mainShader, List <RenderPipelineConfigObject> allConfig)
        {
            m_clearColor = clearColor;
            m_mainShader = mainShader;
            m_allConfig  = allConfig;

            if (m_mainShader == null)
            {
                Debug.LogError("Main Shader is gone");
                return;
            }

            commands = new CommandBuffer {
                name = s_bufferName
            };

            kIndex = mainShader.FindKernel("CSMain");

            m_config = m_allConfig[0];
        }
 private void RunSetAmbientToMainShader(RenderPipelineConfigObject config)
 {
     m_mainShader.SetVector("_AmbientLightUpper", config.upperAmbitent);
 }
 private void RunSetMissShader(ComputeShader shader, RenderPipelineConfigObject m_config)
 {
     shader.SetTexture(kIndex, "_SkyboxTexture", m_config.skybox);
 }