Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
 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);
     }
 }
Exemplo n.º 6
0
 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);
     }
 }
Exemplo n.º 7
0
        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);
            }
        }
Exemplo n.º 8
0
        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);
            }
        }