How can I get the Scene Editor's Camera Position in ShaderLab?

I am using a vertex shader, that relies on the position of the Camera.. I am unable to get the camera used in Scene Editor.. is there a way to get teh camera position in the Shader Lib, without setting it as a variable? ( like a pre-defined one, that includes the scene editor camera );

Otherwise I'd like to know how I can grab the Camera GameObject from the Scene Editor

Hi, take a look at this: link text

unity sets those state variables according to the current camera, object and lights. Since the model*view matrix transforms objects from local to eye space, you can assume that the camera is located at (0,0,0).

Bye!

Have you checked the Vertex shaders that are included with Unity? Their source code can be downloaded here:

http://unity3d.com/support/resources/assets/built-in-shaders

Perhaps you could review the source of the built-in Vertex shader to see how they overcome this problem?