//--------------------------------------------------------------------------------------------------------------------------------------------------- private void RenderShadowSplit(ref ShadowSliceData slice, Vector3 lightDirection, Matrix4x4 proj, Matrix4x4 view, ref RenderLoop loop, DrawShadowsSettings settings) { var commandBuffer = new CommandBuffer { name = "ShadowSetup" }; // Set viewport / matrices etc commandBuffer.SetViewport(new Rect(slice.atlasX, slice.atlasY, slice.shadowResolution, slice.shadowResolution)); //commandBuffer.ClearRenderTarget (true, true, Color.green); commandBuffer.SetGlobalVector("g_vLightDirWs", new Vector4(lightDirection.x, lightDirection.y, lightDirection.z)); commandBuffer.SetProjectionAndViewMatrices(proj, view); // commandBuffer.SetGlobalDepthBias (1.0F, 1.0F); loop.ExecuteCommandBuffer(commandBuffer); commandBuffer.Dispose(); // Render loop.DrawShadows(ref settings); }