I have a plane with a cg shader on it that tells the plane to reflect a cube map. This line tells how it needs to reflect the cube map:
float3 reflectDir = reflect(viewDirection,v.normalWorld);
I want the reflection to be 0% if you look right at the normal and 100 % if you look at the normal from the side, how can I archieve this? Now I made an illustration of what I want:
reflectPercent = Vector3.Cross(viewDirection.normalized, normalDirection.normalized).magnitude;
Dot product is wrong - it is the magnitude of projection of a vector on another vector.
Although you could use
reflectPercent = Abs(1-Abs(Vector3.Dot(viewDirection.normalized, normalDirection.normalized)));