fixed edge weight calculation
some modifications for the shader