According to NME procedural texture question - Questions - Babylon.js, I knew that’s because the screen.position(position2d) block is in [-1,1] range, just wonder why it isn’t [0,1], and I can’t find any explanation in Babylon’s document.
The range is [-1,1] because those are coordinates in NDC (Normalized Device Coordinates) space which is the space the coordinates must be after the vertex shader is applied to input vertices. The ProceduralTexture is creating two triangles with those vertex coordinates:
Understood, thank you very much for your explanation! Btw, can nme provide a quick transformer to let it go to [0,1]? I think in Procedural texture mode we will often use coordinates based on [0,1]. Now I have to convert its coordinates to [0,1] every time, that is, divide its value by 2 and add 0.5, like this: https://nme.babylonjs.com/#MXHRPH#3