Hi all. I am really going mad about this issue.I want to implement MSAA .I have read OpenGL super bible and some other articles where there are some examples.What I understood from most of that data was that I need to
set up another FBO ,render samples to texture ,then feed it into the default FBO ? I don't get it .Can't I do MSAA in the default FBO ? In Super Bible the example is very problematic as it is used to present post processing effects so it can't be understood from it if it can be done with the default frame buffer .Anyways I am trying to do this this way (using LQJGL API) :

texture setup :
Code :
 
   _textureID = glGenTextures();
 
 
        glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _textureID);
        glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 8, GL_RGB32F, _textureW, _textureH, false);
 
 
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
 
 
 
 
 
 
        glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, _textureID, 0);

Then in the render loop I do this:
Code :
        glActiveTexture(GL_TEXTURE0);    
        glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, _textureID);

Now inside fragment shader I ,for now removed the sampling part and currently trying just to get the texture displayed on the plane because now it is black.So I just left this part:

Fragment :
Code :
 
#version 330 
 
 
in vec2 uvsOut;
 
 
uniform sampler2DMS origImage;
uniform samplerBuffer sampleWeightSampler; 
uniform int sampleCount;
uniform int useWeightedResolve; 
 
 
 
 
out vec4 outputColor;
 
 
 
 
 
 
void main(void) 
{ 
 
   vec3 a5 =texelFetch(origImage, ivec2(uvsOut.xy),8).rgb;
  //  outputColor = texelFetch(origImage, ivec2(uvsOut));
 
 
    outputColor=vec4(a5.xyz,1.0);
 
}

So ,the result I am getting so far is a black color. Anyone can help with this ?
Thanks.