tex plugin using normals

I would like to have a plugi, which gives intens value 1 when the point (or face) looks upward and 0 when it looks sidewards (90° to former direction) or down.
How do I write such a plugin? I tryed to use result[ 5 ] … result[ 6 ], but these values are allways 0!?
And when I use texvec and use normal vector as tex coordinates, then I get as “looking upward” points, the points which are looking to the camera and not the points which are looking upward in the scene!

Has anyone a idea, how to solve this problem?

the texture plugins do not give you information about the geometry of an object.

You could I guess go into the code of blender and write your shader there.

Instead of using a plugin for this use a ramp shader, I’m guessing thats
basically what you want to do anyway.