Alexandria.Engines.DarkSouls.ModelMaterialParameter.Bind C# (CSharp) Method

Bind() public method

Bind the material parameter to the program.
public Bind ( ModelDrawContext context, ModelProgram program ) : void
context ModelDrawContext
program ModelProgram
return void
        public void Bind(ModelDrawContext context, ModelProgram program)
        {
            Texture2D texture = TextureSource != null ? TextureSource.GetResourceValue() : null;

            switch (Name) {
                case DiffuseMapName:
                    program.DiffuseMap = texture;
                    break;

                case SpecularMapName:
                case NormalMapName:
                case LightMapName:
                case DetailNormalMapName:
                    break;

                default:
                    break;
            }
        }