string GetOrCreateMaterial(WarpRenderer renderer, Color4 color)
        {
            string name = color.ToString();

            warp_Material material = renderer.Scene.material(name);

            if (material != null)
            {
                return(name);
            }

            renderer.AddMaterial(name, ConvertColor(color));
            if (color.A < 1f)
            {
                renderer.Scene.material(name).setTransparency((byte)((1f - color.A) * 255f));
            }
            return(name);
        }
        public string GetOrCreateMaterial(WarpRenderer renderer, Color4 faceColor, UUID textureID)
        {
            string materialName = "Color-" + faceColor + "-Texture-" + textureID;

            if (renderer.Scene.material(materialName) == null)
            {
                MainConsole.Instance.DebugFormat("[WarpTile generator]: Creating material {0}", materialName);
                renderer.AddMaterial(materialName, ConvertColor(faceColor));
                if (faceColor.A < 1f)
                {
                    renderer.Scene.material(materialName).setTransparency((byte)((1f - faceColor.A) * 255f));
                }
                warp_Texture texture = GetTexture(textureID);
                if (texture != null)
                {
                    renderer.Scene.material(materialName).setTexture(texture);
                }
            }

            return(materialName);
        }
        public string GetOrCreateMaterial (WarpRenderer renderer, Color4 faceColor, UUID textureID)
        {
            string materialName = "Color-" + faceColor + "-Texture-" + textureID;

            if (renderer.Scene.material (materialName) == null) {
                MainConsole.Instance.DebugFormat ("Creating material {0}", materialName);
                renderer.AddMaterial (materialName, ConvertColor (faceColor));
                if (faceColor.A < 1f) {
                    renderer.Scene.material (materialName).setTransparency ((byte)((1f - faceColor.A) * 255f));
                }
                warp_Texture texture = GetTexture (textureID);
                if (texture != null)
                    renderer.Scene.material (materialName).setTexture (texture);
            }

            return materialName;
        }
        string GetOrCreateMaterial (WarpRenderer renderer, Color4 color)
        {
            string name = color.ToString ();

            warp_Material material = renderer.Scene.material (name);
            if (material != null)
                return name;

            renderer.AddMaterial (name, ConvertColor (color));
            if (color.A < 1f)
                renderer.Scene.material (name).setTransparency ((byte)((1f - color.A) * 255f));
            return name;
        }