The next shader takes the position of the vertex and modifies the transparency of the pixel if it’s the distance between said pixel and the center (250, 250) is bigger than 63000.
The transparency itself should be set considering how far is the pixel from the center, being more transparent if the distance is bigger.
And all your values are well above 1.0, I don’t think a single pixel will be transparent with that math.
I was hoping to find a nice variable to do the normalization from the vertex position but there isn’t one show in the docs. You may need to do some fancy math in the vertex shader.
I kinda figured out tho! (or at least it kinda works as I wanted to)
I used SCREEN_PIXEL_SIZE in order to reduce the values of VERTEX
(where x = VERTEX.x / SCREEN_PIXEL_SIZE)
Unless the UV’s are odd for the rect, this would be agnostic towards the placement and size of the rects.
The remap there is to take in a min/max for the fading edge to control it, which can be a parameter, for instance below is a large fade distance, then a shorter one that starts out past the middle. Adding a power function to this would further add some shape to the gradient.