public Primitive_Triangle(FragInfo f0, FragInfo f1, FragInfo f2, bool clip = false)
 {
     this.f0   = f0;
     this.f1   = f1;
     this.f2   = f2;
     this.clip = clip;
 }
Exemple #2
0
        private void PrimitiveAssembly()
        {
            var usingPass = UsingPass;
            var drawState = usingPass.State;

            switch (drawState.PolygonMode)
            {
            case PolygonMode.Triangle:
                var len  = curIndexBuffer.Buffer.Length;
                var buff = curIndexBuffer.Buffer;
                trianglePrimitiveHelper.Clear();
                for (int i = 0; i < len; i += 3)
                {
                    var f0   = FragInfo.GetFragInfo(vertexshaderOutput[buff[i + 0]]);
                    var f1   = FragInfo.GetFragInfo(vertexshaderOutput[buff[i + 1]]);
                    var f2   = FragInfo.GetFragInfo(vertexshaderOutput[buff[i + 2]]);
                    var clip = (f0.ShaderOut.clip || f1.ShaderOut.clip || f2.ShaderOut.clip);
                    trianglePrimitiveHelper.Add(new Primitive_Triangle(f0, f1, f2, clip));
                }
                var allPrimitiveClip = true;
                len = trianglePrimitiveHelper.Count;
                for (int i = 0; i < len; i++)
                {
                    var p = trianglePrimitiveHelper[i];
                    if (!p.f0.ShaderOut.clip ||
                        !p.f1.ShaderOut.clip ||
                        !p.f2.ShaderOut.clip)
                    {
                        allPrimitiveClip = false;
                        break;
                    }
                }
                if (allPrimitiveClip)
                {
                    trianglePrimitiveHelper.Clear();
                }
                break;

            case PolygonMode.Line:
                throw new Exception($"not implements polygonMode:{drawState.PolygonMode}");

            case PolygonMode.Point:
                throw new Exception($"not implements polygonMode:{drawState.PolygonMode}");

            default:
                throw new Exception($"not implements polygonMode:{drawState.PolygonMode}");
            }
        }
Exemple #3
0
 public override void ReadImpl()
 {
     fraginfo             = new FragInfo();
     fraginfo.KillingType = ReadByte();
     fraginfo.Count       = ReadByte();
     fraginfo.SlotId      = ReadByte();
     fraginfo.WeaponId    = ReadInt();
     fraginfo.X           = ReadInt();
     fraginfo.Y           = ReadInt();
     fraginfo.Z           = ReadInt();
     fraginfo.Flag        = ReadByte();
     for (int i = 0; i < fraginfo.Count; i++)
     {
         byte[] Unk = ReadBytes(18);
     }
 }
Exemple #4
0
 public PROTOCOL_BATTLE_DEATH_ACK(FragInfo fraginfo)
 {
     _fraginfo = fraginfo;
 }
 public Primitive_Point(FragInfo f1)
 {
     this.f1 = f1;
 }
 public Primitive_Line(FragInfo f1, FragInfo f2)
 {
     this.f1 = f1;
     this.f2 = f2;
 }