Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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;
}   
else
{
    //plane...      
    vs_fragColor = texture(u_particlesTex, vs_texCoord);
}
share|improve this question
1  
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. –  Bartek Banachewicz Dec 12 '13 at 11:48
1  
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. –  2am Dec 12 '13 at 11:58
1  
I believe this post has some info on this behaviour: gamedev.stackexchange.com/questions/11113/… –  akaltar Dec 12 '13 at 13:30
    
I already have latest drivers installed. Still stuck with this. :( –  2am Dec 16 '13 at 8:05
    
@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. –  akaltar Dec 24 '13 at 1:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.