Пример #1
0
        // for each cluster
        public void Execute(int i)
        {
            int  clusterIndex1D = i;
            int  lightOffs      = 0;
            int  decalsOffs     = 0;
            AABB clusterAABB    = InputClusterAABBS[clusterIndex1D];

            //1.light clulling test
            //todo more light type
            for (int index = 0; index < VisibleLightsCount && lightOffs < NumItemsPerCluster; ++index)
            {
                SFiniteLightBound bound = LightBounds[index];
                if (IntersectAABBAABB(clusterAABB, bound.aabb))
                {
                    if (IntersectAABBPlaneBounds(clusterAABB, bound.planes))
                    {
                        Item_Set_Light(clusterIndex1D, lightOffs, (uint)index);
                        ++lightOffs;
                    }
                }
            }
            //2.todo decals
            //3.set cluster info
            ClusterInfoSet(clusterIndex1D, lightOffs, decalsOffs);
        }
        // for each cluster
        public void Execute(int i)
        {
            int  clusterIndex1D = i;
            int  lightOffs      = 0;
            int  decalsOffs     = 0;
            AABB clusterAABB    = InputClusterAABBS[clusterIndex1D];

            //1.light clulling test
            //todo more light type
            for (int index = 0; index < VisibleLightsCount; ++index)
            {
                SFiniteLightBound bound = LightBounds[index];
                SPlanes           planes;
//#if UNITY_EDITOR
//                if (IsClusterEditorHelper)
//                {
//                    planes = Projector.GetCullingPlanes(bound.frustumMatrix, _CameraWorldMatrix);//world to view
//                }
//                else
//#endif
                {
                    planes = bound.planes;
                }
                //planes = IFPipelineProjector.GetCullingPlanes(bound.frustumMatrix, _CameraWorldMatrix);
                if (IntersectAABBPlaneBounds(clusterAABB, planes))
                {
                    Item_Set_Light(clusterIndex1D, lightOffs, (uint)index);
                    ++lightOffs;
                }
            }
            //2.todo decals
            //3.set cluster info
            ClusterInfoSet(clusterIndex1D, lightOffs, decalsOffs);
        }