Revision: 17517
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17517
Author:   kjym3
Date:     2008-11-20 21:41:07 +0100 (Thu, 20 Nov 2008)

Log Message:
-----------
Added changes for enabling OpenGL accumulation buffer to implement antialiasing
in the Freestyle renderer.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowCarbon.cpp
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowWin32.cpp
    branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowX11.cpp

Modified: branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowCarbon.cpp
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowCarbon.cpp      
2008-11-20 08:25:01 UTC (rev 17516)
+++ branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowCarbon.cpp      
2008-11-20 20:41:07 UTC (rev 17517)
@@ -46,22 +46,34 @@
 const GHOST_TInt32 GHOST_WindowCarbon::s_sizeRectSize = 16;
 #endif //GHOST_DRAW_CARBON_GUTTER
 
-static const GLint sPreferredFormatWindow[8] = {
+static const GLint sPreferredFormatWindow[16] = {
 AGL_RGBA,
 AGL_DOUBLEBUFFER,      
 AGL_ACCELERATED,
 AGL_DEPTH_SIZE,                32,
 AGL_AUX_BUFFERS,     1,
+#if 1 // FRS_antialiasing
+AGL_ACCUM_RED_SIZE,     16,
+AGL_ACCUM_GREEN_SIZE,   16,
+AGL_ACCUM_BLUE_SIZE,    16,
+AGL_ACCUM_ALPHA_SIZE,   16,
+#endif
 AGL_NONE,
 };
 
-static const GLint sPreferredFormatFullScreen[9] = {
+static const GLint sPreferredFormatFullScreen[17] = {
 AGL_RGBA,
 AGL_DOUBLEBUFFER,
 AGL_ACCELERATED,
 AGL_FULLSCREEN,
 AGL_DEPTH_SIZE,                32,
 AGL_AUX_BUFFERS,     1,
+#if 1 // FRS_antialiasing
+AGL_ACCUM_RED_SIZE,     16,
+AGL_ACCUM_GREEN_SIZE,   16,
+AGL_ACCUM_BLUE_SIZE,    16,
+AGL_ACCUM_ALPHA_SIZE,   16,
+#endif
 AGL_NONE,
 };
 

Modified: branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowWin32.cpp       
2008-11-20 08:25:01 UTC (rev 17516)
+++ branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowWin32.cpp       
2008-11-20 20:41:07 UTC (rev 17517)
@@ -84,7 +84,11 @@
        0, 0, 0, 0, 0, 0,               /* color bits (ignored) */
        0,                              /* no alpha buffer */
        0,                              /* alpha bits (ignored) */
+#if 1 // FRS_antialiasing
+       1,                              /* accumulation buffer */
+#else
        0,                              /* no accumulation buffer */
+#endif
        0, 0, 0, 0,                     /* accum bits (ignored) */
        32,                             /* depth buffer */
        0,                              /* no stencil buffer */
@@ -491,6 +495,10 @@
                // For debugging only: retrieve the pixel format chosen
                PIXELFORMATDESCRIPTOR preferredFormat;
                ::DescribePixelFormat(m_hDC, iPixelFormat, 
sizeof(PIXELFORMATDESCRIPTOR), &preferredFormat);
+#if 1 // FRS_antialiasing
+               if (preferredFormat.cAccumBits > 0)
+                       printf("Accumulation buffer enabled\n");
+#endif
                // Create the context
                m_hGlRc = ::wglCreateContext(m_hDC);
                if (m_hGlRc) {
@@ -829,6 +837,9 @@
                !(pfd.dwFlags & PFD_DRAW_TO_WINDOW) ||
                !(pfd.dwFlags & PFD_DOUBLEBUFFER) || /* Blender _needs_ this */
                ( pfd.cDepthBits <= 8 ) ||
+#if 1 // FRS_antialiasing
+               !pfd.cAccumBits || /* for antialiasing in Freestyle */
+#endif
                !(pfd.iPixelType == PFD_TYPE_RGBA) )
                return 0;
        

Modified: branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowX11.cpp 
2008-11-20 08:25:01 UTC (rev 17516)
+++ branches/soc-2008-mxcurioni/intern/ghost/intern/GHOST_WindowX11.cpp 
2008-11-20 20:41:07 UTC (rev 17517)
@@ -168,6 +168,12 @@
        attributes[i++] = GLX_BLUE_SIZE;  attributes[i++] = 1;
        attributes[i++] = GLX_GREEN_SIZE; attributes[i++] = 1;
        attributes[i++] = GLX_DEPTH_SIZE; attributes[i++] = 1;
+#if 1 // FRS_antialiasing
+       attributes[i++] = GLX_ACCUM_RED_SIZE;   attributes[i++] = 1;
+       attributes[i++] = GLX_ACCUM_GREEN_SIZE; attributes[i++] = 1;
+       attributes[i++] = GLX_ACCUM_BLUE_SIZE;  attributes[i++] = 1;
+       attributes[i++] = GLX_ACCUM_ALPHA_SIZE; attributes[i++] = 1;
+#endif
        attributes[i] = None;
        
        m_visual = glXChooseVisual(m_display, DefaultScreen(m_display), 
attributes);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to