예제 #1
0
        }                                                                                                 // return value gives a weight for how much light arriving at the film (most return one)

        public virtual float GenerateRayDifferential(CameraSample sample, out RayDifferential rd)
        {
            // rd = new RayDifferential();
            float wt = GenerateRay(sample, out rd);
            //x direction
            CameraSample sshift = sample;

            ++(sshift.imageX);
            Ray   rx  = new Ray();
            float wtx = GenerateRay(sshift, out rx);

            rd.rxOrigin    = rx.o;
            rd.rxDirection = rx.d;

            // y direction
            --(sshift.imageX);
            ++(sshift.imageY);
            Ray   ry  = new Ray();;
            float wty = GenerateRay(sshift, out ry);

            rd.ryOrigin    = ry.o;
            rd.ryDirection = ry.d;


            if (wtx == 0.0f || wty == 0.0f)
            {
                return(0.0f);
            }
            rd.hasDifferentials = true;
            return(wt);
        }
예제 #2
0
        public RayDifferential Caculate(RayDifferential r)
        {
            RayDifferential rd = new RayDifferential(Caculate(r.o), Caculate(r.d));

            rd.rxOrigin         = Caculate(r.rxOrigin);
            rd.rxDirection      = Caculate(r.rxDirection);
            rd.ryOrigin         = Caculate(r.ryOrigin);
            rd.ryDirection      = Caculate(r.ryDirection);
            rd.hasDifferentials = r.hasDifferentials;
            return(rd);
        }
예제 #3
0
        public RayDifferential Caculate(RayDifferential r)
        {
            RayDifferential tr;//= new RayDifferential();

            if (!actuallyAnimated || r.time <= startTime)
            {
                tr = startTransform.Caculate(r);
            }
            else if (r.time >= endTime)
            {
                tr = endTransform.Caculate(r);
            }
            else
            {
                Transform t;
                Interpolate(r.time, out t);
                tr = t.Caculate(r);
            }
            tr.time = r.time;
            return(tr);
        }
예제 #4
0
 public virtual float GenerateRay(CameraSample sample, out RayDifferential rd)
 {
     throw new NotImplementedException();
 }