Accessing camera image

Hi,

Is it possible to get the rendered image data attached to a camera.
Something like an array reprenting pixels color which will be printed if you choose to display this camera.

Accessing something like a printscreen image without showing it on the screen.

It could be for example to make a hiding detection.
I attached a camera to an ennemy, with very low render quality, where world is white and the player is black, then computing the sum of the pixels color to know if the ennemy can see the player.

I know I could use thing like rayshooting but this isn’t the same precision, and can’t take to account things like alpha-channeled objects.

Thanks a lot.

The problem with that system is that it would be very computationally expensive.

When you add more and more enemies, you will be doubling and tripling the amount of rendering being performed. Combine that with some image processing in the background and it will get very intense very quickly.

I would try and approach this problem by making your objects with alpha layers “invisible” to the ray cast and add supplementary geometry inside the solid areas of any partially alpha models to stop any solid sections also being see-through to the ray cast.