public static IMaterial CreateMaterial(Transform xform, TextureParameterSet mp) { ITexture<Spectrum> Kd = mp.GetSpectrumTexture ("Kd", new Spectrum (0.5)); ITexture<double> sigma = mp.GetDoubleTexture ("sigma", 0.0); ITexture<double> bumpMap = mp.GetDoubleTexture ("bumpmap", 0.0); return new Matte (Kd, sigma, bumpMap); }
public static IMaterial CreateMaterial(Transform xform, TextureParameterSet mp) { string m1 = mp.FindMaterialString ("first", ""); string m2 = mp.FindMaterialString ("second", ""); IMaterial mat1 = Api.GraphicsState.NamedMaterials[m1]; IMaterial mat2 = Api.GraphicsState.NamedMaterials[m2]; ITexture<Spectrum> scale = mp.GetSpectrumTexture ("amount", new Spectrum (0.5)); return new MixedMaterial (mat1, mat2, scale); }
public IMaterial CreateMaterial(ParameterSet parameters) { TextureParameterSet mp = new TextureParameterSet (parameters, MaterialParameters, FloatTextures, SpectrumTextures); IMaterial material = null; if (CurrentNamedMaterial != "" && NamedMaterials.ContainsKey (CurrentNamedMaterial)) { material = NamedMaterials[Api.GraphicsState.CurrentNamedMaterial]; } if (material == null) material = PluginSystem.PluginManager.CreateMaterial (Material, Api.CurrentTransform[0], mp); if (material == null) material = PluginSystem.PluginManager.CreateMaterial ("Matte", Api.CurrentTransform[0], mp); return material; }
public static IMaterial CreateMaterial(Transform xform, TextureParameterSet mp) { double[] sa_rgb = new double[] { 0.0011, 0.0024, 0.014 }, sps_rgb = new double[] { 2.55, 3.21, 3.77 }; Spectrum sa = Spectrum.FromRgb (sa_rgb), sps = Spectrum.FromRgb (sps_rgb); string name = ""; //mp.FindString ("name"); bool found = false; //GetVolumeScatteringProperties(name, &sa, &sps); if (name != "" && !found) ; double scale = 1.0; //mp.FindDouble ("scale", 1.0); ITexture<Spectrum> sigma_a, sigma_prime_s; sigma_a = mp.GetSpectrumTexture ("sigma_a", sa); sigma_prime_s = mp.GetSpectrumTexture ("sigma_prime_s", sps); ITexture<double> ior = mp.GetDoubleTexture ("index", 1.3f); ITexture<Spectrum> Kr = mp.GetSpectrumTexture ("Kr", new Spectrum (1.0)); ITexture<double> bumpMap = mp.GetDoubleTexture ("bumpmap", 0.0); return new Subsurface (scale, Kr, sigma_a, sigma_prime_s, ior, bumpMap); }
public static ITexture<Spectrum> CreateSpectrumTexture(string name, Transform textureToWorld, TextureParameterSet parameters) { /*SpectrumTexturePlugin plugin = new SpectrumTexturePlugin (name); return plugin.CreateSpectrumTexture (textureToWorld, parameters);*/ return Hyperion.Core.Textures.Imagemap<Spectrum, Spectrum>.CreateSpectrumTexture (textureToWorld, parameters); }
public static IMaterial CreateMaterial(string name, Transform objectToWorld, TextureParameterSet parameters) { MaterialPlugin plugin = new MaterialPlugin (name); return plugin.CreateMaterial (objectToWorld, parameters); }
public static ITexture<double> CreateDoubleTexture(string name, Transform textureToWorld, TextureParameterSet parameters) { /*TexturePlugin plugin = new TexturePlugin (name); return plugin.CreateDoubleTexture (textureToWorld, parameters);*/ return null; }
public static void Texture(string name, string type, string texname, ParameterSet parameterSet) { TextureParameterSet tp = new TextureParameterSet (parameterSet, parameterSet, Api.GraphicsState.FloatTextures, Api.GraphicsState.SpectrumTextures); Console.WriteLine ("Type: {0}, Name: {1}, Texname: {2}", type, name, texname); if (type == "float" || type == "double") { } else if (type == "color") { if (Api.GraphicsState.SpectrumTextures.ContainsKey (name)) ; ITexture<Spectrum> st = PluginSystem.PluginManager.CreateSpectrumTexture (texname, CurrentTransform[0], tp); Api.GraphicsState.SpectrumTextures[name] = st; } }