I’m trying to play around with large points (32 by 32), yes, these are GL_POINTS, drawn with point size 32. First I want to experiment with Algorithmically drawing on these points in the fragment shader, and second I want to map textures onto these points (using the built-in variable gl_PointCoord in the fragment shader).
I’m not having any luck accessing the gl_PointCoord vector.
I’ve included the gl_PointCoord.s and gl_PointCoord.t in my shader, as color values, but nothing is the result… I also tried x and y.
I’ve tried googling some examples of using this built-in variable, but no luck so far.
Anybody have some examples that work, that I could see? Or anyone know of a bug/reason why these won’t work?
I’m trying to add to my videos on youtube that show how to program in OpenGL, here’s the shameless link:
In the compatibility profile, nothing has changed (that’s why it’s called the “compatibility” profile); you only get point sprites if you explicitly enable them.
Note that it’s the context profile which matters, not the profile specified in the shader. A shader using “450 core” will work in a compatibility profile (the reverse isn’t true), but gl_PointCoord won’t be set if point sprites aren’t enabled (either explicitly or because the version and profile force it).
Which tends to suggest that you’re using the compatibility profile; most toolkits will give you a compatibility-profile context unless you specifically request a core-profile context. And the compatibility profile doesn’t enable point sprites by default, regardless of version (it wouldn’t provide much compatibility if it did).