public void RenderInit(Rendering.ScriptableRenderContext renderContext) { var cmd = new CommandBuffer(); cmd.name = "Init PreFGD"; cmd.Blit(null, new RenderTargetIdentifier(m_PreIntegratedFGD), m_InitPreFGD, 0); renderContext.ExecuteCommandBuffer(cmd); cmd.Dispose(); isInit = true; }
static void CustomRenderPass(Rendering.ScriptableRenderContext ctx, Rendering.HighDefinition.HDCamera camera) { ctx.SetupCameraProperties(camera.camera); Rendering.CommandBuffer cb = new Rendering.CommandBuffer(); cb.ClearRenderTarget(true, true, Color.white); ctx.ExecuteCommandBuffer(cb); ctx.Submit(); Rendering.DrawingSettings drawSettings = new Rendering.DrawingSettings(); drawSettings.SetShaderPassName(0, new Rendering.ShaderTagId("Always")); Rendering.FilteringSettings filterSettings = Rendering.FilteringSettings.defaultValue; if (camera.camera.TryGetCullingParameters(out Rendering.ScriptableCullingParameters cullParams)) { Rendering.CullingResults cullResuts = ctx.Cull(ref cullParams); ctx.DrawRenderers(cullResuts, ref drawSettings, ref filterSettings); } }
// Following function can be use to initialize GPU resource (once or each frame) and bind them public virtual void RenderInit(Rendering.ScriptableRenderContext renderContext) { }