示例#1
0
 public CubicalEnvironmentMap(ColorAtMethod front, ColorAtMethod back, ColorAtMethod left, ColorAtMethod right, ColorAtMethod up, ColorAtMethod down)
 {
     this.front = ColorAtMethods.GetOrBlack(front);
     this.back = ColorAtMethods.GetOrBlack(back);
     this.left = ColorAtMethods.GetOrBlack(left);
     this.right = ColorAtMethods.GetOrBlack(right);
     this.up = ColorAtMethods.GetOrBlack(up);
     this.down = ColorAtMethods.GetOrBlack(down);
 }
示例#2
0
 public static ColorAtMethod GetOrWhite(ColorAtMethod cam)
 {
     if(cam == null) {
         return GetWhite;
     }
     else {
         return cam;
     }
 }
示例#3
0
 public static ColorAtMethod GetOrBlack(ColorAtMethod cam)
 {
     if(cam == null) {
         return GetBlack;
     }
     else {
         return cam;
     }
 }
示例#4
0
 public Material(Color ambient, Color diffuse, Color specular, double shininess = 15.0d, double transparent = 0.0d, ColorAtMethod texture = null, ColorAtMethod reflection = null, NormalTweaker bump = null, double ni=1.0d, double nt = 1.1d, double reflectance = double.NaN, FactorFromAngle reflectanceGetter = null, double reflectanceThreshold = 0.5d)
 {
     this.Ambient = ambient;
     this.Specular = specular;
     this.Diffuse = diffuse;
     this.NFactor = nt/ni;
     this.BrewesterAngle = Math.Atan(this.NFactor);
     this.Shininess = shininess;
     this.Texture = texture;
     this.Reflection = reflection;
     this.Transparent = transparent;
     this.Bump = bump;
     this.FresnelR0 = (this.NFactor-1.0d)/(this.NFactor+1.0d);
     NFactor = 1.0d/NFactor;
     this.FresnelR0 *= this.FresnelR0;
     this.Reflectance = reflectance;
     this.ReflectanceGetter = reflectanceGetter;
     this.ReflectanceThreshold = reflectanceThreshold;
     if(reflectanceGetter == null) {
         if(double.IsNaN(reflectance)) {
             ReflectanceGetter = FresnelLaw;
         }
         else {
             ReflectanceGetter = ReflectanceConstant;
         }
     }
     if(this.Texture == null) {
         this.Texture = ColorAtMethods.GetWhite;
     }
     if(this.Reflection == null) {
         this.Reflection = ColorAtMethods.GetWhite;
     }
     if(this.Bump == null) {
         this.Bump = NullBump;
     }
 }
示例#5
0
 public CrossEnvironmentMap(ColorAtMethod cross)
 {
     this.cross = ColorAtMethods.GetOrBlack(cross);
 }
 public SphericalEnvironmentMap(ColorAtMethod negativeZ, ColorAtMethod positiveZ)
 {
     this.negativeZ = ColorAtMethods.GetOrBlack(negativeZ);
     this.positiveZ = ColorAtMethods.GetOrBlack(positiveZ);
 }