Opaque Discs Drawing Over Cnavas
I am drawing opaque discs in immediate mode using "beginCameraRendering" but they draw on top of world space canvases. Is there anything I can do to fix this?
Reporting a bug? please specify Unity version:
2022.3.27f1
Reporting a bug? please specify Shapes version:
4.3.1
Reporting a bug? please specify Render Pipeline:
URP
Thanks! I was not using "RenderPassEvent.AfterRenderingOpaques". Seems to have fixed the issue.
Is there any downside to subscribing like this as opposed to using ImmediateModeShapeDrawer:
protected virtual void Awake()
{
RenderPipelineManager.beginCameraRendering += Draw;
}
private void OnDestroy()
{
RenderPipelineManager.beginCameraRendering -= Draw;
}
and then in the Draw function:
private void Draw(ScriptableRenderContext context, Camera camera)
{
using (Shapes.Draw.Command(camera, RenderPassEvent.AfterRenderingOpaques))
{
// Draw stuff here!
}
}
I like to do this for each script that needs to draw. I understand I lose the ability to define draw order, but otherwise it should be fine right? Instancing should work out alright since I am only drawing similar shapes within the same draw function.