public Material CreateMaterial(ParamSet parameters, Transform transform) { var textureParams = new TextureParams(parameters, MaterialParams, FloatTextures, SpectrumTextures); if (!string.IsNullOrEmpty(CurrentNamedMaterial) && NamedMaterials.ContainsKey(CurrentNamedMaterial)) return NamedMaterials[CurrentNamedMaterial]; return Factories.MakeMaterial(Material, transform, textureParams); }
public Material CreateMaterial(ParamSet parameters, Transform transform) { var textureParams = new TextureParams(parameters, MaterialParams, FloatTextures, SpectrumTextures); if (!string.IsNullOrEmpty(CurrentNamedMaterial) && NamedMaterials.ContainsKey(CurrentNamedMaterial)) { return(NamedMaterials[CurrentNamedMaterial]); } return(Factories.MakeMaterial(Material, transform, textureParams)); }
public static Material MakeMaterial(string name, Transform materialToWorld, TextureParams parameters) { switch (name) { case "matte": { var kd = parameters.GetSpectrumTexture("Kd", new Spectrum(0.5f)); var sigma = parameters.GetFloatTexture("sigma", 0.0f); var bumpMap = parameters.GetOptionalFloatTexture("bumpmap"); return(new MatteMaterial(kd, sigma, bumpMap)); } default: throw new ArgumentException("Unknown material: " + name); } }
public static Texture<Spectrum> MakeSpectrumTexture(string name, Transform textureToWorld, TextureParams textureParams) { switch (name) { case "constant": { return new ConstantTexture<Spectrum>(textureParams.FindSpectrum("value", new Spectrum(1.0f))); } default: throw new ArgumentException("Unknown spectrum texture: " + name); } }
public static Texture<float> MakeFloatTexture(string name, Transform textureToWorld, TextureParams textureParams) { switch (name) { case "constant": { return new ConstantTexture<float>(textureParams.FindSingle("value", 1.0f)); } default: throw new ArgumentException("Unknown float texture: " + name); } }
public static Material MakeMaterial(string name, Transform materialToWorld, TextureParams parameters) { switch (name) { case "matte" : { var kd = parameters.GetSpectrumTexture("Kd", new Spectrum(0.5f)); var sigma = parameters.GetFloatTexture("sigma", 0.0f); var bumpMap = parameters.GetOptionalFloatTexture("bumpmap"); return new MatteMaterial(kd, sigma, bumpMap); } default: throw new ArgumentException("Unknown material: " + name); } }
public static Texture <Spectrum> MakeSpectrumTexture(string name, Transform textureToWorld, TextureParams textureParams) { switch (name) { case "constant": { return(new ConstantTexture <Spectrum>(textureParams.FindSpectrum("value", new Spectrum(1.0f)))); } default: throw new ArgumentException("Unknown spectrum texture: " + name); } }
public static Texture <float> MakeFloatTexture(string name, Transform textureToWorld, TextureParams textureParams) { switch (name) { case "constant": { return(new ConstantTexture <float>(textureParams.FindSingle("value", 1.0f))); } default: throw new ArgumentException("Unknown float texture: " + name); } }