uniform sampler2D tex; #pragma MSP stage(vertex) layout(location=0) in vec4 vertex; layout(location=1) in vec2 texcoord; void main() { gl_Position = vertex; passthrough; } #pragma MSP stage(fragment) layout(location=0) out float result; void main() { float value = texture(tex, texcoord).r; float pot; for(pot=0; pot