Hello,
I’m trying to do just that from code and my attempt looks like this:
modelComponent.Materials[0].Parameters.Set((ParameterKey)ParameterKeys.FindByName("Material.DifuseMap"), myTexture);
How to do it right?
Change model material diffuse map
3 posts, 1595 views, 2016-05-29 to 2016-05-30
Ok, I got it.
modelComponent.Materials[0].Parameters.Set((ObjectParameterKey<Texture>)ParameterKeys.FindByName("Material.DiffuseMap"), myTexture);
You might want to use shader auto-generated keys so that they are compile-time checked:
modelComponent.Materials[0].Parameters.Set(MaterialKeys.DiffuseMap, myTexture);