Пример #1
0
 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);
 }
Пример #2
0
        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);
        }