Пример #1
0
        public static LightColor CreateFogColorFromFogSet(ParamFile lightSet, int fogIndex)
        {
            // First fog is probably for characters.
            float      hue        = (float)ParamTools.GetParamValue(lightSet, 2, 1 + fogIndex, 0);
            float      saturation = (float)ParamTools.GetParamValue(lightSet, 2, 1 + fogIndex, 1);
            float      value      = (float)ParamTools.GetParamValue(lightSet, 2, 1 + fogIndex, 2);
            LightColor color      = new LightColor();

            color.H = hue;
            color.S = saturation;
            color.V = value;
            return(color);
        }
Пример #2
0
        public static DirectionalLight CreateDirectionalLightFromLightSet(ParamFile lightSet, int lightIndex, string name)
        {
            bool    enabled = (int)ParamTools.GetParamValue(lightSet, 1, lightIndex, 1) == 1;
            Vector3 hsv     = new Vector3(0);

            hsv.X = (float)ParamTools.GetParamValue(lightSet, 1, lightIndex, 2);
            hsv.Y = (float)ParamTools.GetParamValue(lightSet, 1, lightIndex, 3);
            hsv.Z = (float)ParamTools.GetParamValue(lightSet, 1, lightIndex, 4);

            float rotX = (float)ParamTools.GetParamValue(lightSet, 1, lightIndex, 5);
            float rotY = (float)ParamTools.GetParamValue(lightSet, 1, lightIndex, 6);
            float rotZ = (float)ParamTools.GetParamValue(lightSet, 1, lightIndex, 7);

            DirectionalLight newLight = new DirectionalLight(hsv, new Vector3(0), rotX, rotY, rotZ, name);

            newLight.enabled = enabled; // doesn't render properly for some stages
            return(newLight);
        }
Пример #3
0
        public static HemisphereFresnel CreateFresnelLightFromLightSet(ParamFile lightSet)
        {
            Vector3 hsvSky = new Vector3(0);

            hsvSky.X = (float)ParamTools.GetParamValue(lightSet, 0, 0, 8);
            hsvSky.Y = (float)ParamTools.GetParamValue(lightSet, 0, 0, 9);
            hsvSky.Z = (float)ParamTools.GetParamValue(lightSet, 0, 0, 10);

            Vector3 hsvGround = new Vector3(0);

            hsvGround.X = (float)ParamTools.GetParamValue(lightSet, 0, 0, 11);
            hsvGround.Y = (float)ParamTools.GetParamValue(lightSet, 0, 0, 12);
            hsvGround.Z = (float)ParamTools.GetParamValue(lightSet, 0, 0, 13);

            float skyAngle    = (float)ParamTools.GetParamValue(lightSet, 0, 0, 14);
            float groundAngle = (float)ParamTools.GetParamValue(lightSet, 0, 0, 15);

            return(new HemisphereFresnel(hsvGround, hsvSky, skyAngle, groundAngle, "Fresnel"));
        }
Пример #4
0
        public static DirectionalLight CreateCharDiffuseLightFromLightSet(ParamFile lightSet)
        {
            Vector3 diffuseHsv = new Vector3(0);

            diffuseHsv.X = (float)ParamTools.GetParamValue(lightSet, 0, 0, 29);
            diffuseHsv.Y = (float)ParamTools.GetParamValue(lightSet, 0, 0, 30);
            diffuseHsv.Z = (float)ParamTools.GetParamValue(lightSet, 0, 0, 31);

            Vector3 ambientHsv = new Vector3(0);

            ambientHsv.X = (float)ParamTools.GetParamValue(lightSet, 0, 0, 33);
            ambientHsv.Y = (float)ParamTools.GetParamValue(lightSet, 0, 0, 34);
            ambientHsv.Z = (float)ParamTools.GetParamValue(lightSet, 0, 0, 35);

            float rotX = (float)ParamTools.GetParamValue(lightSet, 1, 4, 5);
            float rotY = (float)ParamTools.GetParamValue(lightSet, 1, 4, 6);
            float rotZ = (float)ParamTools.GetParamValue(lightSet, 1, 4, 7);

            return(new DirectionalLight(diffuseHsv, ambientHsv, 0, 0, 0, "Diffuse"));
        }