Bug 1261

Summary: Allow changing of texture sampler type for multisampled FBO
Product: [JogAmp] Jogl Reporter: Alan Sambol <alan.zgb>
Component: openglAssignee: Sven Gothel <sgothel>
Status: UNCONFIRMED ---    
Severity: enhancement CC: alan.zgb, kdropucic
Priority: P4    
Version: tbd   
Hardware: All   
OS: all   
Type: FEATURE SCM Refs:
Workaround: ---

Description Alan Sambol 2015-10-31 14:39:43 CET
When using global MSAA I can't control texture sampling MIN and MAG_FILTER. 

The following code is executed: 

if(numSamples>0) { 
            fbo.attachColorbuffer(gl, 0, true); 
            fbo.resetSamplingSink(gl); 
            fboTexAttachment = fbo.getSamplingSink().getTextureAttachment(); 
        } else { 
//            fbo0Tex = fbo.attachTexture2D(gl, 0, true); 
            fboTexAttachment = fbo.attachTexture2D(gl, 0, true, GL.GL_LINEAR, GL.GL_LINEAR, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE); 
        } 

As you can see, if no MSAA is used, I changed the default attachTexture2D() call to the one which can take MIN and MAG filters. If MSAA is used, fbo.resetSamplingSink(gl) internally calls the following code: 

samplingColorSink = createColorTextureAttachment(gl, cb0.getFormat(), width, height, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE); 

I manually changed FBObject.java (line 2407) to use GL_LINEAR instead of GL_NEAREST, but it would be nice to change it to a parameter somehow, somewhere.