BruceSherwood / vpython-wx

VPython based on wxPython
Other
70 stars 38 forks source link

add an option to enable antialias #77

Closed ruoyu0088 closed 8 years ago

ruoyu0088 commented 8 years ago

Add an opition to enable antialias.

I can enable antialias by add following settings to attribList in create_display.py,

_wx.glcanvas.WX_GL_SAMPLE_BUFFERS, 1,
_wx.glcanvas.WX_GL_SAMPLES, 4,

even GLCanvas_IsDisplaySupported() returns False, the antialias is enabled.

BruceSherwood commented 8 years ago

Can you please provide an example program in which you can see a difference in the display due to making this change? I don't see any difference in the antialiasing with or without the change.

ruoyu0088 commented 8 years ago

Here is an example:

vpython

ruoyu0088 commented 8 years ago

My system is Windows 7, intel hd graphics 4000, I can see the different for even an box object.

BruceSherwood commented 8 years ago

Could you please send me an actual simple box program that shows the problem? On a Window 10 laptop with NVIDIA and Intel graphics I don't see any difference, using either NVIDA or Intel. I assume that you intend that the changed code should look like this:

    attribList = [_wx.glcanvas.WX_GL_DEPTH_SIZE, 24,
                  _wx.glcanvas.WX_GL_DOUBLEBUFFER, 1,
                  _wx.glcanvas.WX_GL_SAMPLE_BUFFERS, 1,
                  _wx.glcanvas.WX_GL_SAMPLES,
                  0]
ruoyu0088 commented 8 years ago

Here is the init code for GLCanvas():

attribList = [
    _wx.glcanvas.WX_GL_DEPTH_SIZE, 24,
    _wx.glcanvas.WX_GL_DOUBLEBUFFER, 1,
    _wx.glcanvas.WX_GL_SAMPLE_BUFFERS, 1,
    _wx.glcanvas.WX_GL_SAMPLES, 4,
    0
]
c = self.canvas = self._canvas = _wx.glcanvas.GLCanvas(parent, -1, 
    pos=(x, y), size=(w, h), attribList = attribList)
BruceSherwood commented 8 years ago

Fixed by update to the key file create_display.py. Many thanks for the report and solution!