I am using a ScreenSize block in NME and the screenSize uniform provided to the shader is (width x width) instead of (with x height).
Step to reproduce :
- Open the following playground https://playground.babylonjs.com/#C2ETM4#8.
- Ensure that the 3D window size is not a square for instance 894x951
- Run the inspector and check the drawElements call on the canvas frame buffer. You will see that the screenSize uniform is 894x894 :
The playground scenario may not be the simplest one but I haven’t found a better one !
I first draw a sphere in red to a render target and then I render again the sphere and I project the render target on it using screen space coordinates. You will notice that the spheres don’t match except when the 3D window is a square. If the uniform was width x height, the red sphere image should match exactly the 3D sphere.