about shader , fog , near far clip

i found in panda 1.10 that the auto-generated GL shader (setShaderAuto) doesn’t consider clipplanes when calculating fog - if nearclip=1000 meter, the fog at 1000 meter is 0.
so now i want to write my own shader to render fog. but i don’t know how to get the nearclip/farclip values in GLSL shader, except using uniform input.
and using uniform input is not convenient for me either - because my scene is rendered multiple times with different near/farclip values, unless i use callback, i can’t change uniform input when Panda is doing render.
and callback is not convenient either.
if nearclip/farclip values are directly available in GLSL shader, that’s much better.

Not sure if panda supports it, but there is gl_ClipPlane[i] in GLSL. So you would do something like dist = dot( gl_ClipVertex, gl_ClipPlane[i] ) (untested!).

i want per pixel fog, so vertex data don’t work for me.
do gl_clipplane[i] refer to nearclip farclip? i read something about gl_clipplane in “glsl spec” but don’t understand much.