knight0fw0e
15-10-2006 12:36:21
Here's the code with wich I tried to create material manually.
It compiles fine, but thorws an exception at runtime, 'cause it can't convert Resource to Material
Played with it a little, but still can't figure out how to create a material manually. Anyone can help?
ResourcePtr mat = MaterialManager.GetSingleton().Create("boundingBox", "General", true);
Material material = (Material)mat.Get();
material.GetTechnique(0).getPass(0).setDiffuse(Color.FromArgb(255, 255, 255));
material.GetTechnique(0).getPass(0).setDepthCheckEnabled(false);
material.GetTechnique(0).getPass(0).setDepthWriteEnabled(false);
material.GetTechnique(0).getPass(0).setLightingEnabled(false);
It compiles fine, but thorws an exception at runtime, 'cause it can't convert Resource to Material
Played with it a little, but still can't figure out how to create a material manually. Anyone can help?