コード例 #1
0
        public MtrlFile()
        {
            this.unk   = new uint[5];
            this.Alpha = 1f;

            this.Id = -1;

            this.SelfIlluminating = 0;
            this.ClampU           = 0;
            this.ClampV           = 0;
            this.LightSpecular    = 1;
            this.AffectsAmbient   = 1;
            this.AffectsDiffuse   = 1;
            this.AffectsSpecular  = 1;

            this.AlphaMode = 10;

            unk2 = new Texel[3] {
                new Color4D(1f), new Color4D(1f), new Color4D(1f)
            };
            unk3 = new Texel[3] {
                new Color4D(1f), new Color4D(1f), new Color4D(1f)
            };
            unk4 = new int[4];

            Texture = string.Empty;
        }
コード例 #2
0
 public void WriteTexel(Texel t)
 {
     this.Write(t.B);
     this.Write(t.G);
     this.Write(t.R);
     this.Write(t.A);
 }
コード例 #3
0
 public void WriteTexel(Texel t)
 {
     this.Write(t.B);
     this.Write(t.G);
     this.Write(t.R);
     this.Write(t.A);
 }
コード例 #4
0
ファイル: TextureLoader.cs プロジェクト: ByteChkR/Byt3
 /// <summary>
 /// Creates a flat byte array sequence out of a texel
 /// </summary>
 /// <param name="txl">The texel to convert</param>
 /// <param name="arr">the output array</param>
 /// <param name="startidx">The index to start inserting the texel data</param>
 private static void TexelToByteSequence(int startidx, byte[] arr, Texel txl)
 {
     arr[startidx]     = txl.R;
     arr[startidx + 1] = txl.G;
     arr[startidx + 2] = txl.B;
     arr[startidx + 3] = txl.A;
 }
コード例 #5
0
        public LightMap(ModelInstance mi, Mesh m)
        {
            model = mi;
            mesh  = m;

            width  = mesh.texels.GetLength(0);
            height = mesh.texels.GetLength(1);

            texels  = new Texel[width, height];
            patches = new List <Patch>();

            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    texels[i, j] = new Texel();
                    foreach (Patch p in mesh.texels[i, j].patches)
                    {
                        Patch temp = new Patch(p, model.transform);
                        texels[i, j].add(temp);
                        patches.Add(temp);
                    }
                }
            }

            name = "lm" + model.layoutName + "_" + convertToBase36(model.id) + "_0" + mesh.id;
        }
コード例 #6
0
 public Texel ReadTexel()
 {
     Texel t = new Texel();
     t.B = this.ReadByte();
     t.G = this.ReadByte();
     t.R = this.ReadByte();
     t.A = this.ReadByte();
     return t;
 }
コード例 #7
0
        public Texel ReadTexel()
        {
            Texel t = new Texel();

            t.B = this.ReadByte();
            t.G = this.ReadByte();
            t.R = this.ReadByte();
            t.A = this.ReadByte();
            return(t);
        }
コード例 #8
0
ファイル: Texel.cs プロジェクト: Ragingram2/FluidSimulation
    void satisfyConstraint(Texel p1, Texel p2)
    {
        Vector3 p1_to_p2             = p2.GetPos() - p1.GetPos(); // vector from p1 to p2
        float   current_distance     = p1_to_p2.magnitude;
        Vector3 correctionVector     = p1_to_p2 * (1 - rest_distance / current_distance);
        Vector3 correctionVectorHalf = correctionVector * 0.5f;

        p1.OffsetPos(correctionVectorHalf);
        p2.OffsetPos(-correctionVectorHalf);
    }
コード例 #9
0
ファイル: OpImageWrite.cs プロジェクト: gleblebedev/Toe.SPIRV
        /// <summary>
        /// Calculate number of words to fit complete instruction bytecode.
        /// </summary>
        /// <returns>Number of words in instruction bytecode.</returns>
        public override uint GetWordCount()
        {
            uint wordCount = 0;

            wordCount += Image.GetWordCount();
            wordCount += Coordinate.GetWordCount();
            wordCount += Texel.GetWordCount();
            wordCount += ImageOperands?.GetWordCount() ?? 0u;
            return(wordCount);
        }
コード例 #10
0
ファイル: OpImageWrite.cs プロジェクト: gleblebedev/Toe.SPIRV
 /// <summary>
 /// Write instruction operands into bytecode stream.
 /// </summary>
 /// <param name="writer">Bytecode writer.</param>
 public override void WriteOperands(WordWriter writer)
 {
     Image.Write(writer);
     Coordinate.Write(writer);
     Texel.Write(writer);
     if (ImageOperands != null)
     {
         ImageOperands.Write(writer);
     }
 }
コード例 #11
0
ファイル: MtrlFile.cs プロジェクト: Ryder25/Age-of-Mythology
        public uint[] unk; //5

        #endregion Fields

        #region Constructors

        public MtrlFile()
        {
            this.unk = new uint[5];
            this.Alpha = 1f;

            this.Id = -1;

            this.SelfIlluminating = 0;
            this.ClampU = 0;
            this.ClampV = 0;
            this.LightSpecular = 1;
            this.AffectsAmbient = 1;
            this.AffectsDiffuse = 1;
            this.AffectsSpecular = 1;

            this.AlphaMode = 10;

            unk2 = new Texel[3] { new Color4D(1f), new Color4D(1f), new Color4D(1f) };
            unk3 = new Texel[3] { new Color4D(1f), new Color4D(1f), new Color4D(1f) };
            unk4 = new int[4];

            Texture = string.Empty;
        }