/// <summary>
 /// specify pixel arithmetic for RGB and alpha components separately.
 /// </summary>
 /// <param name="sourceFactor">Specifies how the red, green and blue source blending factors are computedThe initial value is GL_ONE.</param>
 /// <param name="destFactor">Specifies how the red, green and blue alpha destination blending factors are computed. The initial value is GL_ZERO.</param>
 /// <param name="sourceAlphaFactor">Specifies how the alpha source blending factors are computedThe initial value is GL_ONE.</param>
 /// <param name="destAlphaFactor">Specifies how the alpha destination blending factors are computed. The initial value is GL_ZERO.</param>
 /// <param name="enableCapacity"></param>
 public BlendFuncSeparateSwitch(BlendSrcFactor sourceFactor, BlendDestFactor destFactor, BlendSrcFactor sourceAlphaFactor, BlendDestFactor destAlphaFactor, bool enableCapacity = true)
     : base(GL.GL_BLEND, enableCapacity)
 {
     this.SourceFactor      = sourceFactor;
     this.DestFactor        = destFactor;
     this.SourceAlphaFactor = sourceAlphaFactor;
     this.DestAlphaFactor   = destAlphaFactor;
 }
Exemple #2
0
        private void SetupBlending(SceneNodeBase sceneNodeBase, BlendSrcFactor sf, BlendDestFactor df)
        {
            var node = sceneNodeBase as RectGlassNode;

            if (node != null)
            {
                node.Blend.SourceFactor = sf;
                node.Blend.DestFactor   = df;
            }

            foreach (var item in sceneNodeBase.Children)
            {
                SetupBlending(item, sf, df);
            }
        }
 public void GetNext(out BlendSrcFactor source, out BlendDestFactor dest)
 {
     source = sourceFactors[currentSource];
     dest   = destFactors[currentDest];
     currentDest++;
     if (currentDest >= destFactors.Length)
     {
         currentDest = 0;
         currentSource++;
         if (currentSource >= sourceFactors.Length)
         {
             currentSource = 0;
         }
     }
 }
Exemple #4
0
        private void SetupBlending(SceneNodeBase sceneNodeBase, BlendSrcFactor s, BlendDestFactor d)
        {
            var node = sceneNodeBase as TextBillboardNode;

            if (node != null)
            {
                node.Blend.SourceFactor = s;
                node.Blend.DestFactor   = d;
            }

            foreach (var item in sceneNodeBase.Children)
            {
                SetupBlending(item, s, d);
            }
        }
Exemple #5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            {
                var item = this.lstSourceFactor.SelectedItem;
                if (item == null)
                {
                    MessageBox.Show("Please select a source factor!");
                    return;
                }
                this.SelectedSourceFactor = (BlendSrcFactor)item;
            }
            {
                var item = this.lstDestinationFactor.SelectedItem;
                if (item == null)
                {
                    MessageBox.Show("Please select a destination factor!");
                    return;
                }
                this.SelectedDestinationFactor = (BlendDestFactor)item;
            }

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Exemple #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="source"></param>
 /// <param name="dest"></param>
 public BlendingGroupNode(BlendSrcFactor source, BlendDestFactor dest)
 {
     this.blending = new BlendFuncSwitch(source, dest);
 }
 /// <summary>
 /// specify pixel arithmetic for RGB and alpha components separately.
 /// </summary>
 /// <param name="rgbMode">set the RGB blend equation.</param>
 /// <param name="alphaMode">set the Alpha blend equation.</param>
 /// <param name="rgbSrcFactor">Specifies how the red, green and blue source blending factors are computedThe initial value is GL_ONE.</param>
 /// <param name="rgbDestFactor">Specifies how the red, green and blue destination blending factors are computed. The initial value is GL_ZERO.</param>
 /// <param name="alphaSrcFactor">Specifies how the alpha source blending factors are computed. The initial value is GL_ONE.</param>
 /// <param name="alphaDestFactor">Specifies how the alpha destination blending factors are computed. The initial value is GL_ZERO.</param>
 /// <param name="enableCapacity"></param>
 public BlendSwitch(BlendEquationMode rgbMode, BlendEquationMode alphaMode, BlendSrcFactor rgbSrcFactor, BlendDestFactor rgbDestFactor, BlendSrcFactor alphaSrcFactor, BlendDestFactor alphaDestFactor, bool enableCapacity = true)
     : base(GL.GL_BLEND, enableCapacity)
 {
     this.RGBMode         = rgbMode;
     this.AlphaMode       = alphaMode;
     this.RGBSrcFactor    = rgbSrcFactor;
     this.RGBDestFactor   = rgbDestFactor;
     this.AlphaSrcFactor  = alphaSrcFactor;
     this.AlphaDestFactor = alphaDestFactor;
 }
 /// <summary>
 /// specify pixel arithmetic for RGB and alpha components separately.
 /// </summary>
 /// <param name="mode">set the blend equation.</param>
 /// <param name="srcFactor">Specifies how the red, green, blue and alpha source blending factors are computed. The initial value is GL_ONE.</param>
 /// <param name="destFactor">Specifies how the red, green blue and alpha destination blending factors are computed. The initial value is GL_ZERO.</param>
 /// <param name="enableCapacity"></param>
 public BlendSwitch(BlendEquationMode mode, BlendSrcFactor srcFactor, BlendDestFactor destFactor, bool enableCapacity = true)
     : this(mode, mode, srcFactor, destFactor, srcFactor, destFactor, enableCapacity)
 {
 }
 /// <summary>
 /// specify pixel arithmetic for RGB and alpha components separately.
 /// </summary>
 /// <param name="mode">set the blend equation.</param>
 /// <param name="rgbSrcFactor">Specifies how the red, green and blue source blending factors are computedThe initial value is GL_ONE.</param>
 /// <param name="rgbDestFactor">Specifies how the red, green and blue destination blending factors are computed. The initial value is GL_ZERO.</param>
 /// <param name="alphaSrcFactor">Specifies how the alpha source blending factors are computed. The initial value is GL_ONE.</param>
 /// <param name="alphaDestFactor">Specifies how the alpha destination blending factors are computed. The initial value is GL_ZERO.</param>
 /// <param name="enableCapacity"></param>
 public BlendSwitch(BlendEquationMode mode, BlendSrcFactor rgbSrcFactor, BlendDestFactor rgbDestFactor, BlendSrcFactor alphaSrcFactor, BlendDestFactor alphaDestFactor, bool enableCapacity = true)
     : this(mode, mode, rgbSrcFactor, rgbDestFactor, alphaSrcFactor, alphaDestFactor, enableCapacity)
 {
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="destFactor"></param>
 public void SetDestFactor(BlendDestFactor destFactor)
 {
     this.rgbDestFactor   = (uint)destFactor;
     this.alphaDestFactor = (uint)destFactor;
 }