diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2008-11-20 23:41:07 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2008-11-20 23:41:07 +0300 |
commit | 4c1dcf103d11e65c68392e5893540159a8f1ca85 (patch) | |
tree | b22a49ce75aa3c4ebc0fcb2469b086671063bf9c | |
parent | e77e6dea9762444144f86e66f01669510581d152 (diff) |
Added changes for enabling OpenGL accumulation buffer to implement antialiasing
in the Freestyle renderer.
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCarbon.cpp | 16 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.cpp | 11 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowX11.cpp | 6 |
3 files changed, 31 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp index 9ae9e283b69..94d1657a68c 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.cpp +++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp @@ -46,22 +46,34 @@ AGLContext GHOST_WindowCarbon::s_firstaglCtx = NULL; 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, }; diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 6a06f4d715a..f7e017305bb 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -84,7 +84,11 @@ static PIXELFORMATDESCRIPTOR sPreferredFormat = { 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 @@ GHOST_TSuccess GHOST_WindowWin32::installDrawingContext(GHOST_TDrawingContextTyp // 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 @@ static int WeightPixelFormat(PIXELFORMATDESCRIPTOR& pfd) { !(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; diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index 73d61a30977..e5d865f0254 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -168,6 +168,12 @@ GHOST_WindowX11( 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); |