I'm trying to write a Shader with Cg that calculates a vertex's uv-texcoord out of its position in 3d space. I got some results but the shader obviously uses the positions of the vertices relative to the local coordinate system of the mesh, because every GameObject I applied this shader to gets texture coordinates accordingly to its rotation. And that's the way it should behave normally, of course. However, I wan't to compute the global - the world vertex coordinates. Is there any way to retrieve them in Cg? Maybe through some glstate.matrix multiplications? I don't quite get these yet.
asked Jun 07 '10 at 10:32 PM