Exemplo n.º 1
0
            void ScheduleCullingJob(NativeArray <Voxel> voxels, int chunkSize)
            {
                VoxelCullingJob voxelCullingJob = new VoxelCullingJob
                {
                    voxels    = voxels,
                    chunkSize = chunkSize,
                    vertices  = nativeVertices,
                    normals   = nativeNormals,
                    uvs       = nativeUVs,
                    indices   = nativeIndices,
                    colors    = nativeColors,
                    lightData = nativeLightData,
                    counter   = counter.ToConcurrent(),
                };

                jobHandle = voxelCullingJob.Schedule(voxels.Length, 32);
                JobHandle.ScheduleBatchedJobs();
            }
Exemplo n.º 2
0
            void ScheduleCullingJob(NativeArray <Voxel> voxels, VoxelLightBuilder.NativeLightData lightData, int3 chunkSize)
            {
                VoxelCullingJob voxelCullingJob = new VoxelCullingJob
                {
                    voxels    = voxels,
                    chunkSize = chunkSize,
                    vertices  = nativeVertices,
                    normals   = nativeNormals,
                    uvs       = nativeUVs,
                    indices   = nativeIndices,
                    colors    = nativeColors,
                    lightData = lightData.nativeLightData,
                    counter   = counter,
                };

                jobHandle = voxelCullingJob.Schedule();
                JobHandle.ScheduleBatchedJobs();
            }