Example #1
0
 private ShadingState(ShadingState previous, IntersectionState istate, Ray r, int i, int d)
 {
     this.r           = r;
     this.istate      = istate;
     this.i           = i;
     this.d           = d;
     this.instance    = istate.instance; // local copy
     this.primitiveID = istate.id;
     this.hitU        = istate.u;
     this.hitV        = istate.v;
     if (previous == null)
     {
         diffuseDepth    = 0;
         reflectionDepth = 0;
         refractionDepth = 0;
     }
     else
     {
         diffuseDepth    = previous.diffuseDepth;
         reflectionDepth = previous.reflectionDepth;
         refractionDepth = previous.refractionDepth;
         this.server     = previous.server;
         this.map        = previous.map;
         this.rx         = previous.rx;
         this.ry         = previous.ry;
         this.i         += previous.i;
         this.d         += previous.d;
     }
     behind        = false;
     cosND         = float.NaN;
     includeLights = includeSpecular = true;
     qmcD0I        = QMC.halton(this.d, this.i);
     qmcD1I        = QMC.halton(this.d + 1, this.i);
     result        = null;
 }
Example #2
0
 public CalculatePhotons(int start, int end, LightServer server, int seed, float[] histogram, float scale, PhotonStore map, object lockObj)
 {
     this.start     = start;
     this.end       = end;
     this.server    = server;
     this.seed      = seed;
     this.histogram = histogram;
     this.lockObj   = lockObj;
     this.scale     = scale;
     this.map       = map;
     this.lockObj   = lockObj;
 }
Example #3
0
        private ShadingState(ShadingState previous, IntersectionState istate, Ray r, int i, int d)
        {
            this.r      = r;
            this.istate = istate;
            this.i      = i;
            this.d      = d;
            time        = istate.time;
            instance    = istate.instance; // local copy
            primitiveID = istate.id;
            hitU        = istate.u;
            hitV        = istate.v;
            hitW        = istate.w;
            // get matrices for current time
            o2w = instance.getObjectToWorld(time);
            w2o = instance.getWorldToObject(time);

            if (previous == null)
            {
                diffuseDepth    = 0;
                reflectionDepth = 0;
                refractionDepth = 0;
            }
            else
            {
                diffuseDepth    = previous.diffuseDepth;
                reflectionDepth = previous.reflectionDepth;
                refractionDepth = previous.refractionDepth;
                server          = previous.server;
                map             = previous.map;
                rx      = previous.rx;
                ry      = previous.ry;
                this.i += previous.i;
                this.d += previous.d;
            }
            behind        = false;
            cosND         = float.NaN;
            includeLights = includeSpecular = true;
            qmcD0I        = QMC.halton(this.d, this.i);
            qmcD1I        = QMC.halton(this.d + 1, this.i);
            result        = null;
            bias          = 0.001f;
        }
Example #4
0
        /**
         * Creates an empty scene.
         */
        public Scene()
        {
            lightServer = new LightServer(this);
            instanceList = new InstanceList();
            infiniteInstanceList = new InstanceList();
            acceltype = "auto";

            bakingViewDependent = false;
            bakingInstance = null;
            bakingPrimitives = null;
            bakingAccel = null;

            camera = null;
            imageWidth = 640;
            imageHeight = 480;
            threads = 0;
            lowPriority = true;

            rebuildAccel = true;
        }
Example #5
0
        /**
         * Creates an empty scene.
         */
        public Scene()
        {
            lightServer          = new LightServer(this);
            instanceList         = new InstanceList();
            infiniteInstanceList = new InstanceList();
            acceltype            = "auto";

            bakingViewDependent = false;
            bakingInstance      = null;
            bakingPrimitives    = null;
            bakingAccel         = null;

            camera      = null;
            imageWidth  = 640;
            imageHeight = 480;
            threads     = 0;
            lowPriority = true;

            rebuildAccel = true;
        }
Example #6
0
 public CalculatePhotons(int start, int end, LightServer server, int seed, float[] histogram, float scale, PhotonStore map, object lockObj)
 {
     this.start = start;
     this.end = end;
     this.server = server;
     this.seed = seed;
     this.histogram = histogram;
     this.lockObj = lockObj;
     this.scale = scale;
     this.map = map;
     this.lockObj = lockObj;
 }
Example #7
0
        public static ShadingState createState(IntersectionState istate, float rx, float ry, Ray r, int i, LightServer server)
        {
            ShadingState s = new ShadingState(null, istate, r, i, 4);

            s.server = server;
            s.rx     = rx;
            s.ry     = ry;
            return(s);
        }
Example #8
0
        public static ShadingState createPhotonState(Ray r, IntersectionState istate, int i, PhotonStore map, LightServer server)
        {
            ShadingState s = new ShadingState(null, istate, r, i, 4);

            s.server = server;
            s.map    = map;
            return(s);
        }