i'm trying to change the saturation of a texture based on the z value of a given geometry using a glsl shader. namely, i'd like the texture to be black and white where the z-value of the geometry is 0., and then become progressively more colored as points are displaced.
as i understand it, i need to pass the vertex coordinates from the vertext to the fragment programs. i attempt to do so with a varying variable but i'm not getting what i expect in the fragment shader. has any one a hint about what i'm doing wrong?
script and patch are below.
Textured glass-like material lit with a point light w/ two specular components calculated per pixel.
Position of Light Source
Primary Specular Color
Secondary Specular Color
Primary Specular Multiplier
Secondary Specular Multiplier