Textures Alpha blending problems with Transparent NSOpenGLView

  • Hi All,

    In a transparent NSOpenGLView (I mean one can see the views that are
    behind it in the window)
    I draw a texture that has some zone with an alpha value different
    from 1.
    If the alpha value is 0 everything is OK and I see the background
    If the alpha value A is such that 0 < A < 1 then it blends directly
    with what is behind the view.

    If I turn off the transparency of the view, everything is drawn
    perfectly.

    Does any one knows what this problem comes from?

    Regards
  • Please unsubscribe me from this fucking email list

    On 9/26/07, Half Activist <halfactivist...> wrote:
    > Hi All,
    >
    > In a transparent NSOpenGLView (I mean one can see the views that are
    > behind it in the window)
    > I draw a texture that has some zone with an alpha value different
    > from 1.
    > If the alpha value is 0 everything is OK and I see the background
    > If the alpha value A is such that 0 < A < 1 then it blends directly
    > with what is behind the view.
    >
    > If I turn off the transparency of the view, everything is drawn
    > perfectly.
    >
    > Does any one knows what this problem comes from?
    >
    > Regards
    >
  • visit http://lists.apple.com/mailman/options/cocoa-dev/aychamo%
    40gmail.com
    choose unsubscribe and check the Yes, I really want to unsubscribe
    checkbox.

    On Sep 26, 2007, at 7:30 PM, Aychamo Aychamo wrote:

    > Please unsubscribe me from this fucking email list
    >
    > On 9/26/07, Half Activist <halfactivist...> wrote:
    >> Hi All,
    >>
    >> In a transparent NSOpenGLView (I mean one can see the
    >> views that are
    >> behind it in the window)
    >> I draw a texture that has some zone with an alpha value
    >> different
    >> from 1.
    >> If the alpha value is 0 everything is OK and I see the
    >> background
    >> If the alpha value A is such that 0 < A < 1 then it blends
    >> directly
    >> with what is behind the view.
    >>
    >> If I turn off the transparency of the view, everything is
    >> drawn
    >> perfectly.
    >>
    >> Does any one knows what this problem comes from?
    >>
    >> Regards
    >>
  • The first problem is that overlapping views are not supported unless on ov  the views is a sub-view of the other.  What you are doing won't work right with all Quartz views and using an NSOpenGL view doesn't improve the situation.

      The second issue is that NSOpenGLView is just drawing into the window backing store for the containing window.  When a non-opaque view draws in a window, the drawing is composited with whatever else is in the window backing store.  That explains what you see.

      The solution is to use a transparent child window to contain your NSOpenGLView.  Then the Quartz compositor which takes care of compositing all windows into the screen's frame buffer will be able to do the right thing.  By virtue of being in its own window, you NSOpenGLView will not have to share its window's backing store.

      Apple has thoughtfully provided example applications that do what your seem to want.  Search for one at developer.apple.com.
  • Yes I did have turned off surface opacity, this is what I want.

    On Sep 26, 2007, at 8:23 PM, Chris Niederauer wrote:

    > It sounds like you have turned off surface opacity.  This allows
    > you to blend the OpenGL view against things behind it using the
    > results in the alpha buffer.
    >
    > You can turn it on in your NSOpenGLView via:
    >
    > long opaque = YES;
    > [[self openGLContext] setValues:&opaque
    > forParameter:NSOpenGLCPSurfaceOpacity];
    >
    > Though I thought by default it is opaque, so perhaps you just want
    > to comment that call out?
    >
    > Chris
    >
    >
    > On Sep 26, 2007, at 10:23 AM, Half Activist wrote:
    >
    >> Hi All,
    >>
    >> In a transparent NSOpenGLView (I mean one can see the views that
    >> are behind it in the window)
    >> I draw a texture that has some zone with an alpha value different
    >> from 1.
    >> If the alpha value is 0 everything is OK and I see the background
    >> If the alpha value A is such that 0 < A < 1 then it blends
    >> directly with what is behind the view.
    >>
    >> If I turn off the transparency of the view, everything is drawn
    >> perfectly.
    >>
    >> Does any one knows what this problem comes from?
    >>
    >> Regards
  • On Sep 26, 2007, at 12:30 PM, Aychamo Aychamo wrote:

    > Please unsubscribe me from this fucking email list

    Yo, Einstein. Look at the bottom of every message you ever got ,
    including this one, for instructions on how to unsubscribe yourself
    from these lists.
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today