Beispiel #1
0
        private static void AddFogInfo(JObject target, EnvFogController fog, float distScale)
        {
            target.Add("fogEnabled", fog != null && fog.FogEnable);

            if (fog == null || !fog.FogEnable)
            {
                return;
            }

            target.Add("fogStart", fog.FogStart / distScale);
            target.Add("fogEnd", fog.FogEnd / distScale);
            target.Add("fogMaxDensity", fog.FogMaxDensity);
            target.Add("farZ", fog.FarZ);
            target.Add("fogColor", fog.FogColor.ToJson());
        }
Beispiel #2
0
        private static EnvFogController InitEnvFogController(EnvFogController ent, ValveBsp.Entities.Entity value)
        {
            if (InitEntity(ent, value) == null)
            {
                return(null);
            }

            ent.FogEnabled    = value["fogenable"];
            ent.FogStart      = value["fogstart"];
            ent.FogEnd        = value["fogend"];
            ent.FogMaxDensity = value["fogmaxdensity"];
            ent.FarZ          = value["farz"];
            ent.FogColor      = new MaterialColor(value["fogcolor"]);

            return(ent);
        }