Render camera view in post_draw

Want to render a secundary camera view as image in post draw/overlay. Is there a way to make it work?

from bge import logic,texture

scene = logic.getCurrentScene()

cam = scene.objects['Camera.001']

def overlay():
    render = texture.ImageRender(scene, cam)
    return render.image

scene.post_draw = []
scene.post_draw.append(overlay)

I think we can call the render to texture to a offscreen, then run a 2d filter to put it on the screen buffer but I could be mistaken*

Why not ImageRender? Do you know how to use it?

I have used image render to a offscreen / texture

I have used a offscreen in a 2d filter also

I think that only bpy image render works in ‘use viewport render mode’ in upbge 3.x +

I have never used render to texture to render to scene camera, instead to a plane in front of the camera as a texture.