Rendering camera to image (ImageRender) not working Following the few examples I found on the web, I managed to whip up this code:

import bge

contr = bge.logic.getCurrentController()
scene = bge.logic.getCurrentScene()
obj = contr.owner

texture = None
if "render_to_texture" in obj:
    texture = obj["render_to_texture"]
else:
    camera = scene.objects['Camera']

    # create texture
    matID = bge.texture.materialID(obj, 'MAcam_render_material')
    texture = bge.texture.Texture(obj, matID)

    # create source
    texture.source = bge.texture.ImageRender(scene, camera)
    texture.source.capsize = [640, 480]
    texture.source.background = [255, 255, 255, 255]

    obj["render_to_texture"] = texture

print(texture)                                         # prints &lt;VideoTexture.Texture object at ...&gt;
print(bge.texture.imageToArray(texture.source, 'RGB')) # prints 'None'

# force a refresh
pixels = bytearray(640 * 480 * 4)
texture.source.refresh(pixels, "RGBA")

# print(pixels)                        # just prints an array of zeroes

if(texture.source.valid):              # always 'False'
    print(texture.source.image)
else:
    print("No image available")


And placed this script to be run every few ticks on a plane object with the material 'cam_render_material' on it.
But no matter what, I get empty arrays and None as a result

I've been pounding my head against the desk for the past three hours and heading nowhere. If someone has an hints, they'd be greatly appreciated.

I've added the blender file in question here, if someone wants to check it out
All I needed to do in your blend file was put the viewport in textured mode, then it started working. Other things you may like to consider:


It takes one frame for things to start happening, and because you're printing so many values, you have to wait a while.
the .valid attribute doesn't seem to work for ImageRender (it does for ImageFFMPEG though).
480*480*4 is nearly a million values. So if it looks like you're always getting 0's or 0xff's, you may not be. Try with a smaller image so you can see more of the data values
Consider unwrapping the plane and assigning it a shadeless texture so you can preview what is being displayed (you'll have to run texture.resresh(True) for it to update the texture instead of the buffer).
Consider switching to GLSL mode