Beispiel #1
0
 public PmxMaterial(BinaryStream bs, byte textureIdxSize)
 {
     Name               = bs.ReadTextBuf(); bs.ReadTextBuf();
     Diffuse            = bs.Color3();
     Alpha              = bs.ReadSingle();
     Specular           = bs.Color3();
     Specularity        = bs.ReadSingle();
     Ambient            = bs.Color3();
     DrawFlag           = (DrawFlagEnumes)bs.ReadByte();
     EdgeColor          = bs.Color4();
     EdgeSize           = bs.ReadSingle();
     NormalTextureIndex = bs.ReadIndex(textureIdxSize);
     SphereTextureIndex = bs.ReadIndex(textureIdxSize);
     SphereMode         = (SphereModeEnumes)bs.ReadByte();
     if (bs.ReadByte() == 0)
     {
         IsReferredTable  = true;
         ToonTextureIndex = bs.ReadIndex(textureIdxSize);
     }
     else
     {
         ToonTextureIndex = bs.ReadByte();
     }
     Memo          = bs.ReadTextBuf();
     IndiciesCount = bs.ReadInt32();
 }
Beispiel #2
0
 public PmxMaterialMorph(BinaryStream bs, byte materialIdxSize)
 {
     Index           = bs.ReadIndex(materialIdxSize);
     Offset          = (OffsetEnum)bs.ReadByte();
     Diffuse         = bs.Color3();
     Alpha           = bs.ReadSingle();
     Specular        = bs.Color3();
     Specularity     = bs.ReadSingle();
     Ambient         = bs.Color3();
     EdgeColor       = bs.Color4();
     EdgeSize        = bs.ReadSingle();
     NormalTexturity = bs.Vector4();
     SphereTexturity = bs.Vector4();
     ToonTexturity   = bs.Vector4();
 }