You can just use Shader.SetGlobalVector(“_CameraUp”, Camera.main.transform.up) or use someMaterial.SetVector(“_CameraUp”, Camera.main.transform.up); Then add that variable to your shader.
In a surface shader it’s this… W being world, O being object, T being tangent space (if you’re using normal maps). Should be similar for a regular vert/frag shader.
Camera right direction = UNITY_MATRIX_V[0].xyz = mul((float3x3)UNITY_MATRIX_V,float3(1,0,0));
Camera up direction = UNITY_MATRIX_V[1].xyz = mul((float3x3)UNITY_MATRIX_V,float3(0,1,0));
Camera forward direction = UNITY_MATRIX_V[2].xyz = mul((float3x3)UNITY_MATRIX_V,float3(0,0,1));
Camera position = _WorldSpaceCameraPos = mul(UNITY_MATRIX_V,float4(0,0,0,1)).xyz;
I ended up using UNITY_MATRIX_V[1].xyz since there’s no need for matrix multiplication and just in case _CameraToWorld stops working sometime in the future.