stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.65k stars 957 forks source link

Material Clone? #2442

Closed anan1213095357 closed 2 months ago

anan1213095357 commented 2 months ago

Question and/or Comment

How can I clone materials onto another model? I tried using

                var pass = new MaterialPass();
                material.Passes.Add(pass);

                pass.Parameters.Set(MaterialKeys.DiffuseValue, color);
                pass.Parameters.Set(MaterialKeys.EmissiveValue, color);
                pass.Parameters.Set(MaterialKeys.EmissiveIntensity, emissiveIntensity);

The material of the object will turn black