private void Execute(DecalCulledChunk culledChunk, int count)
        {
            if (count == 0)
            {
                return;
            }

            culledChunk.currentJobHandle.Complete();

            CullingGroup cullingGroup = culledChunk.cullingGroups;

            culledChunk.visibleDecalCount = cullingGroup.QueryIndices(true, culledChunk.visibleDecalIndexArray, 0);
            culledChunk.visibleDecalIndices.CopyFrom(culledChunk.visibleDecalIndexArray);
        }
Пример #2
0
        private void Execute(DecalCachedChunk cachedChunk, DecalCulledChunk culledChunk, DecalDrawCallChunk drawCallChunk, int count)
        {
            if (count == 0)
            {
                return;
            }

            DrawCallJob drawCallJob = new DrawCallJob()
            {
                decalToWorlds   = cachedChunk.decalToWorlds,
                normalToWorlds  = cachedChunk.normalToWorlds,
                sizeOffsets     = cachedChunk.sizeOffsets,
                drawDistances   = cachedChunk.drawDistances,
                angleFades      = cachedChunk.angleFades,
                uvScaleBiases   = cachedChunk.uvScaleBias,
                layerMasks      = cachedChunk.layerMasks,
                sceneLayerMasks = cachedChunk.sceneLayerMasks,
                fadeFactors     = cachedChunk.fadeFactors,
                boundingSpheres = cachedChunk.boundingSpheres,

                cameraPosition      = culledChunk.cameraPosition,
                sceneCullingMask    = culledChunk.sceneCullingMask,
                cullingMask         = culledChunk.cullingMask,
                visibleDecalIndices = culledChunk.visibleDecalIndices,
                visibleDecalCount   = culledChunk.visibleDecalCount,
                maxDrawDistance     = m_MaxDrawDistance,

                decalToWorldsDraw  = drawCallChunk.decalToWorlds,
                normalToDecalsDraw = drawCallChunk.normalToDecals,
                subCalls           = drawCallChunk.subCalls,
                subCallCount       = drawCallChunk.subCallCounts,
            };

            var handle = drawCallJob.Schedule(cachedChunk.currentJobHandle);

            drawCallChunk.currentJobHandle = handle;
            cachedChunk.currentJobHandle   = handle;
        }