Maya attach camera to shader

Is there a way in maya to attach a camera to the color input of a shader? in which the shader for example attached to a plane will show what the camera is looking at?

thanks in advance

What you’re describing is called a “portal”. (The game called Portal is a weak pun of sorts). I haven’t seen a plugin or tutorial to do this. You could probably write a plugin to do it if you need it in the active viewport, and if you’re rendering, you can just render multiple times, and use frames rendered from another camera as a texture.

Maybe someone else has a better idea. It wouldn’t surprise me if this could be done in an easier way.

wouldn’t mind to try and create this with MEL or Python, but i have no idea where to start.

and thank you for the clarification, now i have some more ideas what to search for

well at least i found a really hacky way with a scriptJob that renders out an image from a camera and reloads it in the shader everytime the camera is moved (even over time when keyed) so a fast preview is somewhat visible

any other suggestions would be welcome as well

For what it’s worth, you could try implementing it in Maya’s OpenGL system. I’ve never messed with it, so I don’t know if it’s completely possible, but here’s a quick portal OpenGL guide

http://en.wikibooks.org/wiki/OpenGL_Programming/Mini-Portal