Most of my images are point sprites and I’ve written a shader to scale the point size based on distance. However, I now need to rotate a quad around my point - all good. Except, when the resolution changes the difference between the size of the point sprite and the size of the quad changes (I’ve tied it to the height of the screen). My quad becomes too small to rotate around the sprite. So I’m thinking my scaling of my point sprite must be based somehow on the resolution of the screen, but I’m not quite sure how to fix it since I’m a complete noob. Help
As a temporary work around, I’ve done this… but I don’t know the rhyme or reason for it. I’m sure there is something simple I must be missing.
Instead of a static 200.0 * pointSize/ -modv.z;
I now divide the screen height by 6. So 1200/6 = 200, 1000/6 = 166, 800/6 = 133.
So if the screen resolution was 1280x800, my gl_PointSize would be this:
gl_PointSize = 133.3 * pointSize/ -modv.z;
This gets around the issue, but again, I’m hoping someone can shine some light on this and give me a more accurate method instead of passing in a scaling value.