Esempio n. 1
0
 public void Set(float v0, float v1, float v2, float v3)
 {
     p0 = ShadowUtils.Asint(v0);
     p1 = ShadowUtils.Asint(v1);
     p2 = ShadowUtils.Asint(v2);
     p3 = ShadowUtils.Asint(v3);
 }
Esempio n. 2
0
            protected override void PrioritizeShadowCasters(Camera camera, VisibleLight[] lights, uint shadowRequestsCount, int[] shadowRequests)
            {
                // this function simply looks at the projected area on the screen, ignoring all light types and shapes
                m_TmpSortKeys.Reset(shadowRequestsCount);

                for (int i = 0; i < shadowRequestsCount; ++i)
                {
                    int          vlidx = shadowRequests[i];
                    VisibleLight vl    = lights[vlidx];
                    Light        l     = vl.light;

                    // use the screen rect as a measure of importance
                    float area = vl.screenRect.width * vl.screenRect.height;
                    long  val  = ShadowUtils.Asint(area);
                    val <<= 32;
                    val  |= (long)(uint)vlidx;
                    m_TmpSortKeys.AddUnchecked(val);
                }
                m_TmpSortKeys.Sort();
                m_TmpSortKeys.ExtractTo(shadowRequests, 0, out shadowRequestsCount, delegate(long key) { return((int)(key & 0xffffffff)); });
            }