I am not focused on a particular shader language. But I am trying to find a way to have a vector always coming from the top of my view.
Here are some screenshots to illustrate what I need.
Edit: I would like to obtain a mask. Here is a sample code for masking only bottom faces.
float mask = 1 - saturate(dot(float3(0.0, 1.0, 0.0), -worldNormal));
But the float3(0.0, 1.0, 0.0)
is not in the camera space and I would like to have it like the screenshots above.
It's maybe a matrix trick.