3

I'm trying to enable multisampling in an OpenGL program I'm writing. The application will require a substantial amount of GUI, so I am using wxPython (with which I am less familiar) instead of PyGame (SDL).

I really need hardware multisampling for the main GLCanvas. I am aware that this is borderline possible in the C++ version of wx, e.g., How to enable multisampling for a wxWidgets OpenGL program?. However, I attempted something similar, but it didn't work for wxPython.

So, what I want to know is, is multisampling even possible with wxPython?

Ideas I've already thought of:

  • Use a PyGame context inside a wx.Frame instead. Use SDL's hardware multisampling. No idea if this would actually work. IIRC, resizing SDL OpenGL contexts destroys their contents, which would be somewhat of a problem with this application. Although . . . I guess it might be workable.
  • Use a FBO with a higher resolution to render, and then downsample with multisampling. This . . . works, sorta. But supersampling is much slower than multisampling, and the technique doesn't work very well for things like GL_LINE. I have already tried this solution.
  • Use a FBO with a multisampling render target. This would involve a lot of changes, and would limit cross-system portability.
  • Ideally: use wxPython's built-in support, if it exists.
geometrian
  • 14,775
  • 10
  • 56
  • 132
  • The third option is 100% working one.I don't know the internals of Python wrapper but for example in Java wrapper like LWJGL you can set amount of multi-sampling when creating the display context.Are you sure there is not something like that in wxPython ? – Michael IV Jul 18 '12 at 12:12
  • No, which is why I'm asking. I did however give it a fairly thorough check, and I didn't see anything wxPython offers when making the window. – geometrian Jul 18 '12 at 17:41

0 Answers0