Пример #1
0
        public void AddRange(NativeList_Int array)
        {
            int last = data->count;

            data->count += array.Length;
            ResizeToCount();
            void *dest = unsafePtr + last;

            UnsafeUtility.MemCpy(dest, array.unsafePtr, array.Length * sizeof(int));
        }
Пример #2
0
 public override void PreRenderFrame(PipelineCamera cam, ref PipelineCommandData data)
 {
     customCullResults = new NativeList_Int(CustomDrawRequest.drawTransparentList.Length, Unity.Collections.Allocator.Temp);
     cullJob           = new CustomRendererCullJob
     {
         cullResult    = customCullResults,
         frustumPlanes = (float4 *)proper.frustumPlanes.Ptr(),
         indexBuffer   = CustomDrawRequest.drawTransparentList
     }.Schedule(CustomDrawRequest.drawTransparentList.Length, max(1, CustomDrawRequest.drawTransparentList.Length / 4));
 }
Пример #3
0
 public override void PreRenderFrame(PipelineCamera cam, ref PipelineCommandData data)
 {
     gbufferCullResults = new NativeList_Int(CustomDrawRequest.drawGBufferList.Length, Allocator.Temp);
     cullHandle         = new CustomRendererCullJob
     {
         cullResult    = gbufferCullResults,
         frustumPlanes = (float4 *)proper.frustumPlanes.Ptr(),
         indexBuffer   = CustomDrawRequest.drawGBufferList
     }.Schedule(CustomDrawRequest.drawGBufferList.Length, max(1, CustomDrawRequest.drawGBufferList.Length / 4));
 }
Пример #4
0
 public static void ExecuteInList(NativeList_Int cullResult, float4 *frustumPlanes, NativeList_ulong indexBuffer)
 {
     for (int i = 0; i < indexBuffer.Length; ++i)
     {
         CustomDrawRequest.ComponentData *dataPtr = (CustomDrawRequest.ComponentData *)indexBuffer[i];
         if (MathLib.BoxIntersect(ref dataPtr->localToWorldMatrix, dataPtr->boundingBoxPosition, dataPtr->boundingBoxExtents, frustumPlanes, 6))
         {
             cullResult.ConcurrentAdd(dataPtr->index);
         }
     }
 }
Пример #5
0
 public static void DrawSpotLight(MLight mlight, int mask, ComputeShader cullingShader, ref PipelineCommandData data, ref SpotLight spotLights, ref RenderSpotShadowCommand spotcommand, bool inverseRender, Material opaqueOverride, NativeList_Int culledResult)
 {
     if (mlight.ShadowIndex < 0)
     {
         return;
     }
     CommandBuffer       buffer          = data.buffer;
     ref SpotLightMatrix spotLightMatrix = ref spotcommand.shadowMatrices[spotLights.shadowIndex];