How to get the viewing direction from render texture uv?
I am decoding normals from depth normal texture in order to make a custom camera effect - based on already existing edge detect effect. But these normals are relative to view space and I need to calculate dot(normal, viewdir) to find out if they face camera or not. Are there any special functions for that. Or the right way is to calculate that from texture uv and camera fov?
Is camera fov encoded into the depth texture or available from some shader variables, so my effect could work independently of given camera?
Comment