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)); }
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)); }
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)); }
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); } } }
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];