/// <summary> /// Sets the shader and properties to the input material /// </summary> /// <param name="material"></param> public void apply(Material material) { material.shader = TexturesUnlimitedLoader.getShader(shader); TextureSet.updateMaterialProperties(material, shaderProperties); TextureSet.fillEmptyStockTextureSlots(material); material.renderQueue = TexturesUnlimitedLoader.isTransparentMaterial(material) ? TexturesUnlimitedLoader.transparentTextureRenderQueue : TexturesUnlimitedLoader.diffuseTextureRenderQueue; }
/// <summary> /// Return a new material instances instatiated with the shader and properties for this material data. /// Does not include applying any recoloring data -- that needs to be handled externally. /// </summary> /// <returns></returns> public Material createMaterial() { if (string.IsNullOrEmpty(this.shader)) { //TODO -- include texture set name somehow... throw new NullReferenceException("ERROR: No shader specified for texture set."); } Shader shader = TexturesUnlimitedLoader.getShader(this.shader); Material material = new Material(shader); TextureSet.updateMaterialProperties(material, shaderProperties); material.renderQueue = TexturesUnlimitedLoader.isTransparentMaterial(material) ? TexturesUnlimitedLoader.transparentTextureRenderQueue : TexturesUnlimitedLoader.diffuseTextureRenderQueue; return(material); }