but you can see with the cylinder and torus that the geometry is messing with the intended effect, I think we’re using the world coordinate of the fragment with respect to the view and projection rather than where the pixel would be on screen. Hmm…
the calculation of gl_fragCoord is the one side road that calculated before fragment shader
if you wanna calculate that from world+view+projectcion+camera direction you need some more parameter like camera target and camera fov and camera up vector after that you have just some result like matrix it is useless becasue it is easier you add that in NME and use standard shaders
** for someone wanna add that in NME dont forget gl_FragCoord.z is Depth too in modern browsers