Example #1
0
        public void Draw(RenderDrawContext drawContext, RenderOutputValidator outputValidator, Texture[] inputs, Texture inputDepthStencil, Texture outputTarget)
        {
            var colorIndex = outputValidator.Find <ColorTargetSemantic>();

            if (colorIndex < 0)
            {
                return;
            }

            SetInput(0, inputs[colorIndex]);
            SetInput(1, inputDepthStencil);

            var normalsIndex = outputValidator.Find <NormalTargetSemantic>();

            if (normalsIndex >= 0)
            {
                SetInput(2, inputs[normalsIndex]);
            }

            var specularRoughnessIndex = outputValidator.Find <SpecularColorRoughnessTargetSemantic>();

            if (specularRoughnessIndex >= 0)
            {
                SetInput(3, inputs[specularRoughnessIndex]);
            }

            var reflectionIndex0 = outputValidator.Find <OctahedronNormalSpecularColorTargetSemantic>();
            var reflectionIndex1 = outputValidator.Find <EnvironmentLightRoughnessTargetSemantic>();

            if (reflectionIndex0 >= 0 && reflectionIndex1 >= 0)
            {
                SetInput(4, inputs[reflectionIndex0]);
                SetInput(5, inputs[reflectionIndex1]);
            }

            var velocityIndex = outputValidator.Find <VelocityTargetSemantic>();

            if (velocityIndex != -1)
            {
                SetInput(6, inputs[velocityIndex]);
            }

            SetOutput(outputTarget);
            Draw(drawContext);
        }
Example #2
0
 public RenderStage()
 {
     Id = Guid.NewGuid();
     OutputValidator = new RenderOutputValidator(this);
 }