Thanks @DevDunk . The implementation was using the same methods as mine but as I read “shadergraph” I noticed that these nodes will most likeley be used for the fragment shader.
I was calculating the shadow coord in the vertex stage and that’s why it looked ugly. It didn’t get interpolated correctly in between the stages.