How to create a Xenko.Rendering.Material programmatically?

Hi,

I am trying to create a Xenko.Rendering.Material programmatically. I need to load am image file too as DiffuseTexture.

How can I build it?

Thanks in advance.

1 Like

i think a material is only an object tree, so start with the top level class and fill all properties and options. it should be a 1 to 1 translation from the material properties in game studio…

3 Likes

For the next person who stumbles upon this forum post looking for an answer…

https://doc.xenko.com/latest/en/manual/scripts/create-a-model-from-code.html

And here is a project sample that runtime loads a wavefront OBJ file, including textures.

3 Likes