Exemple #1
0
        void CustomRender(ScriptableRenderContext context, HDCamera hd)
        {
            var cmd = CommandBufferPool.Get();

            SensorPassRenderer.Render(context, cmd, hd, renderTarget, passId, SimulatorManager.Instance.SkySegmentationColor);
            CommandBufferPool.Release(cmd);
        }
        private void OnSegmentationRender(ScriptableRenderContext context, HDCamera hdCamera)
        {
            var cmd = CommandBufferPool.Get();

            SensorPassRenderer.Render(context, cmd, hdCamera, renderTarget, passId, SimulatorManager.Instance.SkySegmentationColor);

            var clearKernel = cs.FindKernel("Clear");

            cmd.SetComputeVectorParam(cs, Properties.TexSize, new Vector4(Width, Height, 1f / Width, 1f / Height));
            cmd.SetComputeBufferParam(cs, clearKernel, Properties.MinX, minX);
            cmd.SetComputeBufferParam(cs, clearKernel, Properties.MaxX, maxX);
            cmd.SetComputeBufferParam(cs, clearKernel, Properties.MinY, minY);
            cmd.SetComputeBufferParam(cs, clearKernel, Properties.MaxY, maxY);
            cmd.DispatchCompute(cs, clearKernel, 4, 1, 1);

            var detectKernel = cs.FindKernel("Detect");

            cmd.SetComputeTextureParam(cs, detectKernel, Properties.Input, renderTarget.ColorHandle);
            cmd.SetComputeVectorParam(cs, Properties.TexSize, new Vector4(Width, Height, 1f / Width, 1f / Height));
            cmd.SetComputeBufferParam(cs, detectKernel, Properties.MinX, minX);
            cmd.SetComputeBufferParam(cs, detectKernel, Properties.MaxX, maxX);
            cmd.SetComputeBufferParam(cs, detectKernel, Properties.MinY, minY);
            cmd.SetComputeBufferParam(cs, detectKernel, Properties.MaxY, maxY);
            cmd.DispatchCompute(cs, detectKernel, HDRPUtilities.GetGroupSize(Width, 8), HDRPUtilities.GetGroupSize(Height, 8), 1);

            context.ExecuteCommandBuffer(cmd);
            cmd.Clear();
            CommandBufferPool.Release(cmd);
        }
Exemple #3
0
        private void CustomRender(ScriptableRenderContext context, HDCamera hd)
        {
            var cmd = CommandBufferPool.Get();

            void RenderPointCloud(CubemapFace face)
            {
                PointCloudManager.RenderLidar(context, cmd, hd, renderTarget.ColorHandle, renderTarget.DepthHandle, face);
            }

            RenderMarker.Begin();
            SensorPassRenderer.Render(context, cmd, hd, renderTarget, passId, Color.clear, RenderPointCloud);
            RenderMarker.End();

            ComputeMarker.Begin();
            var kernel = cs.FindKernel(Compensated ? "CubeComputeComp" : "CubeCompute");

            cmd.SetComputeTextureParam(cs, kernel, Properties.InputCubemapTexture, renderTarget.ColorHandle);
            cmd.SetComputeBufferParam(cs, kernel, Properties.Output, PointCloudBuffer);
            cmd.SetComputeBufferParam(cs, kernel, Properties.LatitudeAngles, LatitudeAnglesBuffer);
            cmd.SetComputeIntParam(cs, Properties.LaserCount, LaserCount);
            cmd.SetComputeIntParam(cs, Properties.MeasuresPerRotation, UsedMeasurementsPerRotation);
            cmd.SetComputeFloatParam(cs, Properties.AntialiasingThreshold, AntialiasingThreshold);
            cmd.SetComputeVectorParam(cs, Properties.Origin, SensorCamera.transform.position);
            cmd.SetComputeMatrixParam(cs, Properties.RotMatrix, Matrix4x4.Rotate(transform.rotation));
            cmd.SetComputeMatrixParam(cs, Properties.Transform, transform.worldToLocalMatrix);
            cmd.SetComputeVectorParam(cs, Properties.PackedVec, new Vector4(MaxDistance, DeltaLongitudeAngle, MinDistance, StartLongitudeOffset));
            cmd.DispatchCompute(cs, kernel, HDRPUtilities.GetGroupSize(UsedMeasurementsPerRotation, 8), HDRPUtilities.GetGroupSize(LaserCount, 8), 1);
            ComputeMarker.End();

            context.ExecuteCommandBuffer(cmd);
            cmd.Clear();
            CommandBufferPool.Release(cmd);
        }
Exemple #4
0
        public void CustomRender(ScriptableRenderContext context, HDCamera hd)
        {
            var cmd = CommandBufferPool.Get();

            SensorPassRenderer.Render(context, cmd, hd, activeTarget, passId, Color.clear);
            PointCloudManager.RenderLidar(context, cmd, hd, activeTarget.ColorHandle, activeTarget.DepthHandle);
            CommandBufferPool.Release(cmd);
        }
        void CustomRender(ScriptableRenderContext context, HDCamera hd)
        {
            var cmd = CommandBufferPool.Get();

            SensorPassRenderer.Render(context, cmd, hd, renderTarget, passId, Color.clear);
            if (!Fisheye)
            {
                PointCloudManager.RenderDepth(context, cmd, hd, renderTarget.ColorHandle, renderTarget.DepthHandle);
            }
            CommandBufferPool.Release(cmd);
        }
Exemple #6
0
        void CustomRender(ScriptableRenderContext context, HDCamera hd)
        {
            var cmd = CommandBufferPool.Get();

            SensorPassRenderer.Render(context, cmd, hd, renderTarget, passId, SimulatorManager.Instance.SkySegmentationColor);
            var kernel = computeUtils.FindKernel("FillAlphaXR");

            cmd.SetComputeTextureParam(computeUtils, kernel, Properties.Output, renderTarget.ColorHandle);
            cmd.SetComputeVectorParam(computeUtils, Properties.TexSize, new Vector4(Width, Height, 1f / Width, 1f / Height));
            cmd.DispatchCompute(computeUtils, kernel, HDRPUtilities.GetGroupSize(Width, 8), HDRPUtilities.GetGroupSize(Height, 8), 1);
            context.ExecuteCommandBuffer(cmd);
            cmd.Clear();
            CommandBufferPool.Release(cmd);
        }