Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2016-06-09 22:07:58 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2016-06-09 23:15:13 +0300
commit8529b2f925c2a0f0cfa3ffe9218519b55223107e (patch)
tree2d8b7cbe6d9e813e96870a0594b32f282ea55cce /intern/ghost/intern/GHOST_ContextWGL.h
parent5da02ab9e249487081afe3ee459f1e8d15a7f674 (diff)
BGE: alpha on frame buffer and precedence of MSAA over swap.
A new option '-a' can be passed to the blenderplayer. It forces the framebuffer to have an alpha channel. This can be used in VideoTexture to return a image with alpha channel with ImageViewport (provided alpha is set to True on the ImageViewport object and that the background color alpha channel is 0, which is the default). Without the -a option, the frame buffer has no alpha channel and ImageViewport always returns an opaque image, no matter what. In Linux, the player window will be rendered transparently over the desktop. In Windows, the player window is still rendered opaque because transparency of the window is only possible using the 'compositing' functions of Windows. The code is there but not enabled (look for WIN32_COMPOSITING) because 1) it doesn't work so well 2) it requires a DLL that is only available on Vista and up. give precedence to AA over Swap copy: Certain GPU (intel) will not allow MSAA together with swap copy. Previously, swap copy had priority over MSAA: fewer AA samples would be chosen if it was the condition to get swap copy. This patch reverse the logic: swap copy will be abandonned if another swap method (undefined or exchange) will provide the number of AA samples requested. If no AA samples is requested, swap copy still has the priority of course.
Diffstat (limited to 'intern/ghost/intern/GHOST_ContextWGL.h')
-rw-r--r--intern/ghost/intern/GHOST_ContextWGL.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_ContextWGL.h b/intern/ghost/intern/GHOST_ContextWGL.h
index 3b04a33b662..580b4dcb82f 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.h
+++ b/intern/ghost/intern/GHOST_ContextWGL.h
@@ -32,6 +32,8 @@
#ifndef __GHOST_CONTEXTWGL_H__
#define __GHOST_CONTEXTWGL_H__
+//#define WIN32_COMPOSITING
+
#include "GHOST_Context.h"
#ifdef WITH_GLEW_MX
@@ -65,6 +67,7 @@ public:
*/
GHOST_ContextWGL(
bool stereoVisual,
+ bool alphaBackground,
GHOST_TUns16 numOfAASamples,
HWND hWnd,
HDC hDC,
@@ -164,6 +167,7 @@ private:
const int m_contextMajorVersion;
const int m_contextMinorVersion;
const int m_contextFlags;
+ const bool m_alphaBackground;
const int m_contextResetNotificationStrategy;
HGLRC m_hGLRC;