Creating a custom fragment shader. Is it possible?

I have written a script in blender that generates random poses of a skinned armature
and then renders them as a depth map and as a color image of the skinned texture
and saves these images using the fileoutput composite nodes.

Now, I would like to render the scene one more time also as a color image.
However this time instead of reading the color from a texture map I would like to generate
the color in a fragment shader. In fact the color I want each fragment to take on is
simply the normal at each location of the surface sampled on the fragment values.

so gl_color=(nx,ny,nz).

I would also like to do another render round and save an image where each color
is the (x,y,z) coordinate of the original point which made it to being a fragment.

So, the question is: is there some way that I can achieve this? Can I edit a fragment shader
in Blender? If so then how?