public ColorCorrection()
        {
            Parent            = new ParamObject();
            Enable            = true;
            Hue               = 0;
            Saturation        = 1;
            Brightness        = 1;
            Gamma             = 1;
            ToyCamEnable      = true;
            ToyCamOffset      = new STColor(0, 0, 0, 1);
            ToyCamOffset2     = new STColor(0, 0, 0, 1);
            ToyCamLevel1      = new STColor(1, 1, 1, 1);
            ToyCamLevel2      = new STColor(1, 1, 1, 1);
            ToyCamSaturation1 = 0.8f;
            ToyCamSaturation2 = 1.2f;
            ToyCamMulColor    = new STColor(1, 1, 1, 1);
            ToyCamContrast    = 1.0f;
            ToyCamBrightness  = 1.0f;

            var curve = new Curve()
            {
                NumUses     = 9,
                CurveType   = CurveType.Hermit2D,
                valueFloats = new float[30] {
                    0, 0, 0.5f, 0.5f, 0.5f, 0.5f, 1, 1, 0.5f, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
                },
            };

            Level = new Curve[4]
            {
                curve, curve, curve, curve
            };
        }
예제 #2
0
        public STColor[] ReadColorsRGBA(int count)
        {
            STColor[] colors = new STColor[count];
            for (int i = 0; i < count; i++)
                colors[i] =  STColor.FromFloats(ReadSingles(4));

            return colors;
        }
예제 #3
0
 public static Vector4F ToColorF(this STColor value)
 {
     return(new Vector4F()
     {
         X = value.R,
         Y = value.G,
         Z = value.B,
         W = value.A,
     });
 }
예제 #4
0
 public Fog(string name)
 {
     Parent    = new ParamObject();
     Enable    = true;
     Name      = name;
     Group     = "Course_area";
     Start     = 1000.0f;
     End       = 10000.0f;
     Color     = new STColor(1, 1, 1, 1);
     Direction = new Vector3F(0, 0, -1);
 }
 public HemisphereLight(string name)
 {
     Parent      = new ParamObject();
     Enable      = true;
     Name        = name;
     Group       = "Course_area";
     SkyColor    = new STColor(1.1f, 1.1f, 0.8f, 1);
     GroundColor = new STColor(0.927106f, 0.950518f, 1.194f, 1);
     Intensity   = 0.35f;
     Direction   = new Vector3F(0, 1, 0);
 }
예제 #6
0
 private void ColorEditor_ColorChanged(object sender, STColor e)
 {
     if (selectedColorArray != null)
     {
         selectedColorArray.UpdateSelectedColor();
     }
     else if (selectedColorConstant != null)
     {
         selectedColorConstant.UpdateSelectedColor();
     }
 }
예제 #7
0
            protected override void ReadBinaryData(FileReader reader, Header header)
            {
                ReadName(reader);
                reader.Seek(0x10); // 0-padding

                // color arrays with key counts
                Color0Array      = new STColorArray(reader.ReadUInt32());
                Color0AlphaArray = new STColorArray(reader.ReadUInt32(), true);
                Color1Array      = new STColorArray(reader.ReadUInt32());
                Color1AlphaArray = new STColorArray(reader.ReadUInt32(), true);
                ScaleArray       = new STColorArray(reader.ReadUInt32());
                UnknownCount     = reader.ReadUInt32();
                reader.Seek(0x38); // 0-padding

                Unknown0 = reader.ReadBytes(0x30);


                BlinkIntensity0 = reader.ReadSingle();
                BlinkIntensity1 = reader.ReadSingle();
                BlinkDuration0  = reader.ReadSingle();
                BlinkDuration1  = reader.ReadSingle();

                Unknown1 = reader.ReadBytes(0x2c0);

                Radius = reader.ReadSingle();
                reader.Seek(0x0c); // 0-padding

                // random and animated color table
                Color0Array.ReadColorData(reader);
                Color0AlphaArray.ReadColorData(reader);
                Color1Array.ReadColorData(reader);
                Color1AlphaArray.ReadColorData(reader);
                Unknown2 = reader.ReadBytes(0x40);
                ScaleArray.ReadColorData(reader);

                Unknown3 = reader.ReadBytes(0x328);

                // constant colors
                ConstantColor0 = new STColor(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                ConstantColor1 = new STColor(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());

                Unknown4 = reader.ReadBytes(0x30);

                // samplers
                for (int i = 0; i < 3; ++i)
                {
                    SamplerInfo samplerInfo = new SamplerInfo();
                    samplerInfo.ReadSamplerData(reader);
                    Samplers.Add(samplerInfo);
                }

                Unknown5 = reader.ReadBytes(0x30);
            }
예제 #8
0
 public DirectionalLight(string name)
 {
     Parent         = new ParamObject();
     Enable         = true;
     Name           = name;
     Group          = "Course_area";
     DiffuseColor   = new STColor(1.05f, 1.05f, 0.9f, 1);
     SpecularColor  = new STColor(0, 0, 0, 1);
     BacksideColor  = new STColor(0, 0, 0, 1);
     Intensity      = 1.8f;
     Direction      = new Vector3F(-0.17101f, -0.866025f, 0.469846f);
     ViewCoordinate = false;
 }
예제 #9
0
        public void LoadColor(STColor color, bool isAlpha, bool isTimed)
        {
            activeColor = color;

            colorSelector.DisplayColor = !isAlpha;
            colorSelector.DisplayAlpha = isAlpha;
            colorSelector.Color        = color.Color;
            if (isAlpha)
            {
                colorSelector.Alpha = color.Color.R;
            }

            ShowTimeInput(isTimed);
            timeUpDown.Value = (decimal)color.Time;
        }
 public ProjectionShadowParams()
 {
     Parent            = new ParamObject();
     BiasScale         = new Vector2F(1, 1);
     AnimTransVel      = new Vector2F(0, 0);
     AnimSwingCycleY   = 0;
     AnimSwingCycleX   = 0;
     AnimSwingCycleAmp = new Vector2F(0, 0);
     BiasTrans         = new Vector2F(0, 0.1f);
     AnimRotSpeed      = 0.0f;
     BiasRotate        = 1.0f;
     Repeat            = true;
     Name          = "Projection0";
     Color         = new STColor(1, 1, 1, 1);
     Density       = 0.2f;
     DensityDrc    = 1.0f;
     UseDesnityDrc = false;
 }
예제 #11
0
 public void ReadColorData(FileReader reader)
 {
     for (var i = 0; i < MAX_KEYS; ++i)
     {
         ColorKeys[i]      = new STColor(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
         ColorKeys[i].Time = reader.ReadSingle();
         if (ColorKeys[i].Time != 0)
         {
             Timed = true;
         }
     }
     // add timing information internally even for non-timed arrays, so that we can easily add timing
     if (!Timed)
     {
         for (var i = 1; i < KeyCount; ++i)
         {
             ColorKeys[i].Time = (float)i / (KeyCount - 1);
         }
     }
 }
예제 #12
0
                public void AddKey()
                {
                    if (KeyCount == MAX_KEYS)
                    {
                        return;
                    }

                    for (var i = 1; i < KeyCount; ++i)
                    {
                        ColorKeys[i].Time *= (float)(KeyCount - 1) / KeyCount;
                    }

                    if (++KeyCount > 1)
                    {
                        STColor prevColor = ColorKeys[KeyCount - 2];
                        STColor newColor  = ColorKeys[KeyCount - 1];
                        newColor.R    = prevColor.R;
                        newColor.G    = prevColor.G;
                        newColor.B    = prevColor.B;
                        newColor.Time = 1;
                    }
                }
예제 #13
0
 public STColor ReadColorRGBA()
 {
     return(STColor.FromFloats(ReadSingles(4)));
 }
 public ShadowColorParams()
 {
     Parent    = new ParamObject();
     ForeColor = new STColor(1, 1, 1, 1);
     BackColor = new STColor(0, 0, 0, 1);
 }
예제 #15
0
 public void LoadColor(STColor color)
 {
     MyColor           = color;
     MyPanel.BackColor = Color.FromArgb(color.Color.R, color.Color.G, color.Color.B);
     MyPanel.Visible   = true;
 }
 public void LoadColor(STColor color)
 {
     ActiveColor        = color;
     color0PB.BackColor = Color.FromArgb(ActiveColor.Color.R, ActiveColor.Color.G, ActiveColor.Color.B);
 }
예제 #17
0
 public KeyFrame(STColor color)
 {
     STColor = color;
 }
예제 #18
0
 public void Bind(ref STColor Color)
 {
 }
예제 #19
0
            public void Read(FileReader reader, Header header)
            {
                long pos = reader.Position;

                if (header.Version <= 11)
                {
                    reader.Seek(12);
                }
                else
                {
                    reader.Seek(56);
                }

                uint NameOffset = reader.ReadUInt32();
                uint padding    = reader.ReadUInt32();

                if (NameOffset != PTCL.NullOffset)
                {
                    using (reader.TemporarySeek(header.EffectNameTableOffset + NameOffset, SeekOrigin.Begin))
                    {
                        Text = reader.ReadString(BinaryStringFormat.ZeroTerminated);
                    }
                }

                int TextureCount = 2;

                if (header.Version <= 11)
                {
                    TextureCount = 1;
                }

                for (int i = 0; i < TextureCount; i++) //Max of 2 textures. Any more and it'll overlap some data
                {
                    TextureInfo textureInfo = new TextureInfo();
                    textureInfo.Read(reader, header, Text);

                    if (!textureInfo.IsEmpty())
                    {
                        DrawableTex.Add(textureInfo);

                        bool HasImage = header.Textures.Any(item => item.DataPos == textureInfo.DataPos);
                        if (!HasImage)
                        {
                            header.Textures.Add(textureInfo);
                        }
                    }
                }

                if (header.Version <= 11)
                {
                    reader.Seek(pos + 120, SeekOrigin.Begin); //This is a guess
                }
                else
                {
                    reader.Seek(pos + 1072, SeekOrigin.Begin);
                }

                Color0KeyCount = 8;
                Alpha0KeyCount = 8;
                Color1KeyCount = 8;
                Alpha1KeyCount = 8;

                Color0Type = ColorType.Random;
                Color1Type = ColorType.Random;
                Alpha0Type = ColorType.Random;
                Alpha1Type = ColorType.Random;

                Color0Array      = new STColor[8];
                Color1Array      = new STColor[8];
                Color0AlphaArray = new STColor[8];
                Color1AlphaArray = new STColor[8];

                ColorPosition = reader.Position;
                for (int i = 0; i < 8; i++)
                {
                    STColor clr = new STColor();
                    clr.R = reader.ReadSingle();
                    clr.G = reader.ReadSingle();
                    clr.B = reader.ReadSingle();
                    float   A     = reader.ReadSingle();
                    STColor alpha = new STColor();
                    alpha.R             = A;
                    alpha.G             = A;
                    alpha.B             = A;
                    Color0AlphaArray[i] = alpha;
                    Color0Array[i]      = clr;
                }
                for (int i = 0; i < 8; i++)
                {
                    STColor clr = new STColor();
                    clr.R = reader.ReadSingle();
                    clr.G = reader.ReadSingle();
                    clr.B = reader.ReadSingle();
                    float   A     = reader.ReadSingle();
                    STColor alpha = new STColor();
                    alpha.R             = A;
                    alpha.G             = A;
                    alpha.B             = A;
                    Color1AlphaArray[i] = alpha;
                    Color1Array[i]      = clr;
                }
            }
예제 #20
0
 public void Write(STColor color)
 {
     Write(color.ToBytes());
 }
예제 #21
0
            public void Read(FileReader reader, Header header)
            {
                Color0Array      = new STColor[8];
                Color1Array      = new STColor[8];
                Color0AlphaArray = new STColor[8];
                Color1AlphaArray = new STColor[8];
                ConstantColor0   = new STColor();
                ConstantColor1   = new STColor();

                Color0KeyCount = 8;
                Alpha0KeyCount = 8;
                Color1KeyCount = 8;
                Alpha1KeyCount = 8;

                Color0Type = ColorType.Random;
                Color1Type = ColorType.Random;
                Alpha0Type = ColorType.Random;
                Alpha1Type = ColorType.Random;

                long pos = reader.Position;

                reader.Seek(56);
                uint NameOffset = reader.ReadUInt32();
                uint padding    = reader.ReadUInt32();

                if (NameOffset != PTCL.NullOffset)
                {
                    using (reader.TemporarySeek(header.EffectNameTableOffset + NameOffset, SeekOrigin.Begin))
                    {
                        Text = reader.ReadString(BinaryStringFormat.ZeroTerminated);
                    }
                }

                uint TextureAmount = 3;

                if (header.IsSPBD)
                {
                    TextureAmount = 2;
                }

                for (int i = 0; i < TextureAmount; i++) //Max of 3 or 2 textures depending on version. Seems to fill in texture info even if unused
                {
                    TextureInfo textureInfo = new TextureInfo();
                    textureInfo.Read(reader, header, Text);

                    if (!textureInfo.IsEmpty())
                    {
                        DrawableTex.Add(textureInfo);

                        bool HasImage = header.Textures.Any(item => item.DataPos == textureInfo.DataPos);
                        if (!HasImage)
                        {
                            header.Textures.Add(textureInfo);
                        }
                    }
                }
                if (header.IsSPBD)
                {
                    reader.Seek(pos + 1358, SeekOrigin.Begin);
                }
                else
                {
                    reader.Seek(pos + 1616, SeekOrigin.Begin);
                }
                ColorPosition = reader.Position;
                for (int i = 0; i < 8; i++)
                {
                    STColor clr = new STColor();
                    clr.R = reader.ReadSingle();
                    clr.G = reader.ReadSingle();
                    clr.B = reader.ReadSingle();
                    float   A     = reader.ReadSingle();
                    STColor alpha = new STColor();
                    alpha.R             = A;
                    alpha.G             = A;
                    alpha.B             = A;
                    Color0Array[i]      = clr;
                    Color0AlphaArray[i] = alpha;
                }
                for (int i = 0; i < 8; i++)
                {
                    STColor clr = new STColor();
                    clr.R = reader.ReadSingle();
                    clr.G = reader.ReadSingle();
                    clr.B = reader.ReadSingle();
                    float A = reader.ReadSingle();

                    STColor alpha = new STColor();
                    alpha.R = A;
                    alpha.G = A;
                    alpha.B = A;

                    Color1Array[i]      = clr;
                    Color1AlphaArray[i] = alpha;
                }
            }