public DifferentialGeometry(Point point, Vector dpdu, Vector dpdv,
            Normal dndu, Normal dndv, float u, float v, Shape shape)
        {
            Point = point;
            Normal = (Normal) Vector.Normalize(Vector.Cross(dpdu, dpdv));
            DpDu = dpdu;
            DpDv = dpdv;
            DnDu = dndu;
            DnDv = dndv;
            U = u;
            V = v;
            Shape = shape;

            if (shape != null && shape.ReverseOrientation != shape.TransformSwapsHandedness)
                Normal *= -1.0f;
        }
示例#2
0
 public static AreaLight MakeAreaLight(string name, Transform lightToWorld,
     ParamSet parameters, Shape shape)
 {
     switch (name)
     {
         case "area":
         case "diffuse":
         {
             var l = parameters.FindSpectrum("L", new Spectrum(1.0f));
             var scale = parameters.FindSpectrum("scale", new Spectrum(1.0f));
             var numSamples = parameters.FindInt32("nsamples", 1);
             return new DiffuseAreaLight(lightToWorld, l * scale, numSamples, shape);
         }
         default:
             throw new ArgumentException("Unknown area light: " + name);
     }
 }
示例#3
0
 public DiffuseAreaLight(Transform lightToWorld, Spectrum lemit, int numSamples, Shape shape) 
     : base(lightToWorld, numSamples)
 {
 }
示例#4
0
 public GeometricPrimitive(Shape shape, Material material, AreaLight areaLight)
 {
     _shape = shape;
     _material = material;
     _areaLight = areaLight;
 }