Shader for rendering image with rounded corners

Hi,

I guess this is a simple shader to make, but I am new to this so any help is welcome.
I want to draw an image (this is a sprite from SM2, so this is a mesh with a material on it), which is composed of:
1 background, 1 image in the foreground(transparent one). The resulting image should have rounded corners.
Any hint?

Thanks

Can you provide a picture of the result you’d like? It sounds like you’d be better off generating differently shaped meshes than trying to round the corners with a shader.