How to port vMapUv to TSL?

It is uv(), as you already use it. Maybe there is some bug, some, some interference with the rest of the code or an incorrect intermediate value?

When I test uv() with Discard it works as intended:

https://codepen.io/boytchev/pen/xbObOBj?editors=0010

image

It might be easier to debug the function if you convert it to color and use as color node, not opacity node. In this way you can inspect whether edgePos, pixelWidth, fade, alphaFactor and newOpacity all have correct values.