Bug 1261 - Allow changing of texture sampler type for multisampled FBO
Summary: Allow changing of texture sampler type for multisampled FBO
Alias: None
Product: Jogl
Classification: JogAmp
Component: opengl (show other bugs)
Version: tbd
Hardware: All all
: P4 enhancement
Assignee: Sven Gothel
Depends on:
Reported: 2015-10-31 14:39 CET by Alan Sambol
Modified: 2015-10-31 16:18 CET (History)
2 users (show)

See Also:
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
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); 
            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.