protected override void Render(ScriptableRenderContext context, Camera[] cameras) { int maxWidth = 1; int maxHeight = 1; foreach (var camera in cameras) { maxWidth = Mathf.Max(maxWidth, camera.pixelWidth); maxHeight = Mathf.Max(maxHeight, camera.pixelHeight); } //RTHandles.SetReferenceSize(maxWidth,maxHeight,m_MSAASample); RTHandles.SetReferenceSize(1920, 1080, m_MSAASample); ShaderBindings.SetPerFrameShaderVariables(context); foreach (Camera camera in cameras) { #if UNITY_EDITOR if (camera.cameraType == CameraType.SceneView) { ScriptableRenderContext.EmitWorldGeometryForSceneView(camera); } #endif CullingResults cullingResults = Cull(context, camera); ShaderBindings.SetPerCameraShaderVariables(context, camera); DrawCamera(context, cullingResults, camera); } }
void DebugPass(ScriptableRenderContext context, CullingResults cullingResults, Camera camera) { ShaderBindings.SetPerCameraShaderVariables(context, camera, false); var cmd = CommandBufferPool.Get("DebugLightDraw"); cmd.SetGlobalTexture("_NumberChart", m_NumberCharts); cmd.DrawMesh(CustomRenderPipeline.fullscreenMesh, Matrix4x4.identity, m_DebugLightCountMat, 0, 0); context.ExecuteCommandBuffer(cmd); CommandBufferPool.Release(cmd); }
protected override void Render(ScriptableRenderContext context, Camera[] cameras) { ShaderBindings.SetPerFrameShaderVariables(context); foreach (Camera camera in cameras) { #if UNITY_EDITOR if (camera.cameraType == CameraType.SceneView) { ScriptableRenderContext.EmitWorldGeometryForSceneView(camera); } #endif CullingResults cullingResults = Cull(context, camera); ShaderBindings.SetPerCameraShaderVariables(context, camera); DrawCamera(context, cullingResults, camera); } }