public override void Read(EndianBinaryReader reader, ISection section = null) { var paramReader = new ParameterReader(reader); while (paramReader.Read()) { switch (paramReader.HeadToken) { case "offset": Offset = paramReader.ReadSingle(); break; case "scale": Scale = paramReader.ReadSingle(); break; case "position": Position = paramReader.ReadVector3(); break; case "direction": Direction = paramReader.ReadVector3(); break; } } }
public override void Read(EndianBinaryReader reader, ISection section = null) { var paramReader = new ParameterReader(reader); while (paramReader.Read()) { switch (paramReader.HeadToken) { case "exposure": Exposure = paramReader.ReadSingle(); break; case "gamma": Gamma = paramReader.ReadSingle(); break; case "saturate_power": SaturatePower = paramReader.ReadUInt32(); break; case "saturate_coef": SaturateCoefficient = paramReader.ReadSingle(); break; case "flare": FlarePower = paramReader.ReadSingle(); FlareShaft = paramReader.ReadSingle(); FlareGhost = paramReader.ReadSingle(); break; case "sigma": GlareRadius = paramReader.ReadVector3(); break; case "intensity": GlareIntensity = paramReader.ReadVector3(); break; case "auto_exposure": AutoExposure = paramReader.ReadBoolean(); break; case "tone_map_type": ToneMapType = ( ToneMapType )paramReader.ReadInt32(); break; case "fade_color": FadeColor = paramReader.ReadVector3(); FadeBlendFunc = ( FadeBlendFunc )paramReader.ReadInt32(); break; case "tone_transform": ToneTransStart = paramReader.ReadVector3(); ToneTransEnd = paramReader.ReadVector3(); break; } } }
internal void Read(ParameterReader paramReader) { while (paramReader.Read()) { switch (paramReader.HeadToken) { case "type": Type = ( LightType )paramReader.ReadInt32(); break; case "ambient": Ambient = paramReader.ReadVector4(); break; case "diffuse": Diffuse = paramReader.ReadVector4(); break; case "specular": Specular = paramReader.ReadVector4(); break; case "position": Position = paramReader.ReadVector4(); break; case "spot_direction": SpotDirection = paramReader.ReadVector3(); break; case "spot_exponent": SpotExponent = paramReader.ReadSingle(); break; case "spot_cutoff": SpotCutoff = paramReader.ReadSingle(); break; case "attenuation": SpotAttenuationConstant = paramReader.ReadSingle(); SpotAttenuationLinear = paramReader.ReadSingle(); SpotAttenuationQuadratic = paramReader.ReadSingle(); break; case "clipplane": ClipPlane = paramReader.ReadVector4(); break; case "tonecurve": ToneCurve = paramReader.ReadVector3(); break; case "id_end": if (paramReader.ReadInt32() != ( int )Id) { throw new InvalidDataException($"Expected id end with id {( int ) Id}"); } return; } } }