Describes something that can be rendered by a RootRenderFeature.
コード例 #1
0
ファイル: SubRenderFeature.cs プロジェクト: santoshna/xenko-1
 /// <summary>
 /// Do any changes required to the pipeline state.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="renderNodeReference"></param>
 /// <param name="renderNode"></param>
 /// <param name="renderObject"></param>
 /// <param name="pipelineState"></param>
 public virtual void ProcessPipelineState(RenderContext context, RenderNodeReference renderNodeReference, ref RenderNode renderNode, RenderObject renderObject, PipelineStateDescription pipelineState)
 {
 }
コード例 #2
0
ファイル: RenderStageSelector.cs プロジェクト: glepag1/stride
 public abstract void Process(RenderObject renderObject);
コード例 #3
0
 public RenderNodeFeatureReference(RootRenderFeature rootRenderFeature, RenderNodeReference renderNode, RenderObject renderObject)
 {
     RootRenderFeature = rootRenderFeature;
     RenderNode        = renderNode;
     RenderObject      = renderObject;
 }
コード例 #4
0
        /// <summary>
        /// Removes a <see cref="RenderObject"/> from the rendering.
        /// </summary>
        /// <param name="renderObject"></param>
        public void RemoveRenderObject(RenderObject renderObject)
        {
            var renderFeature = renderObject.RenderFeature;

            renderFeature?.RemoveRenderObject(renderObject);
        }
コード例 #5
0
        protected override void ProcessPipelineState(RenderContext context, RenderNodeReference renderNodeReference, ref RenderNode renderNode, RenderObject renderObject, PipelineStateDescription pipelineState)
        {
            var renderMesh = (RenderMesh)renderObject;
            var drawData   = renderMesh.ActiveMeshDraw;

            if (drawData is StagedMeshDraw smd && smd.VertexBuffers == null)
            {
                smd.performStage(context.GraphicsDevice, smd);
            }

            pipelineState.InputElements = PrepareInputElements(pipelineState, drawData);
            pipelineState.PrimitiveType = drawData.PrimitiveType;

            // Prepare each sub render feature
            foreach (var renderFeature in RenderFeatures)
            {
                renderFeature.ProcessPipelineState(context, renderNodeReference, ref renderNode, renderObject, pipelineState);
            }
        }
コード例 #6
0
 public override void Process(RenderNodeReference renderNodeReference, ref RenderNode renderNode, RenderObject renderObject, PipelineStateDescription pipelineState)
 {
     // Disable culling and depth clip
     if (renderNode.RenderStage == VoxelRenderStage)
     {
         pipelineState.RasterizerState = new RasterizerStateDescription(CullMode.None)
         {
             DepthClipEnable = DepthClipping
         };
         pipelineState.DepthStencilState.DepthBufferEnable      = false;
         pipelineState.DepthStencilState.DepthBufferWriteEnable = false;
         pipelineState.DepthStencilState.StencilEnable          = false;
         pipelineState.DepthStencilState.StencilWriteMask       = 0;
         pipelineState.DepthStencilState.StencilMask            = 0;
         pipelineState.BlendState.RenderTarget0.BlendEnable     = false;
         pipelineState.BlendState.IndependentBlendEnable        = false;
     }
 }
コード例 #7
0
 public abstract void Process(RenderNodeReference renderNodeReference, ref RenderNode renderNode, RenderObject renderObject, PipelineStateDescription pipelineState);
コード例 #8
0
ファイル: RootRenderFeature.cs プロジェクト: glepag1/stride
 /// <summary>
 /// Called when a render object is removed.
 /// </summary>
 /// <param name="renderObject">The render object.</param>
 protected virtual void OnRemoveRenderObject(RenderObject renderObject)
 {
 }
コード例 #9
0
ファイル: RootRenderFeature.cs プロジェクト: glepag1/stride
 /// <summary>
 /// Called when a render object is added.
 /// </summary>
 /// <param name="renderObject"></param>
 protected virtual void OnAddRenderObject(RenderObject renderObject)
 {
 }
コード例 #10
0
 public override void Process(RenderNodeReference renderNodeReference, ref RenderNode renderNode, RenderObject renderObject, PipelineStateDescription pipelineState)
 {
     // Disable culling and depth clip
     if (renderNode.RenderStage == VoxelRenderStage)
     {
         pipelineState.RasterizerState = new RasterizerStateDescription(CullMode.None)
         {
             DepthClipEnable = DepthClipping
         };
     }
 }
コード例 #11
0
 /// <summary>
 /// Implemented by subclasses to reset effect dependent data.
 /// </summary>
 protected virtual void InvalidateEffectPermutation(RenderObject renderObject, RenderEffect renderEffect)
 {
 }
コード例 #12
0
ファイル: MeshRenderFeature.cs プロジェクト: glepag1/stride
        protected override void ProcessPipelineState(RenderContext context, RenderNodeReference renderNodeReference, ref RenderNode renderNode, RenderObject renderObject, PipelineStateDescription pipelineState)
        {
            var renderMesh = (RenderMesh)renderObject;
            var drawData   = renderMesh.ActiveMeshDraw;

            pipelineState.InputElements = PrepareInputElements(pipelineState, drawData);
            pipelineState.PrimitiveType = drawData.PrimitiveType;

            // Prepare each sub render feature
            foreach (var renderFeature in RenderFeatures)
            {
                renderFeature.ProcessPipelineState(context, renderNodeReference, ref renderNode, renderObject, pipelineState);
            }
        }