Being new to Xenko, I’m having quite the time trying to perform seemingly simple tasks from code… all of the ‘documentation’ seems to be either outdated (referencing old versions), or only provides information pertaining to visual manipulation via instances created using the studio.
I am attempting to generate a simple model from code and apply a semi-transparent material. Nothing I have tried seems to work. I either get a non-transparent render, or nothing at all (depending on how I improperly attempt to apply materials).
I can’t seem to figure out how to correctly apply a loaded material to a model and apply a transparent descriptor at the same time…
Hopefully this code will explain what I’m trying to accomplish:
myModel.Materials.Add(new MaterialInstance(Content.Load<Material>("Materials/MatteBlack"))
{
Material =
{
Descriptor = new MaterialDescriptor
{
Attributes =
{
Transparency = new MaterialTransparencyBlendFeature
{
Enabled = true,
Alpha = new ComputeFloat(0.6f),
Tint = new ComputeColor(Color.White)
},
CullMode = CullMode.Front
}
}
}
});