Beispiel #1
0
 public void Execute()
 {
     for (int Index = 0; Index < CullingData.ViewMeshBatchs.Length; Index++)
     {
         if (CullingData.ViewMeshBatchs[Index] != 0)
         {
             FMeshBatch       MeshBatch     = MeshBatchs[Index];
             FPassMeshBatchV2 PassMeshBatch = new FPassMeshBatchV2(FMeshBatch.MatchForDynamicInstance(ref MeshBatch), Index);
             PassMeshBatchs.Add(PassMeshBatch);
         }
     }
 }
Beispiel #2
0
        public void Execute()
        {
            //Gather PassMeshBatch
            for (int Index = 0; Index < CullingData.ViewMeshBatchs.Length; Index++)
            {
                if (CullingData.ViewMeshBatchs[Index] != 0)
                {
                    FMeshBatch MeshBatch = MeshBatchs[Index];

                    if (MeshBatch.Priority >= MeshPassDesctiption.RenderQueueMin && MeshBatch.Priority <= MeshPassDesctiption.RenderQueueMax)
                    {
                        FPassMeshBatchV2 PassMeshBatch = new FPassMeshBatchV2(FMeshBatch.MatchForDynamicInstance(ref MeshBatch), Index);
                        PassMeshBatchs.Add(PassMeshBatch);
                    }
                }
            }

            //Sort PassMeshBatch
            PassMeshBatchs.Sort();

            //Build MeshDrawCommand
            FPassMeshBatchV2 CachePassMeshBatch = new FPassMeshBatchV2(-1, -1);

            for (int i = 0; i < PassMeshBatchs.Length; i++)
            {
                FPassMeshBatchV2 PassMeshBatch = PassMeshBatchs[i];
                Indexs[i] = PassMeshBatch.MeshBatchIndex;
                FMeshBatch MeshBatch = MeshBatchs[PassMeshBatch.MeshBatchIndex];

                if (!PassMeshBatch.Equals(CachePassMeshBatch))
                {
                    CachePassMeshBatch = PassMeshBatch;

                    CountOffsets.Add(new int2(0, i));
                    MeshDrawCommands.Add(new FMeshDrawCommandV2(MeshBatch.Mesh.Id, MeshBatch.Material.Id, MeshBatch.SubmeshIndex));
                }

                int2 CountOffset = CountOffsets[CountOffsets.Length - 1];
                CountOffsets[CountOffsets.Length - 1] = CountOffset + new int2(1, 0);
            }
        }
Beispiel #3
0
        public void Execute(int Index)
        {
            if (CullingData.ViewMeshBatchs[Index] != 0)
            {
                FMeshBatch MeshBatch = MeshBatchs[Index];

                FMeshDrawCommand MeshDrawCommand = new FMeshDrawCommand(MeshBatch.Mesh.Id, MeshBatch.Material.Id, MeshBatch.SubmeshIndex, FMeshBatch.MatchForDynamicInstance(ref MeshBatch));
                FPassMeshBatch   PassMeshBatch   = new FPassMeshBatch(Index);
                MeshDrawCommandsMap.Add(MeshDrawCommand, PassMeshBatch);
            }
        }