Summary: | First MSAA FBO frame on a mac osx nvidia card not antialiased | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | Andy Skinner <askinner> |
Component: | macosx | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | --- | ||
Version: | 2 | ||
Hardware: | All | ||
OS: | macosx | ||
Type: | --- | SCM Refs: |
ab07820e346f23aabc9d9364b7205017422cfaed
|
Workaround: | --- | ||
Bug Depends on: | |||
Bug Blocks: | 1206 | ||
Attachments: | Java program to reproduce. |
Description
Andy Skinner
2014-06-12 17:47:12 CEST
Comparing results w/ already existing test cases: com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLJPanelAWT com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLCanvasAWT com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLWindowNEWT Reproduced: GNU/Linux NV: No artifacts (proper MSAA in 1st frame) <http://jogamp.org/files/screenshots/bug1020/linux-nvidia/> OSX (any version): - UserVertFlip: No MSAA in 1st frame - DefVertFlip: Incomplete MSAA in 1st frame <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-NvidiaGeForce320M/> Reproduced on OSX Nvidia GT650M <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-IntelHD4000_NvidiaGT650M/> Description: See 1st frame (user-flip, aliasing artifacts): <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-IntelHD4000_NvidiaGT650M/TestGLReadBuffer01GLJPanelAWT.test11_MSAA8_UsrFlip-n0000-awt-usr000-GL2___-hw-fbobject-Bdbl-Frgb__Irgba8888-D24-St00-Sa08_default-0640x0480.png> where 2nd frame is fine: <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-IntelHD4000_NvidiaGT650M/TestGLReadBuffer01GLJPanelAWT.test11_MSAA8_UsrFlip-n0001-awt-usr000-GL2___-hw-fbobject-Bdbl-Frgb__Irgba8888-D24-St00-Sa08_default-0640x0480.png> ... Reproduction on OSX Nvidia GT650M (Comment 4) was done on a Macbook Pro w/ Intel HD4000 and NV Optimus, Optimus enabled. Forcing the Intel HD4000 (disabling Optimus with tool gfxCardStatus <http://gfx.io/>) shows _CORRECT_ results: <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-IntelHD4000/> 1st Frame: <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-IntelHD4000/TestGLReadBuffer01GLJPanelAWT.test11_MSAA8_UsrFlip-n0000-awt-usr000-GL2___-hw-fbobject-Bdbl-Frgb__Irgba8888-D24-St00-Sa08_default-0640x0480.png> 2nd Frame: <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-IntelHD4000/TestGLReadBuffer01GLJPanelAWT.test11_MSAA8_UsrFlip-n0001-awt-usr000-GL2___-hw-fbobject-Bdbl-Frgb__Irgba8888-D24-St00-Sa08_default-0640x0480.png> Excessive review of our FBO MSAA blit -> FBO Sink and GLJPanel resulted in finding no errors. Due to result of Comment 5 (working IntelHD 4000) I conclude this is a driver bug of OSX/Nvidia for GT650M and 320M. Remedy would be to render the initial frame twice .. We shall contemplate whether this is worth another quirk entry for OSX/Nvidia .. ? Further analysis of the OSX/NV bug shows that this is related to a never-written FBO blit. If initializing the FBO w/ glClear(GL_COLOR_BUFFER) this issue goes away. Currently we cannot inject this workaround into FBObject since it is too low-level, i.e. we don't know when it's first bind operation happens - i.e. user is ready. It is possible to inject this to the GLFBOffscreenDrawable though .. ab07820e346f23aabc9d9364b7205017422cfaed OSX/Nvidia's FBO needs to be cleared before blitting, otherwise first MSAA frame lacks antialiasing. GLFBODrawableImpl.initialize(..) can clear GL.GL_COLOR_BUFFER_BIT and GL.GL_DEPTH_BUFFER_BIT, if used. FBObject cannot clear the buffer(s) due to it's low-level API, i.e. it cannot know when the first bind occurs _after_ user completed FBO setup (attaching buffers). Hence plain FBObject usage required manual injection of glClear(..) after setup as demonstrated in GLJPanel. We may need to elaborate in this case, i.e. add an FBObject API entry like 'fbo.postInitNotify()'. See results: <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-IntelHD4000_NvidiaGT650M-FIXED/> 1st Frame: <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-IntelHD4000_NvidiaGT650M-FIXED/TestGLReadBuffer01GLJPanelAWT.test11_MSAA8_UsrFlip-n0000-awt-usr000-GL2___-hw-fbobject-Bdbl-Frgb__Irgba8888-D24-St00-Sa08_default-0640x0480.png> 2nd Frame: <http://jogamp.org/files/screenshots/bug1020/osx10_9_4-IntelHD4000_NvidiaGT650M-FIXED/TestGLReadBuffer01GLJPanelAWT.test11_MSAA8_UsrFlip-n0001-awt-usr000-GL2___-hw-fbobject-Bdbl-Frgb__Irgba8888-D24-St00-Sa08_default-0640x0480.png> |