This is the first time I am working with particles (GL_POINTS) I am using kinematic equations and controlling their movement in vertex shader.

I am following an example given in OpenGL 4.0 Cookbook by David Wolff.

I am not able to see the texture which I am loading in the particle. However, I can see the texture if I put it to some other object, say quad.

enter image description here

I have increased the size of POINT using glPointSize just so I can see if the texture is really visible.

In the image above you can that I am loading and rendering the same texture for quad, but when I use the same texture for particles, I get different results. PS: The color which you're seeing for the particles is from the texture itself. If i choose a texture having white color, the same is seen for the particles.

Here is a code from my fragment shader. I figured if the texture is being displayed correctly for quad, then the issue may not be with the loading of the texture.

if(rendPlane == false)
    //vs_fragColor = vec4(.3f,.3f,0.6f,1.00f);
    vs_fragColor = texture(u_particlesTex, gl_PointCoord);
    vs_fragColor.a *= vs_transp;
    vs_fragColor = texture(u_particlesTex, vs_texCoord);
  • 1
    \$\begingroup\$ So it just takes first pixel, hm? gl_PointCoord should range from 0 to 1, thus covering a whole texture easily. Could this be a driver bug? HD Graphics 3000 isn't the most modern GPU out there, if you could test on some other reference platform, it might help in confirming that. \$\endgroup\$ – Bartek Banachewicz Dec 12 '13 at 11:48
  • 1
    \$\begingroup\$ I did actually, I have switchable graphics on Nvidia GT 555m the same result was observed. I did not bother to change the GPU for the sake of screenshot. \$\endgroup\$ – 2am Dec 12 '13 at 11:58
  • 1
    \$\begingroup\$ I believe this post has some info on this behaviour: gamedev.stackexchange.com/questions/11113/… \$\endgroup\$ – akaltar Dec 12 '13 at 13:30
  • \$\begingroup\$ I already have latest drivers installed. Still stuck with this. :( \$\endgroup\$ – 2am Dec 16 '13 at 8:05
  • \$\begingroup\$ @2am Could you post your results if you just output gl_PointCoord to vs_fragColor? If it will be one color, then the gl_PointCoord variable is not correctly set. \$\endgroup\$ – akaltar Dec 24 '13 at 1:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.