I have thought up of the following:
- pass the camera position to vertex shader
distanceBetweenVertexAndCamera = length( cameraPosition - vertexPositionInObjectSpace );
- pass
distanceBetweenVertexAndCamera
to Pixel Shader
I'm slightly confused about this. Is distanceBetweenVertexAndCamera
what I'm looking for? I believe there's something I'm missing..
Do you think my workflow would work?