I test custom render use the sample, HDRP-Custom-Passes/Assets/Scenes/CameraDepthBaking/CameraDepthBake.cs at master · alelievr/HDRP-Custom-Passes · GitHub.
sample work correct, but because i want use my custom shader, so i can’t use the RenderDepthFromCamera api, then i change the src code from
// Depth
if (depthTexture != null)
CustomPassUtils.RenderDepthFromCamera(ctx, bakingCamera, depthTexture, ClearFlag.Depth, bakingCamera.cullingMask, overrideRenderState: overrideDepthTest);
to
// Depth
if (depthTexture != null)
{
//CustomPassUtils.RenderDepthFromCamera(ctx, bakingCamera, depthTexture, ClearFlag.Depth, bakingCamera.cullingMask, overrideRenderState: overrideDepthTest);
var filterSettings = new FilteringSettings(RenderQueueRange.opaque);
// Create the draw render settings
// note that it takes a shader pass name
var drawingSettings = new DrawingSettings();
drawingSettings.SetShaderPassName(0, new ShaderTagId("DepthOnly"));
// enable instancing for the draw call
drawingSettings.enableInstancing = true;
// pass light probe and lightmap data to each renderer
drawingSettings.perObjectData = PerObjectData.None;
ctx.renderContext.DrawRenderers(ctx.cullingResults, ref drawingSettings, ref filterSettings);
}
it don’t render anything now, why?
how could i debug it, know the reason, thanks.