Exemple #1
0
        public void Render(ComponentizedEntity entity, IGameContext gameContext, IRenderContext renderContext)
        {
            var matrix          = Matrix.Identity;
            var matrixComponent = _node.Parent?.UntypedValue as IHasMatrix;

            if (matrixComponent != null)
            {
                matrix *= matrixComponent.GetFinalMatrix();
            }
            _renderUtilities.RenderPlane(renderContext, matrix, Color);
        }
Exemple #2
0
        public void Render(ComponentizedEntity entity, IGameContext gameContext, IRenderContext renderContext)
        {
            if (!Enabled)
            {
                return;
            }

            if (renderContext.IsCurrentRenderPass <I3DRenderPass>())
            {
                var matrix          = Matrix.Identity;
                var matrixComponent = _node.Parent?.UntypedValue as IHasTransform;
                if (matrixComponent != null)
                {
                    matrix *= matrixComponent.FinalTransform.AbsoluteMatrix;
                }
                _renderUtilities.RenderPlane(renderContext, Effect.Effect, Effect.Effect.CreateParameterSet(), matrix, Color);
            }
        }
        public void Render(ComponentizedEntity entity, IGameContext gameContext, IRenderContext renderContext)
        {
            if (!Enabled)
            {
                return;
            }

            if (renderContext.IsCurrentRenderPass <I3DRenderPass>())
            {
                IEffect effect;
                if (Effect != null)
                {
                    effect = Effect;
                }
                else if (_defaultSurfaceEffect.IsReady)
                {
                    effect = _defaultSurfaceEffect.Asset.Effects?["Color"];
                }
                else
                {
                    return;
                }

                if (effect == null)
                {
                    return;
                }

                var matrix          = Matrix.Identity;
                var matrixComponent = _node.Parent?.UntypedValue as IHasTransform;
                if (matrixComponent != null)
                {
                    matrix *= matrixComponent.FinalTransform.AbsoluteMatrix;
                }
                _renderUtilities.RenderPlane(renderContext, effect, effect.CreateParameterSet(), matrix, Color);
            }
        }