예제 #1
0
파일: Matte.cs 프로젝트: Kintaro/Hyperion
 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)
        {
            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);
        }
예제 #3
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);
        }