I want to utilize shaders to not only discard fragments if they are on one side of a predefined plane but also render a contour along the intersection.
My fragment shader currently does something along the lines of:
float dot = dot(world_coordinate, normalize(clipping_normal.xyz)) - clipping_normal.w; if (dot > 0.0f) discard;
this works but without the desired contour. I tried comparing the dot product against values close to 0.0 but this results in a contour with varying width depending on view etc...
This is what I am trying to achieve. Notice that the white contour/edge of where the plane intersects the sphere is of consistent width: