Example #1
0
        /// <summary>
        /// Apply this drawable to the draw node
        /// </summary>
        /// <param name="node">The node to apply properties to</param>
        protected virtual void ApplyDrawNode(DrawNode3D node)
        {
            node.WorldMatrix = WorldMatrix;

            node.ColourInfo = ColourInfo;
            if (node.ColourInfo.HasSingleColour)
            {
                node.ColourInfo = node.ColourInfo.MultiplyAlpha(Alpha);
            }
            node.Blending = blendingInfo.EnsureValid() ? blendingInfo.Value : blendingInfo.Refresh(() => new BlendingInfo(blendingMode));
        }
Example #2
0
        protected override void ApplyDrawNode(DrawNode3D node)
        {
            base.ApplyDrawNode(node);

            if (billboard)
            {
                node.WorldMatrix = CalculateBillboardingMatrix();
            }

            var n = (SpriteDrawNode3D)node;

            n.Texture   = Texture ?? Texture.WhitePixel;
            n.Shader    = textureShader;
            n.Rectangle = Rectangle;
        }