Hey guys. I started openGL ES a month ago, because it was a project requirement and I must say I really love it, so far.

I had a multi-texturing issue regarding finding a fragment position inside a primitive (rectangle). I needed a fragment position as x = [0.0 - 1.0], y = [0.0 - 1.0]. I found out about gl_FragCoord and gl_PointCoord.

The first one would give me a fragment coordinate in the window coordinate system which didn't do much for me. At first glance it worked fine, but it was just because the primitive was taking the whole screen, in other words I had no projection.

gl_PointCoord was somehow always 0. The thing that was confusing about it was what the reference said about "gl_PointCoord is a fragment language input variable that contains the two-dimensional coordinates indicating where within a point primitive the current fragment is located. If the current primitive is not a point, then values read from gl_PointCoord are undefined.", as I'm not exactly sure what a point primitive is. I ended up passing 0.0 - 1.0 coordinates for each vertex and getting a varying value inside the fragment shader, which worked just fine, but I'm sure there's another (better) way to do it.

Thanks in advance