Esempio n. 1
0
        public void SetPartDefaultParameters(int partIndex)
        {
            PartMaterial part = mParts[partIndex];

            part.ParametersName = string.Empty;
            part.Parameters     = part.DefaultParameters;
            part.Parameters.ApplyTo(part.Effect);
        }
Esempio n. 2
0
        public void SetPartParameters(int partIndex, string parametersShortName)
        {
            PartMaterial            part = mParts[partIndex];
            EffectParameterListSave list = mParametersDictionary[parametersShortName];

            // Store parameters and apply them to effect
            part.ParametersName = parametersShortName;
            part.Parameters     = list;
            list.ApplyTo(part.Effect);
        }
Esempio n. 3
0
        public void SetPartEffect(int partIndex, string effectShortName)
        {
            PartMaterial part   = mParts[partIndex];
            Effect       effect = mEffectDictionary[effectShortName].Clone(FlatRedBallServices.GraphicsDevice);

            // Store effect
            part.EffectName      = effectShortName;
            part.Effect          = effect;
            part.MeshPart.Effect = effect;

            // Load effect default parameters (or add non-saved parameters if none exist)
            if (HasParameters(effectShortName))
            {
                string parametersShortName = mEffectParameters[effectShortName][0];
                SetPartParameters(partIndex, parametersShortName);
            }
            else
            {
                part.ParametersName = string.Empty;
                part.Parameters     = EffectParameterListSave.FromEffect(effect);
            }
        }
Esempio n. 4
0
        public void UpdatePartParameters(int partIndex)
        {
            PartMaterial part = mParts[partIndex];

            part.Parameters.CopyFromEffect(part.Effect);
        }