SceneKit - get position in screen coordinate
<p>How can I get the coordinate of a point in the screen referential from the geometry shader entry point? SceneKit exposes a bunch of matrix transformations and their inverses (<a href="https://developer.apple.com/reference/scenekit/scnshadable" rel="noreferrer">https://developer.apple.com/reference/scenekit/scnshadable</a> > Using Inputs Provided by SceneKit) but I could not figure out how to use them...</p>

<p>for instance, in the geometry entry point that's executed in the vertex shader, I've tried:</p>

<pre><code>varying vec2 screen_coords;

#pragma body
screen_coords = (u_inverseModelViewProjectionTransform * _geometry.position).xy
</code></pre>

<p>but that doesn't seem to work :(</p>

<p>To clarify, I'd like <code>screen_coords</code> to be in [0, 1] * [0, 1] if the point is in the screen depending on it's exact position, and something else if not.</p>